summaryrefslogtreecommitdiff
path: root/src/kernel/proc.c
AgeCommit message (Collapse)Author
2022-04-15kernel/vfs: don't hang waiting for a vfs backend after it exit()sdzwdz
2022-04-14kernel/proc: only change state through `process_transition`dzwdz
2022-04-14kernel: store a pointer to the callback function in .waits4irqdzwdz
removes `proc.c`'s pointless dependency on `vfs/root.h`
2022-04-14kernel: port init's `printf` implementationdzwdz
2022-04-14kernel: basic page allocator, `process_free`dzwdz
2022-04-12kernel/proc: implement `process_next` for simple process iterationdzwdz
2022-04-11kernel: implement `cpu_pause()` in assembly, remove `irq_interrupt_flag()`dzwdz
2022-04-11kernel/arch: only allow IRQs in the idle processdzwdz
2022-04-11kernel: shutdown when init quitsdzwdz
thanks to this it's easier to power off - instead of waiting for all processses to quit (which now involves writing `quit` both on serial and ps/2), one of those can just somehow kill init. currently this is just done by exiting from any shell - init will return from await and exit too
2022-04-10init/fs: handle delegated reads in a subprocessdzwdz
first off: this is horrible. there's no CoW, so this is horribly slow. the sole purpose of this is to let the userland delegate handle multiple requests at once, because i'm implementing concurrent IO and I kinda need that. it's possible that handling of multiple requests could be handled in a better way - but this could be good enough once i implement CoW
2022-04-10kernel: idle processdzwdz
2022-04-10kernel: process_find_multipledzwdz
2022-04-09kernel: `vfs_request_accept` now doesn't switch processesdzwdz
2021-11-14shared: use a single implementation of mem* functions everywheredzwdz
2021-11-02fork2 refactor: every process now has (only) a single controlled vfs_backenddzwdz
2021-10-15kernel: quit QEMU once there are no running processes leftdzwdz
2021-10-04remove unused variables in process_try2collectdzwdz
2021-10-04implement process_kill()dzwdz
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-21start using sparse's `-Wdecl`dzwdz
2021-09-21implement (safe) min/max macrosdzwdz
2021-09-21refactor `await_finish` into `process_try2collect`dzwdz
the new name is terrible, but at least the function now has a clear purpose
2021-09-20create a few specialized panic()sdzwdz
thanks to this i can tell which ones are placeholders, and which ones should stay
2021-09-19show the malloc balance on halt; remove a bad kfree() calldzwdz
the kfree() call was freeing a buffer which was inside a process struct
2021-09-18remove `struct process.stack_top` - it was unuseddzwdz
2021-09-12implement part of `fs_respond`dzwdz
2021-09-11replace `user_ptr` with a linux-style `__user` annotationdzwdz
2021-09-08style: simplify the `kmalloc(sizeof(...` callsdzwdz
2021-09-05move most of the memory stuff to kernel/mem/dzwdz
2021-09-04refactor finding empty handles to a functiondzwdz
2021-09-04rename file descriptors to handlesdzwdz
2021-08-25remove FD_STDOUTdzwdz
init can just open `/tty` instead
2021-08-25implement vfs_mount_seed, which creates the vfs passed to initdzwdz
2021-08-24switch to using user_ptr for pointers coming from userlanddzwdz
this avoid accidental dereferences, and now it's easy to tell apart which pointers are safe to directly read and which aren't. cons: - const is completely discarded
2021-08-24replace () with (void) in function definitionsdzwdz
`()` means that any amt of arguments will be accepted, which isn't what i want
2021-08-24implement FD_SPECIAL_TTY, an stdout equaliventdzwdz
2021-08-24add some scaffolding for file descriptorsdzwdz
2021-08-22basic mount resolvingdzwdz
2021-08-22process_switch_any: deduplicate some codedzwdz
2021-08-22fix almost all compiler warningsdzwdz
2021-08-18processes now store a PID for debugging purposesdzwdz
2021-08-18fork(): store information about the parent toodzwdz
2021-08-18rename process_clone to process_forkdzwdz
2021-08-18store the processes as a tree instead of a listdzwdz
I'm about to need that for waits(). There's no single list of processes for simplicity's sake, but the search will now be even slower and it might even introduce a potential vuln! How fun! Someone could override stuff in .bss with random values. I'll either make gcc check if it hasn't gone past the end of the stack, or turn this into a non recursive function.
2021-07-31kmalloc() and kfree() stubsdzwdz
2021-07-26rename process_new() to process_seed()dzwdz
it's only meant to create the root process, the old name could've been misleading
2021-07-26exit() now switches to the first running processdzwdz
i used a linked list because it's the simplest way to implement this
2021-07-26fork() pt 1: cloning process memorydzwdz
2021-07-24fix some warningsdzwdz
2021-07-24sysexit() now overrides all registersdzwdz
when doing anything more complex than starting a new program, you pretty much need to pass a full register dump. otherwise stuff will break