summaryrefslogtreecommitdiff
path: root/src/shared
AgeCommit message (Collapse)Author
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-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-05kernel: initial partial pipe supportdzwdz
2022-07-05shared: fix memsetdzwdz
2022-07-01kernel: add the debug_klog syscall for tracking down process idsdzwdz
2022-06-30shared/mem: explicitly discard the const qualifier in memchrdzwdz
2022-06-29init/fs: tmpfs driver with support for creating new filesdzwdz
2022-06-29kernel/vfs: add the OPEN_CREATE flagdzwdz
2022-05-26syscalls/memflag: FINDFREE flagdzwdz
2022-05-15shared/ring: ring_contigdzwdz
2022-05-15shared/ring: use char* for the bufferdzwdz
i don't think uint8_t can alias. char can
2022-05-06syscalls: merge fork() and fs_fork2()dzwdz
2022-05-02meta: write a script to generate `src/init/syscalls.c`dzwdz
2022-05-02syscalls: fork() noreap flagdzwdz
2022-05-02kernel/vfs: pass `close()` calls to fs handlersdzwdz
2022-04-14kernel: port init's `printf` implementationdzwdz
2022-04-12kernel: make all sizes unsigned, sort out the sign messdzwdz
2022-04-10kernel/driver: modify the ps2/serial drivers to use ring_tdzwdz
2022-04-10shared: implement a basic ring bufferdzwdz
2022-03-27shared/memcpy: copy in 4byte blocksdzwdz
2022-03-27shared/syscalls: change some pointer types to void*dzwdz
2022-03-06shared: add strcmp() testcases, fix invalid implementationdzwdz
2021-11-26shared: move `enum vfs_operation` to types.hdzwdz
2021-11-20kernel: fs_wait returns a success val; the op type is put in the structdzwdz
2021-11-16kernel/vfs: add a capacity field to fs_wait_responsedzwdz
2021-11-14shared: move the str* implementations to shared/mem.cdzwdz
2021-11-14shared: use a single implementation of mem* functions everywheredzwdz
2021-11-02fork2() refactor: implement fs_fork2()dzwdz
2021-11-02fork2 refactor: every process now has (only) a single controlled vfs_backenddzwdz
2021-10-04remove support for processes returning strings on exitdzwdz
This isn't really all that useful, it doesn't enable anything that wasn't possible before. With it removed I'll be able to implement process_exit() in a much simpler way.
2021-09-21add `__force` for marking casts across adress spacesdzwdz
2021-09-20add an offset parameter to read() and write()dzwdz
2021-09-20use a single struct for all fs_wait return valuesdzwdz
2021-09-18put the `handle_t` typedef in `shared/types.h`dzwdz
2021-09-18merge `kernel/types.h` and `init/types.h`dzwdz
2021-09-16fs_read stub, basic implementation in userlanddzwdz
2021-09-15fs_wait: pass the file ID toodzwdz
2021-09-14merge the `syscall_handler` and `_syscall` declarationsdzwdz
i think that making the call a bit more "transparent" makes the code nicer
2021-09-12simplify `fs_respond`'s signaturedzwdz
2021-09-12move `enum vs_operation` to shared/flags.hdzwdz
2021-09-12implement part of `fs_respond`dzwdz
2021-09-12barebones `memflag()` implementation - letting the user allocate pagesdzwdz
2021-09-12remove `shared/vfs.h`, it was unuseddzwdz
2021-09-12implement most of fs_waitdzwdz
awaited_req is a garbage name but i couldn't come up with a better one. i also have no idea how to handle all the failure states
2021-09-11replace `user_ptr` with a linux-style `__user` annotationdzwdz
2021-09-09basic _syscall_fs_wait() impl, doesn't pass the req yetdzwdz
2021-09-08copy _syscall_fs_open's argument to a new buffer instead of a shared onedzwdz
this will be needed for storing vfs_op's properly
2021-09-07implement fs_create(), front/back fs handlesdzwdz