"Loup OS" (TL;DR: WIP RISC-V OS)

https://codeberg.org/loup-os (see https://codeberg.org/loup-os/dev-env for something ready-to-be-run)

History and Future

This is my work-in-progress operating system. It emerged from an x86_64 kernel + bootloader I wrote two years ago (the link is a link to the announcement post I did here). In another post here I announced the “Zig OS explained”, which was a really basic kernel and a bootloader that can load that kernel, for x86_64.
In that second post, I already talked a bit about the “Loup OS” which is my current “main” OS project. The goals of that OS are very ambitious: I want it to be as fast, efficient and accessible as possible (but by having so ambitious goals, I’m probably not going to end up having to enshittify my OS because the defined “peak” will come really late).

What can the OS do right now?

Right now, that OS hasn’t got that far. I am a high school student and I only have spare time occasionally (and in that spare time, I also have other hobbies to do), so I don’t find enough time to work on it every day. When I’m lucky, I can work on it during a weekend (the last weekends were lucky, the ones before that… not). The “x86_64 kernel + bootloader” has basically got another friend, the riscv64 kernel (that can do more than the x86_64 kernel, but still not enough to call it an “operating system”).
But there is a reason I wanted to write this “Showcase” post today (the creation of that “Loup OS” is quite old, so I could have written a Showcase post earlier): I have successfully made it to the USERSPACE (actually with a kind of memory protection, so the “difficult way”)!
The next steps are doing some persistency stuff (file system) for loading executables (also for loading the kernel’s own executable and finally getting some working DWARF debug info), and then adding system calls plus executables.

Zig version

I use Zig master (as of writing 0.17.0-dev.338+0d4f3cc67) for it, and I try to keep up with all changes the Zig team makes (and, very rarely, throw up a PR to the Zig programming language repo to make some embedded programmer’s lives easier).

NO LLMs!

All code for this operating system was hand-written. Not only are there too many ethical concerns to use any AI (=“amplified idiocracy”), it also isn’t fun for me. Especially with OS development, you often work on one part, struggle from time to time, and then FINALLY it works (and that feeling of having made something work is great). When AI wrote the code for you, you aren’t the one that made it work. And at least I can’t imagine any way in which you could have that feeling when you weren’t responsible for the reason that gave you the feeling (making it work). Also, this journey wouldn’t have been an adventure if I did this with AI (so it wouldn’t have been interesting).
But doing RISC-V stuff is an adventure, doing OSDev stuff is an adventure, and doing both at the same time, especially in a “new” language as Zig, is an adventure. There were times where I screamed against a wall (out of frustration), and there were times where I couldn’t feel happier.

Thank you to all people on Ziggit that helped me during this journey (in the last time, I didn’t really ask any questions, but you helped me tremendously to get into Zig) and all people that ever contributed to this amazing programming language (especially the Zig core team)!

22 Likes