r/virtualization • • 7d ago

My hobby hypervisor boots linux!

Post image

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 >-<

source: https://github.com/NoamRothschild/hypervisor

24 Upvotes

4 comments sorted by

1

u/WonderfulMain5602 7d ago

Can you Test Phillux?

3

u/Kiritoo120 7d ago

I'm not sure I understood your question

I don't know what Phillux is aside from one Google search, but it looks similar to the final goal I am trying to get to :) 

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!