A single stage, freestanding x86 bootloader written in Rust. RustyBoot probes the disk MBR, initializes a minimalist EXT2/3/4 reader, loads an ELF32 kernel from common paths, and transfers control to the kernel entry point. It uses a tiny VGA text console and a minimal ATA PIO disk driver.
Part of the Rusty-Suite. Built for learning, experimentation, and low-level OS development.
Working on: Porting RustyBoot to UEFI with EFI entry point and SimpleFileSystem kernel loading
- x86 32-bit freestanding environment,
no_std,panic=abort - Disk bring-up via ATA PIO LBA28 on primary master
- MBR read and parse with active partition selection
- EXT2/3/4 superblock detection with early boot constraints
- Minimal file read with direct, single indirect, and double indirect blocks
- ELF32 little endian loader for PT_LOAD segments
- Simple bump-based memory manager (1 MB – 8 MB region with kernel reservation)
- VGA text console output
- Modular Rust codebase with clear separation of:
- Config (runtime options & parameters)
- Hammering (low-level memory & disk probing logic)
- Logger (diagnostics and debugging output)
- ✅ Implemented
- ATA PIO disk identify and sector reads
- MBR parsing and active partition discovery
- EXT filesystem init and early boot reads
- File reads by absolute path
- Kernel discovery and ELF32 loading
- Memory initialization and kernel memory reservation
- 🛠️ Planned or partial
- FAT filesystem implementation (stub only)
- EXT extents and 64-bit features not supported
- Triple indirect blocks not implemented (1 MiB file buffer limit)
- More robust device discovery and error reporting
flowchart TD
A["Start"] --> B["Config init"]
B --> C["Logger init"]
C --> D["Memory init"]
D --> E["Disk init (ATA PIO)"]
E --> F["Read LBA0 and parse MBR"]
F --> G["Init EXT from active partition"]
G --> H["Find kernel in common paths"]
H --> I["Load and parse ELF32 PT_LOAD"]
I --> J["Reserve memory & setup stack"]
J --> K["Jump to kernel entry"]
- Entrypoint:
_start() - Config:
Config::load() - Logger:
init_logger() - Disk:
init(),read_sectors() - MBR:
probe(),find_active_partition() - EXT:
init_with_lba(),read_file() - Kernel loader:
find_and_load_kernel(),parse_and_load_elf(),jump_to_kernel() - Memory:
init(),reserve_for_kernel()
- EXT2/3/4 early boot reader
- Validates magic
0xEF53 - Rejects extents and 64-bit features for simplicity
- Block size: 1–4 KiB (multiple of 512)
- Supports direct, single indirect, and double indirect blocks
- Triple indirect not implemented
- File size limit: 1 MiB (compile-time buffer cap)
- Absolute path only (example:
/boot/vmlinuz)
- Validates magic
- FAT
- Stub only (not yet implemented)
- Search paths:
/boot/vmlinuz,/boot/kernel,/kernel,/boot/bzImage - ELF32 little endian only
- Loads PT_LOAD segments to specified virtual addresses
- Zero-fills memory when
mem_size > file_size - Reserves the loaded region
- Rust toolchain with
llvm-tools-preview ld.lldorlldobjcopy(LLVM or GNU)qemu-system-i386make- Linux host recommended (example:
zypperon openSUSE)
rustup component add llvm-tools-preview
# 1. Build the UEFI bootloader (produces RustyBoot.efi)
make bootloader
# 2. Optional: create a FAT32 disk image and copy the EFI file
make Disk
# 3. Run RustyBoot in QEMU
make run
# 4. Run in QEMU with GDB debugging
make debug
# 5. Clean build artifacts and disk image
make clean- Target:
x86_64-uefi.json - Executables: true
- Endianness: little
- Panic strategy: abort
- Code model: kernel
- Red zone: disabled
- Linker script: generated at build time via build.rs
- 32-bit only; no long mode
- Static memory map (no E820 probing)
- No filesystem journaling, extents, or 64-bit EXT features
- ELF64 unsupported
- Serial output minimal (VGA primary console)
- Single disk, primary master ATA PIO assumed
See CONTRIBUTING.md and CODE_OF_CONDUCT.md.
The names Rusty-Suite, RustyTodos, RustyBoot, and Rusty-Checker are part of this project identity. See TRADEMARK.md.
GPLv3. See LICENSE.
Built with ❤️ in Rust.