eChat

Categories => Technology & Gadgets => Topic started by: Esha on May 02, 2026, 01:17 PM

Title: 64-bit Rust OS built during board exams now runs DOOM
Post by: Esha on May 02, 2026, 01:17 PM
I kicked off this little project on 9th March this year, right in the middle of my board exams (probably not the smartest timing, I know, TT). It's been an amazing ride!

It all began with the question, "how hard could it be?" and just yesterday I finally hit the ultimate milestone: IT RUNS DOOM!

I posted about it on X yesterday and the response was insane, so I thought I'd share the technical details here!

- Github repo: https://github.com/thatmagicalcat/magicalos
- Architecture: x86_64
- Language: Rust (with two C dependencies)
- Bootloader: Limine (initially I was using GRUB/multiboot2 and later realised it was a pain in the back)
- C standard Library: mlibc https://github.com/thatmagicalcat/magicalos-mlibc

Porting DOOM:

- VESA Framebuffer: Linear Framebuffer (LFB) initialized via the bootloader
- Virtual Device: Created a device node in my Virtual File System so userspace programs can access the framebuffer and keyboard
- Rendering: The program opens `/dev/fb0` and mmap's it to get a pointer to the LFB. Implemented `DG_DrawFrame()` from doomgeneric, which copies pixel data to the mmap'ed LFB
- Input: Added a PS/2 keyboard driver and created a keyboard event device in the VFS that the user program can open via `/dev/kbd`

It's still a work in progress, but seeing DOOM run flawlessly on a kernel I wrote myself in Rust is an unmatched feeling. I'd love to hear your thoughts or any questions!

Title: Re: 64-bit Rust OS built during board exams now runs DOOM
Post by: Rajesh on May 02, 2026, 01:17 PM
Board exams?
Title: Re: 64-bit Rust OS built during board exams now runs DOOM
Post by: Pratik on May 02, 2026, 01:17 PM
Wow, bro, I feel so behind the competition and I'm just finishing my 12th grade too.
Title: Re: 64-bit Rust OS built during board exams now runs DOOM
Post by: Amrita on May 02, 2026, 01:17 PM
Hey, what a small world!
Title: Re: 64-bit Rust OS built during board exams now runs DOOM
Post by: Harry on May 02, 2026, 01:17 PM
I'm a YC founder working on operating systems - do you happen to know how to write drivers?
Title: Re: 64-bit Rust OS built during board exams now runs DOOM
Post by: Swathi on May 02, 2026, 01:17 PM
As someone my age with the same interest, how should I get started? I know a bit about Linux, kernels, and a little bit of everything. I've been thinking about diving in for a while but don't know where to begin. Your project is a real inspiration.
Title: Re: 64-bit Rust OS built during board exams now runs DOOM
Post by: Aditya on May 02, 2026, 01:17 PM
How long did it take you to get here - from learning the basics to actually implementing it? Have a good day!
Title: Re: 64-bit Rust OS built during board exams now runs DOOM
Post by: Ritvik on May 02, 2026, 01:17 PM
That's freakin' awesome!
Title: Re: 64-bit Rust OS built during board exams now runs DOOM
Post by: Tushar on May 02, 2026, 01:17 PM
Hey, you're doing amazing work even though this isn't my area - I'm an iOS developer. If I want to start developing OSes and drivers, how tough is it to pick up Rust first and then move on to the other parts?
Title: Re: 64-bit Rust OS built during board exams now runs DOOM
Post by: Arpita on May 02, 2026, 01:17 PM
Sharma ji's son, lol. Great work, dude - keep it up!
Title: Re: 64-bit Rust OS built during board exams now runs DOOM
Post by: Gayatri on May 02, 2026, 01:17 PM
Neovim for the win! I don't know much about OS development, just that it's tough. All the best for your future.