aboutsummaryrefslogtreecommitdiff
path: root/src/uapi
AgeCommit message (Collapse)Author
2024-07-18mark some ipc functions inlineKimplul
+ Seems to improve code quality a little bit
2024-07-18add ipc_tail()Kimplul
+ ipc_kick() does a forward and a tail at the same time The idea with ipc_tail() is to allow 'trusted' calls, so for example a process is not allowed to willy-nilly open a file, as it has to go via init(), making the eid 1. This way the receiver can know that the request has gone through init() and can open up a new connection (file, whatever) after which requests from that pid/tid are allowed without init() intervention
2024-07-14expose max number of concurrent threads to usersKimplul
+ Can be used to build fast hashmaps to speed up ipc
2024-07-14add some missing docsKimplul
2024-07-09fix make cleanKimplul
2024-07-09start working on testsKimplul
+ Current setup will likely not last long, just a stopgap until I figure out how I want to build each testcase etc. Probably dir based, but I'll probably add some scripts that generate the build rules for each test case (or binary?). Also, should probably put ouput files in a build directory and keep the source clean, but again, good enough for now. Will have to start implementing more extensive tests, and probably come up with some way to compare textual output etc.
2024-07-09allow mapping null pageKimplul
+ User has to 'free' the 0 page before it becomes accessible to mapping. Probably worth noting that this is likely VERY niche and mainly concerns stuff like certain kinds of emulators that I'm still eons from implementing, but still. Unbacked pages can also be useful for some kinds of notifications, like 'if someone writes to this page, please report it to me with this ID' or whatever, I remember seeing some discussion about it somewhere but that's also not really relevant for the moment. Most significantly, at least with the current design, after the null page is freed it becomes available for use to regular req_mem() calls, so users should probably using locks around memory requests. That's probably a good idea anyway as internally the kernal has to lock the virtual memory, and without a scheduler it might cause threads to spin for a while in the kernel which is rather bad.
2024-07-08fix LLVMKimplul
+ Anything extern is right out as LLVM doesn't produce correct code for them. Maybe if I added some extra attributes but I'm skeptical. Replaced with static variables and getters/setters. + Inline ASM is apparently a bit buggy, so use an assembly stub when jumping to init. + Minimize work done in main() to minimize chance of LLVM doing something silly. Still not 100% certain that I shouldn't just write the main() as an assembly stub in arch/riscv64 to be absolutely sure everything works as intended. + Make .kernel.start section SHF_ALLOC, otherwise lld complains about pc-relative addressing Probably some other stuff as well that I'm forgetting right now. But at least with LLVM14 LTO seems to work, which is pretty cool?
2024-07-08add orphan checking to timer and irq handlingKimplul
2024-07-07add req_page back in as I realized it's usefulKimplul
+ Can be used to pass contiguous memory regions to things like virtio block devices for implementing disk drivers etc.
2024-07-07make executable entrypoint universal callbackKimplul
+ Effectively means that all executables can be called into, but if an exe doesn't want to deal with anyone else it should just set a flag like `not_really_a_server` or whatever
2024-07-06add RAM usage countingKimplul
+ Slightly more overhead but will help track down possible memory leaks in the future. Could also add in a flag for turning off/on but I don't think the difference in performance is that significant.
2024-07-06make dmem a bit more readableKimplul
2024-07-06pretty massive virtual memory rewriteKimplul
+ The system is now a bit simpler and hopefully easier to understand, while also extending the shared memory to be 1:N, where there is one owner who may become a zombie while waiting for the N to die.
2024-07-05implement bklKimplul
+ Start out using big kernel lock, apparently seL4 thinks its good enough. I might have a go at using a more fair lock, and possibly moving to more fine-grained locks if I really feel the need to get scalability up.
2024-07-05fix some small build issuesKimplul
+ Compiling for size emits memcpy() calls after they've already been removed by LTO, so add __used attribute to counteract this. Newer versions of GCC seem to prefer `-flto=auto` to just `-flto`, so use that. printf format %d -> %ld
2024-07-04use notification framework for orphanizing threadsKimplul
2024-07-04generalize orphantsKimplul
+ Allow threads to make themselves become orphants
2024-07-04add zombie and orphan threadsKimplul
+ Should write this down somewhere but the idea is that when a process gets killed, it frees all the memory it can, making all threads within that process orphans. Orphaned threads are assigned to the init process, which will generally call exit() on each one. Zombie threads are threads that own some bit of shared data, and whose reference count is above zero. They may not be swapped to or called, even though they take up space in thread map and reserve their thread ID.
2024-07-03simplify notifications a littleKimplul
2024-07-02enable irqs when we sleep or swap threadsKimplul
+ Also swap checks if thread is running
2024-07-02more complete interrupt handling outlineKimplul
+ Still largely untested, should really try to come up with a proper testsuite, at the moment it's mostly me trying things out in the (as of yet unreleased) kmx repo
2024-07-01expand notifications into interrupt handlersKimplul
+ Terminology is still a bit poor, and will still have to write documentation + implement ipis properly
2024-06-01document sleepKimplul
2024-06-01add sleep syscallKimplul
+ Sets the current core to sleep
2024-06-01slight tweaks to sptree stuffKimplul
2024-05-24rename common to srcKimplul
+ I keep starting to type src and wondering why autocomplete won't work, I guess src is just uncounciously a better name