aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2026-01-24make physical memory request a capabilityKimplul
+ Seems obvious, not sure why I hadn't done it already
2026-01-24improve timer handlingKimplul
+ Previous code assumed a timer would only trigger when requested, but didn't explicitly disable timers during init. Newer versions of qemu (>= 10?) seem to have some kind of timer set, unsure if that's via OpenSBI or what exactly but some slower tests were failing because of it.
2024-11-08document __prepare_execKimplul
2024-11-02make it more obvious dynamic elf isn't supportedKimplul
+ also cleans up a few warnings I've been annoyed by
2024-11-02update elf docsKimplul
2024-11-02allow skipping some cache flushes in procKimplul
2024-11-02check effective id of createKimplul
2024-11-02check spawn exhaustionKimplul
2024-11-02intial working sys_spawnKimplul
2024-11-02initial exec supportKimplul
2024-11-01simplify enter_rpc, remove finalize_rpcKimplul
+ The simulated benchmarks shows very slightly more than 2M requests per second, new record!
2024-11-01mark some hot path functions inlineKimplul
+ Gives a hint to the LTO optimizer to more agressively inline the functions, seems to bring a slight performance increase
2024-11-01flush only current tlb during page faultKimplul
2024-11-01copy rpc stacks directlyKimplul
+ Speeds up fork a little bit
2024-11-01move stack modifications to be earlier in rpcKimplul
2024-11-01speed up creating threads quite a bitKimplul
2024-11-01test all ipc variants more-or-less properlyKimplul
2024-11-01remember to set regs to some valid addressKimplul
+ Worked in qemu, failed in visionfive2, fixed.
2024-11-01rpc actually marks and unmarks stack regionsKimplul
+ Processes won't be able to read previous stack frames etc
2024-10-30bookkeepingKimplul
2024-10-30tests passKimplul
2024-10-30most of the way to passing testsKimplul
2024-10-29start moving towards threads always being in rpcKimplul
2024-08-30improvements to shared memory handlingKimplul
+ Now each shared region is reference counter (technically each region is refernce counted, private regions just have a count of 1). Also, syscalls that touch the TLB get flushed, but should probably look into where else this flushing might be needed.
2024-08-30fix a couple memory issuesKimplul
+ get_mem_node() clears out the memory so we don't accidentally read stale flags + Thread creation simplified a bit, each thread references itself and data freeing is based on when the reference count reaches zero.
2024-08-30speed up ipc_resp a bitKimplul
+ Skip unwinding stack and just jump directly to userspace
2024-08-27convert addr to page in find_closest_used_regionKimplul
2024-08-27add optimizations for memcpy and memsetKimplul
+ Apparently primary bottlenecks for sys_fork() and sys_create(), speeds things up quite a bit
2024-08-26add magic assertKimplul
2024-08-26fix memory leaks destroying threadsKimplul
2024-08-26make sys_create() better + testKimplul
2024-08-26improve killing processes/threads, testKimplul
+ Remove sys_kill() as we should be using a two-stage process where a thread is first orphaned by sys_detach(), and then the thread itself calls sys_exit() after it has done all necessary cleanup in init.
2024-08-22add ipc_notify testcase, remove ipc_ghostKimplul
+ A bit easier to implement just ignoring the ipc_resp() arguments than try to enforce that a notification is exited from by ipc_ghost(), especially in cases where the root process has been killed.
2024-08-22change sys_ret handling to always include idKimplul
2024-08-21add malloc testKimplul
2024-08-18small fixes to issues reported by analyzerKimplul
+ Currently analyzer has to be run manually with something like make CFLAGS='-fanalyzer -Wno-analyzer-infinite-loop' I use an infinite loop as an assert, I know it's not great/technically UB but it's just a fallback. + Analyzer is still somewhat limited, I could add in more attributes about different functions, such as memory allocation sizes etc. + If I ever set up a CI pipeline, remember to use analyzer?
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-17make compilation more robust on *BSDKimplul
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-14add more checks to getting tcbKimplul
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 regions to have reserved areasKimplul
+ A reserved area is an area at the start of the region that should not be used unless explicitly asked for, for example null pages. As such, a small correction to my previous commit message: There's no danger in not locking req_mem() etc, as a null page will only be allocated when explicitly asked for.
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