Skip to content

supython-coder/bootloader

Repository files navigation

rustboot

An experimental pure-Rust x86 bootloader for the planned second edition of the Writing an OS in Rust series.

This is still work in progress.

The idea is to build the kernel as a no_std longmode executable and then build the bootloader with the kernel ELF file in kernel.bin. The output is a flat binary disk image (including a basic MBR) that can be run in QEMU or burned to an USB flash drive (CDs require a different kind of bootloader, which is not supported at the moment). The plan is to create a custom tool (or cargo subcommand) that performs these steps automatically.

Build and Run

You need a nightly Rust compiler, xargo, objcopy (or a similar tool), and QEMU (for running it).

> RUST_TARGET_PATH=$(pwd) xargo build --target x86_64-bootloader --release
> objcopy -O binary -S target/x86_64-bootloader/release/bootloader bootimage.bin
> qemu-system-x86_64 -hda bootimage.bin -d int -s

About

An experimental pure-Rust x86 bootloader

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 77.3%
  • Assembly 22.7%