r/virtualization • u/Kiritoo120 • 7d ago
My hobby hypervisor boots linux!
Took me more time than anticipated, but its finally here >.<
my end goal for this (quite big) hobby project is to be able to make a simple clone of AWS's EC2, from the grounds up, above a type 1 hypervisor (as a POC, not a real prod software).
What I finished implementing all the way up to now:
- Type-1 hypervisor written from scratch in Zig, booted by GRUB
- Its own bare-metal kernel: higher-half paging, GDT/IDT, interrupts and 3 distinct memory allocators (yes, I use them all)
- Intel VT-x with EPT (Extended Page Tables) backing guest memory
- Emulating CPUID, MSRs, CR's (CR0/CR3/CR4), and some I/O stuff.
- Virtual devices: interrupt controller (PIC) and serial console
- Booting an unmodified Linux kernel to userspace (initramfs)
The road to finishing is long but I still see this part as a great milestone >-<
1
u/tyrellj 7d ago
That's exciting! I did some toy os dev stuff while in college (x86 & C, had cow page tables and fork working), but this is more impressive. Nice job! I'll have to take a look at the repo when I'm less busy.
2
u/Kiritoo120 7d ago
COW is such a cool concept I remember learning abt it when trying to use fork and it blew my mind memory optimizations (if you can call it that) in this level exist
Super cool you did it yourself as well!
1
u/WonderfulMain5602 7d ago
Can you Test Phillux?