| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
+ 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.
|
|
+ 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?
|
|
|
|
+ Can be used to pass contiguous memory regions to things like virtio
block devices for implementing disk drivers etc.
|
|
+ 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
|
|
+ Align kernel to 2MiB boundary in u-boot
+ Optimize alignment functions a little bit, should still have to check
on real hardware but 'feels' more clean
+ Add early boot debugging
+ Put extra cores we aren't ready to account for to sleep if/when they
boot.
+ Make BASE_PAGE_SIZE constant on riscv64/32, helps the compiler with
some alignment checks among other things.
|
|
+ Had some minor issues with a wraparound of size_t that effectively
meant that some regions were allocated twice. Also, booting should be
a bit more reliable now, turned out that the previous iteration of the
booting was just accidentally working due to the kernel being placed
'close enough' in RAM to where it was linked to. Fixed by allocating a
vmem of O1 that maps the kernel to a 2MiB boundary at boot, pretty
nifty.
|
|
|
|
+ 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.
|
|
+ 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.
|
|
+ Took some fairly significant changes, for one the kernel is no longer
relocated at the start of a boot, instead it sits wherever the user
decides the kernel should sit. Similarly, the initial kernel stack and
page table are stored within the binary, slightly bloating the size
but making it much safer to boot since there's really no chance of us
overwriting the fdt or initrd in memory.
|
|
|
|
+ Found it in newlib. This allows the compiler to more effectively
optimize away unnecessary register operations. Applied to both kernel
and init.c for a slight speed increase.
I really should move init.c to some other repository though, the
binary files are starting to get annoying
|
|
|
|
|
|
+ Now 10M alloc/frees succeed, which totals more memory than the virtual
machine has, so no too obvious leaks are occuring. For future
debugging speed, changed 10M to 1M.
+ Also quick fix to rpcs, stacks are now assigned. Not entirely sure why
they worked before this, but good that I found it.
|
|
|
|
|
|
+ Eliminated need for save/load_regs, now the register save area is
behind a pointer which _slightly_ increases overall syscall delay, but
speeds up ipc requests by a fair bit.
|
|
|
|
|
|
+ Not strictly done yet, but we can swap between two processes :D
|
|
|
|
|
|
|
|
+ Slightly unsure if it should be a syscall, or if assign would be
enough. Also, which thread should run in a fork/spawn? For now, old
thread, though this might increase latency. Or add swap flag to these
calls?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ Essentially, separate root process and remote procedure call handling.
I really should write down some documentation so I don't forget, but
essentially: All threads share a common process virtual memory, and
when a thread wants to make an rpc, it switches over to its own rpc
vmem space that is linked to the remote process.
|
|
|
|
|
|
The output is close enough, and I like that uncrustify is a third-party
tool, so people can install a single tool for formatting instead of
having to lug around a whole toolchain. I fully expect to have to add
settings to uncrustify.conf, but let's see how this goes.
|
|
+ Next step, start documenting contents of each file.
|
|
|
|
+ Still lots todo, and I'm not entirely sure how I should handle program
space switches (mainly since the kernel uses the process' stack, maybe
it shouldn't?)
|
|
|
|
|
|
+ Release mode is sort of broken, as lto doesn't work with linker
relaxation and turning the relaxation off causes issues with the jump
from init to kernel (as I've currently implemented it, could probably
be fixed with a manual jump from assembly, I'll add it to my TODO
list)
|