Rust-powered OS following the https://os.phil-opp.com/ tutorial
Requires
- Rust Nightly
- In short,
rustup toolchain install nightly
installs the nightly build andrustup override set nightly
sets the toolchain as nightly for this project directory
- In short,
rust-src
component (install withrustup component add rust-src
)bootimage
tool to compile kernal and bootloader and then link the two together after, creating a bootable disk image.- Install with
cargo install bootimage
- Requires
llvm-tools-preview
rustup component (install withrustup component add llvm-tools-preview
).
- Install with
Build: cargo build
or specify the verbose build target with cargo build --target x86-64-blog-os.json
Create a bootable disk: cargo bootimage
Boot in QEMU: qemu-system-x86_64 -drive format=raw,file=target/x86-64-blog-os/debug/bootimage-rust-os.bin
This opens a window like:
Run dd if=target/x86-64-blog-os/debug/bootimage-rust-os.bin of=/dev/sdX && sync
NOTE (from os.phil-opp.com):
Where sdX is the device name of your USB stick. Be careful to choose the correct device name, because everything on that device is overwritten.
Compile kernal and boot into QEMU with cargo run
Simply run cargo test
in the root directory.