Bootloaders for a Toy Rust OS

Written by Katrina Ellison Geltman on Fri 03 October 2025.

I had to try a few different bootloaders with the toy Rust operating system I'm building. Here's what I was able to get working and what I gave up on.

  • ❌ Rust's bootloader crate. I couldn't get this to build without Rust's standard library. bootloader depends on serde, which uses std. Lots of errors like, "can't find crate for std". I tried building the bootloader separately from the kernel, but I wasn't able to do it successfully. (This is likely operator error, as I'm not that familiar with cargo configuration files).

  • Limine with a 64-bit OS. This worked, but the OS was really slow to launch. Code and config here.

  • ❌ QEMU's built-in bootloader with a 64-bit OS. This didn't work. I got errors like, "Error loading uncompressed kernel without PVH ELF Note". My understanding is that there is a way to do this, but it's complicated.

  • ✅ QEMU's built-in bootloader with a 32-bit OS. This worked, and the OS launched quickly. Code and config here.

Want to become a better programmer? Join the Recurse Center!