aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-11-01add note about running on real hardwareKimplul
2024-11-01smp on visionfive2 'works'Kimplul
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-30clarify visionfive2 docsKimplul
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-30add some basic benchmarksKimplul
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-30specify mabi and marchKimplul
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 some missing documentationKimplul
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-26check for running out of memory during forkKimplul
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-26don't free the physical address of page tablesKimplul
2024-08-26simplify testsKimplul
2024-08-22add fork testKimplul
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-22add note about testsKimplul
2024-08-22change sys_ret handling to always include idKimplul
2024-08-22add basic ipc-req testKimplul
2024-08-21ensure our memory is actually used up fullyKimplul
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-17remove tests.mkKimplul
+ Accidentally included, should really be more observant
2024-07-17replace run with check in READMEKimplul
2024-07-17make tests a bit more sensibleKimplul
+ At least by my standards. Some amount of scripting going on, but should still be fine. Effectively, source.mk contains information to build the test, check.mk checks the generated log from running the test. As a results, check.mk should output OK into reports/$TEST/OK if everything went well, and anything else otherwise. The user can then look at reports/$TEST/log to see what went wrong. I expect to add some more features, such as starting QEMU with gdb and running a single test a bit easier than right now (same limitation as in the top level makefile, i.e. you have to specify make -f scripts/makefile $TEST from within `tests` and you must have ran `make check` at that point so that `tests.mk` is fully generated. Not huge issues, but slightly annoying, somewhat unsure how to work around them properly but we'll see.
2024-07-17cleanup riscv64/confKimplul
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