I built a microkernel in Rust from scratch

88 points amitbahree 9 comments

I just finished a learning project: building a small microkernel in Rust on AArch64 QEMU virt.

I mostly work in AI/ML now, but between jobs I wanted to revisit systems fundamentals and experience Rust in a no_std, bare-metal setting.

What I implemented:

  • Boot bring-up (EL2 → EL1)
  • PL011 UART logging over MMIO
  • Endpoint-based message-passing IPC
  • Cooperative scheduler, then preemptive scheduling
  • Timer interrupts + context switching
  • 4-level page tables + MMU enable
  • VA→PA translation verification (0xDEADBEEF write/read)

What stood out from a Rust perspective:

  • Rust makes unsafe boundaries explicit in kernel code
  • You still need unsafe, but it stays localized and easier to reason about
  • Type/ownership checks caught issues that would’ve been painful to debug at runtime

Start here (Part 0): https://blog.desigeek.com/post/2026/02/building-microkernel-part0-why-build-an-os/

Part 0 has navigation links to Parts 1-4 at both the top and bottom, so you can walk the full series from there.

I’m definitely not an expert in Rust or OS dev, just sharing in case it helps someone else learning. 😊