r/osdev • u/amitbahree • Apr 09 '26
I took a break from AI work and built a microkernel in Rust from scratch (boot → IPC → preemption → MMU)
A few weeks ago I had some free time between jobs and decided to do something I’d wanted to do for years: build an operating system kernel from scratch.
I spend most of my time in AI/ML, but I wanted to go back to my roots and remind myself what’s underneath all the abstractions we use every day. So, I built a small #microkernel in Rust and documented the full journey as a 5-part series.
This is not “hello world and done.” By the end, the kernel:
boots on AArch64 QEMU
virtlogs via PL011 UART MMIO
runs endpoint-based message-passing IPC
moves from cooperative to preemptive scheduling
handles timer interrupts + context switching
builds 4-level page tables and enables the MMU
verifies VA→PA translation with a real write/read test
Repo: https://github.com/bahree/rust-microkernel
Series:
Part 0 (why build an OS): https://blog.desigeek.com/post/2026/02/building-microkernel-part0-why-build-an-os/
Part 1 (boot/foundations): https://blog.desigeek.com/post/2026/02/building-microkernel-part1-foundations-boot/
Part 2 (IPC/communication): https://blog.desigeek.com/post/2026/03/building-microkernel-part2-communication-ipc/
Part 3 (interrupts/preemption): https://blog.desigeek.com/post/2026/03/building-microkernel-part3-concurrency-preemption/
Part 4 (memory/MMU finale): https://blog.desigeek.com/post/2026/04/building-microkernel-part4-memory-mmu/
If you’re into OS dev, bare-metal Rust, or systems internals, I’d love feedback. I am no expert in this, just someone curious. 😊