summaryrefslogtreecommitdiff
path: root/src/kernel/syscalls.c
AgeCommit message (Collapse)Author
2022-09-20shared: rename ufs_request to better fit its role in userlanddzwdz
The old name could have suggested that it held a response to a request received by fs_wait. The new name is unfortunately very similar to the `struct vfs_request` already used internally in the kernel, but it's better at conveying that it contains a filesystem request yet to be handled. vfs_request - virtual filesystem request (a bad name in hindsight) ufs_request - user filesystem request
2022-09-02kernel/proc: introduce child ids for telling children apartdzwdz
2022-08-30set up the stack in user/bootstrap instead of the kerneldzwdz
2022-08-28kernel/vfs: minor vfs_request / vfs_root_register reworkdzwdz
* changed vfs_root_register's name because the _mount didn't add anything * removed the old pointless vfs_backend_tryaccept calls from drivers * because of that, i could remove the vfs_backend globals * replaced the horrible BACKEND_KERN macro * all vfs_backends are now stored on the heap
2022-08-28shared/path_simplify: return an unsigned valuedzwdz
2022-08-22syscalls/fs_respond: make the *buf argument constdzwdz
2022-08-19syscall/fs_wait: return a handle for each requestdzwdz
2022-08-19kernel: kzallocdzwdz
2022-08-19kernel/proc: abstract away managing handlesdzwdz
2022-08-12kernel/proc: don't expose internal fuctions, clean up apidzwdz
2022-08-12vfs: OPEN_RO flag, read-only whitelist entriesdzwdz
2022-08-11kernel/syscalls: merge a few syscalls into vfsop_simpledzwdz
Those had a lot of repeating code, but I'm not sure if this is the right change. Well, apart from making pipe_joinqueue more consistent.
2022-08-11kernel: reformat the _syscall dispatch function to a syscall/linedzwdz
2022-08-11vfs: support for removing filesdzwdz
2022-08-08user: separate tmpfs into its own executable, add `mount`dzwdz
2022-08-05add _syscall_getsizedzwdz
2022-08-05move path_simplify to shared code, move its tests to userlanddzwdz
2022-08-04do some simple TODOs, organize the rest; general code maintainancedzwdz
2022-08-04syscalls: add _syscall_sleep()dzwdz
2022-07-29syscall/write: WRITE_TRUNCATEdzwdz
2022-07-29syscall: up the max argument count to 5; make write accept flagsdzwdz
2022-07-26shared: move some headers from shared/ to camellia/dzwdz
2022-07-20user/elf: free memory not belonging to the elf when jumping to itdzwdz
2022-07-18syscalls: implement execbufdzwdz
i have been planning to implement something like this for a while now. it should be faster when doing consecutive syscalls (to be tested). it will also be helpful in writing the elf loader
2022-07-17kernel/virt_cpy: error struct, better error handlingdzwdz
2022-07-16amd64: back at the shell!dzwdz
2022-07-16amd64: init can print to the terminal nowdzwdz
2022-07-16amd64: seemingly working syscalls (SYSCALL/SYSRET)dzwdz
2022-07-10syscalls: implement dupdzwdz
2022-07-09syscalls/pipe: turn into a POSIX-style api with separate rw endsdzwdz
Without separate read/write ends you can't tell when there are no more writers left if you have multiple readers. Consider this piece of code: int fd = pipe(); fork(); // execution continues in 2 processes while (read(fd, &some_buf, sizeof somebuf) >= 0) { ... } Once both processes call `read()`, it's obvious that no writes are possible - all the processes that hold a reference to the pipe are currently stuck on a `read()` call, so the kernel could just make it return an error in both. But, what then? It's still possible to write to the pipe, and you can't know if the other process will do that. Thus, if you don't want to miss any output, you have to keep reading the pipe. Forever. Both processes end up stuck. Having separate read/write ends prevents that.
2022-07-08kernel/proc: remove the type argument from process_handle_getdzwdz
2022-07-08kernel/syscalls: fix the SYSCALL_RETURN macro for returning pointersdzwdz
2022-07-08syscall/fs_respond: get the file id from the buf argumentdzwdz
Previously, file ids could only be positive integers, so their range was 31 bits - not enough to represent the entire memory. Now, pointers can be safely used as file ids.
2022-07-07kernel/vfs: delegate support in _syscall_fs_respond!dzwdz
this is big in terms of speed, it avoids a lot of unnecessary context switches
2022-07-07shared: add a flags argument to _syscall_fs_responddzwdz
2022-07-06kernel: don't panic on nonexistent syscallsdzwdz
2022-07-06kernel/pipes: read & write supportdzwdz
2022-07-05kernel: initial partial pipe supportdzwdz
2022-07-01kernel: disable klogdzwdz
2022-07-01kernel: add the debug_klog syscall for tracking down process idsdzwdz
2022-06-29kernel/vfs: add the OPEN_CREATE flagdzwdz
2022-05-26kernel/style: don't return pointless values in _syscalldzwdz
2022-05-26syscalls/memflag: FINDFREE flagdzwdz
2022-05-21kernel/i386: only map what's absolutely necessary in the userdzwdz
2022-05-21syscall/memflag: zero out allocated pages to prevent leaksdzwdz
2022-05-21syscall/memflag: implement freeing memorydzwdz
2022-05-15syscall/await: ensure the children are reapable before hangingdzwdz
2022-05-15kernel/syscall: ensure SYSCALL_RETURN value is useddzwdz
2022-05-15kernel/mem: remove virt_cpy2kmallocdzwdz
2022-05-06kernel: remove the union in `struct handle`dzwdz