ruos is a small operating system written in Rust, inspired by the Writing an OS in Rust series by Philipp Oppermann. It is a learning project for exploring low-level development in Rust without relying on an existing operating system.
The kernel boots with bootloader 0.11 into a linear framebuffer and exposes an interactive graphical launcher driven over the serial port.
- Boots into 64-bit long mode via the
bootloadercrate (BIOSbuild) - Runs without the Rust standard library (
no_std+no_main) - Pixel framebuffer rendering with an 8x8 bitmap font
- Graphical launcher with serial-driven menu (COM1, polled)
- Apps:
- Image viewer that scales embedded QOI images to fit the screen
- An RL interpreter shell (arithmetic,
if,for), using the e-RL embedding crate
- Bump allocator for heap-allocating
no_stdcrates - Panic handler that reports to the serial console
All input is polled from the serial port (COM1). With the default QEMU setup, type into the terminal that launched cargo run.
| Context | Keys |
|---|---|
| Launcher | 1 image viewer, 2 RL shell |
| Image viewer | n/p next/previous image, q back to launcher |
| RL shell | type a program, Enter runs it; backspace edits; q on an empty line returns to the launcher |
Example shell session:
1 + 2
=> 3
5 * (2 + 3)
=> 25
The embedded RL build currently supports expressions only; print, let/assignment, and fun definitions are not implemented yet.
Place a QOI file in kernel/assets/ and add an include_bytes! entry to the IMAGES array in kernel/src/apps/viewer.rs:
const IMAGES: &[(&str, &[u8])] = &[
("sample", include_bytes!("../../assets/sample.qoi")),
("gradient", include_bytes!("../../assets/gradient.qoi")),
];The bytes are embedded into the kernel image at compile time. Images up to 1024x1024 with up to 4 channels are supported.
- Rust nightly toolchain (pinned in
rust-toolchain.toml) x86_64-unknown-nonetarget (rustup target add x86_64-unknown-none)qemu-system-x86_64
cargo runbuild.rs compiles the kernel subcrate for x86_64-unknown-none, packages it into a bootable disk image with the bootloader crate, and the host binary launches QEMU with the serial console attached.
The toolchain is pinned to nightly-2026-07-20 because newer nightlies broke the x86_64 crate used by the bootloader.