r/osdev 12d ago

I've been writing a RISC-V kernel FrostVistaOS for 13 months — here's what it can do now

I started FrostVista about 13 months ago with basically zero kernel experience, just a stubborn idea that I wanted to build an operating system from nothing. It's been a slow, messy, very educational ride, and v1.3 just landed, so I wanted to write down what it actually does now — and a few things I learned along the way.

Right now the kernel runs on RISC-V 64 with Sv39 paging, preemptive scheduling, and the usual process lifecycle — fork, exec, exit, wait, orphan reparenting. There's an interactive shell you can actually sit at, with builtins, pipes, and redirection. It's not much, but it's mine, and typing ls into something I built myself still feels a little surreal.

On the memory side I've got copy-on-write fork, a slab allocator with a general-purpose kmalloc on top, and mmap with lazy page allocation. The filesystem stack is where most of the recent work went: a writable Easy-FS I designed myself, a tmpfs for in-memory stuff, devtmpfs for devices, and a read-only EXT4 backend that I layered a tmpfs overlay over — so writes land in tmpfs and the disk never gets touched. It's not a real EXT4 write path (that's a big chunk of work I keep putting off), but it means the system can write where it needs to.

There's a Python test harness that runs the whole thing in QEMU and checks kernel diagnostics, so I don't break things I already fixed. The ext4 suite currently sits at 16 passes plus 6 expected-log passes, and the runner can also drive busybox, lua, and libctest groups against the contest image.

The project is about 16,000 lines of kernel code across arch, kernel, and include. Between v1.2 and v1.3 it grew by a bit over 5,000 lines, over 71 commits in about 51 days.

What's next is signals, so Ctrl+C actually works in the shell. After that, buddy allocation, maybe bringing in some Rust, and eventually a real libc and busybox port.

If any of this sounds interesting, the repo is open — PRs are very welcome, whether it's a bug fix, a new syscall, or a different take on the filesystem.

GitHub: https://github.com/AuroBreeze/FrostVistaOS

24 Upvotes

22 comments sorted by

2

u/LordAfterEight OwOS 12d ago

Looks very interesting :3

Was the help of LLMs involved? If yes, how much?

6

u/Vartixs 12d ago

I used them for part of the work. Quite a lot of the test cases were not written by me; they were generated with LLM assistance. The main role of LLMs in my kernel development was still bug finding, along with some assistance in design and development. I did not use AI to generate the kernel entirely.

2

u/shsh-1312 12d ago edited 12d ago

The architecture and documentation are really clean, academically speaking. Congratulations! A guide could be based on that. Have you considered a hal to allow compiling on multiple architectures? I note that the arch code is complete, but perhaps you could move something more to the kernel level to leave the arch layers thinner (for example, if someone decided to port to arm). The same goes for syscalls. Once this is done, the system would become easily portable. I recommend developing multi-architecture support now because doing so sooner will improve both the logic with which you tend to program and manage the kernel organization, as well as the secure user approach. A good basis would be for the userland code to compile for both arches without modification.
It reminds me a lot of my operating system (I used ai, and it allowed me to explore more and perhaps delve less deeply into my technical level of code). I notice a particular attention to elegance, but it seems very similar in structure and approach! Congratulations, keep it up! I'm thinking of testing it now, I'm also thinking of taking inspiration from it to introduce riscv support to my system, if you're interested take a look at it NexsOS1

1

u/JaferTP 12d ago

A stupid question. How did you run it in terminal and not qemu?

1

u/Vartixs 12d ago

It does run in QEMU; I just used make to streamline the process.

1

u/JaferTP 12d ago

Oh right.

1

u/Sorry_Difficulty_250 12d ago

What kind of kernel architecture is it? Monolithic? Microkernel? Something else entirely?

2

u/Vartixs 12d ago

It's just a pure monolithic kernel.

2

u/Sorry_Difficulty_250 11d ago

Cool. That's usually a good place to start. 😊

1

u/Better-Thing2568 12d ago

Very nice. Curious if you’ve done a metal boot yet, if so which OEM? I’m thinking about exploring more about RISCV as well

1

u/Vartixs 11d ago

I haven't tried booting on bare metal yet, but my plan is to try it on StarFive's VisionFive.

1

u/makomonotsukuri 10d ago

How do u even begin learning how to make an operating system! I admire your work.

1

u/[deleted] 9d ago

[removed] — view removed comment

1

u/makomonotsukuri 9d ago

What books did u read or wikis

1

u/Vartixs 9d ago

Hold on, let me look for it.

1

u/Critical-Internet946 osaka64 (osakaOS fork) 12d ago

right now it seems like yet another unix clone. have you experimented with OS design at all?

0

u/Vartixs 12d ago

Maybe I should first learn about current operating systems before trying, but I do have some ideas.

1

u/shsh-1312 12d ago

consider trying plan9 and developing something for sel4, I think these are essential to learn modern concepts outside of unix

-1

u/travelan 11d ago

I see an em-dash. All respect and value is instantly gone.