summaryrefslogtreecommitdiff
path: root/src/kernel/syscalls.c
AgeCommit message (Collapse)Author
2024-08-18kernel: basic _sys_setxattr implementationHEADmaindzwdz
2024-08-17*: getxattrdzwdz
2024-08-17kernel/syscall: inline simple_vfsopdzwdz
History is a circle. In hindsight that function was pointless, it makes the code more complicated for pretty much no reason (except saving a few LoC, which is silly).
2024-08-17kernel: split the kernel/user inputs in VfsReqdzwdz
I think I've done this refactor in the opposite direction a few years ago. This is mostly meant to prepare me for setxattr, which requires two inputs - coincidentally, one is already going to be a kernel input, and the other will be an user input, so it works out. I also just didn't like the previous way it worked, this feels cleaner.
2024-08-15kernel: disallow NUL bytes in pathsdzwdz
2024-08-02*: use a generic UserRegs type everywhere I'm storing registersdzwdz
mostly inspired by Plan 9's Ureg, probably obvious from the name
2024-07-27kernel: don't use pointer types for registers, add proc_savereturndzwdz
2024-07-26kernel: implement _sys_intr_returndzwdz
2024-07-20*: moving filesdzwdz
2024-07-17kernel: make kmalloc accept a numeric "tag" instead of a freeform descriptiondzwdz
This will both let me save space in the allocation header, and make the debugprint more readable.
2024-07-14kernel: make the adhoc VfsQueue queues use ReqQueue insteaddzwdz
I'm still not sure if I should use sys/queue.h for this. But yeah, this is more consistent, and it will also let me switch over to O(1) insertions later on.
2024-07-14kernel/malloc: clean up the code a little bitdzwdz
The bitmap functions now accept page addresses so I don't have to handle raw bitmap indexes, which was kinda complex. kmalloc_sanity is now not visible to other code as it wasn't really that useful in the first place.
2024-07-13kernel/malloc: limit the maximum allocation size to under a pagedzwdz
This will likely be changed back, but for the time being it will let me implement a better allocator without too much effort.
2024-07-11kernel: start cleaning up VfsRequestdzwdz
* I'm being more strict about the linked list state to hopefully ensure I'm not leaking any references. * vfsreq_create was renamed to vfsreq_dispatchcopy as that name feels more clear. It copies its argument, and dispatches it. * Requests for user backends are now handled more like requests for kernel backends - there's an accept() function that accepts a request.
2024-05-11kernel: remove HANDLE_NULLFSdzwdz
It was a dumb hack that wasn't even necessary - an error when mounting should shadow over the mountpoint anyways.
2024-05-11kernel: refactor handle management out of proc.cdzwdz
2024-03-13kernel/malloc: slight rework (it's still bad), store more metadatadzwdz
2024-02-23kernel: knock off some simple vfsreq TODOsdzwdz
2024-02-23kernel: fix _sys_fs_wait in initdzwdz
2024-02-21kernel: integrate the proc_ns_next fixes into proc_nextdzwdz
2023-12-25kernel: _sys_getnull() (basically /dev/null)dzwdz
2023-09-29*: properly remove _sys_filicidedzwdz
not sure how that slipped by
2023-09-25kernel: remove _sys_filicide (made redundant by _sys_intr)dzwdz
2023-09-25kernel/intr: accept a message, allow killing processes via intrsdzwdz
2023-09-24kernel: delay removing processes from treedzwdz
2023-09-18kernel: implement _sys_time()dzwdz
After some consideration this seems like the most fitting way to handle timekeeping. Directly, the syscall is only useful for keeping time within a single process, but it is meant to be used for e.g. NTP clients, which will provide the real time through the VFS.
2023-09-17kernel/amd64: add HPET support, slightly rework time handlingdzwdz
2023-08-31kernel: add _sys_getprocfs in place of HANDLE_PROCFSdzwdz
This makes the side-effects more explicit, and feels less hacky than `HANDLE_PROCFS`. I don't think accessing a handle alone should have side-effects, even if it's a "special" one.
2023-08-29kernel: remove _sys_await, emulate it in libcdzwdz
2023-08-27ports: qbe, cproc :^)dzwdz
2023-06-17kernel: fix procfs overflow bug, add safeguard to prevent similar onesdzwdz
2023-06-11kernel: replace await with wait2, roughly compatible with POSIXdzwdz
dash works now :^)))
2023-06-10kernel: implement DUP_SEARCH (like unix's F_DUPFD)dzwdz
2023-06-10kernel: implement getpid, getppiddzwdz
2023-06-04kernel: rework /proc/ and process IDsdzwdz
I'm yet to write proper docs but the TL;DR is: Mounting /proc/ creates a new pid namespace. You're still visible in the old namespace with your old pid, but your children won't be. You see your own pid as 1. Current pids of children will be preserved, pids will be allocated starting from the highest one of your children.
2023-02-23toolchain: update, move to a Camellia-specific toolchaindzwdz
2023-01-25kernel: move /mem/alloc to /malloc and linker.ld to arch/amd64/dzwdz
2023-01-25kernel: consolidate some header filesdzwdz
2023-01-25style: typedef structs, shorter namespacesdzwdz
I've wanted to do this for a while, and since I've just had a relatively large refactor commit (pcpy), this is as good of a time as any. Typedefing structs was mostly inspired by Plan 9's coding style. It makes some lines of code much shorter at basically no expense. Everything related to userland kept old-style struct definitions, so as not to force that style onto other people. I also considered changing SCREAMING_ENUM_FIELDS to NicerLookingCamelcase, but I didn't, just in case that'd be confusing.
2023-01-25kernel/virt: replace the virt_cpy api with a more foolproof onedzwdz
2023-01-19kernel: user interruptsdzwdz
2023-01-11kernel: return EPIPE when fs_waiting on a dead filesystemdzwdz
2023-01-08kernel: let parents kill their children againdzwdz
2023-01-08kernel/proc: don't kill children when parent diesdzwdz
2023-01-06kernel: basic procfsdzwdz
2023-01-06kernel: turn the NULLFS into an always present special handledzwdz
preparing for HANDLE_PROCFS
2022-10-08kernel/handle: reuse ->writeable/->readable for pipesdzwdz
2022-10-08syscall/open: don't check for free handlesdzwdz
doesn't really prevent anything, and makes it harder to test edge cases
2022-10-08tests: some tests for when a process has no free handlesdzwdz
2022-10-02syscall/open: add the full suite of READ/WRITE flagsdzwdz