An embedded micro RustOS for baremetal
Set up your minimal bare-metal Rust development environment for an ARM Cortex-M core using QEMU and no_std.
sudo apt-get install binutils-arm-none-eabi gdb-multiarchcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shFollow options for default install. Then reload your shell or run:
source $HOME/.cargo/envVerify installation:
rustc --version
cargo --versionrustup intsall nightly
rustup default nightly
rustup component add rust-src
rustup component add rust-stdrustup target add thumbv7em-none-eabihfThis target supports Cortex-M4 with hardware floating point.
sudo apt update
sudo apt install qemu-system-armVerify installation:
qemu-system-arm --versionYou're now ready to move on to building your Rust kernel and running it in QEMU!
Switch into the rustos directory
cd rustosRun the rust build command:
cargo build --release # Debug build not working yetOnce you've built µRustOS, you can run it on QEMU with GDB debugging server:
qemu-system-arm \
-machine lm3s6965evb \
-kernel target/thumbv7em-none-eabihf/release/rustos \
-S -gdb tcp::1234You can then connect the debugger with target extended-remote to see hello-world
gdb-multiarch target/thumbv7em-none-eabihf/release/rustos -ex "target extended-remote :1234"To see where the "Hello World!" message was printed:
c
x/s 0x20000000
> Hello World!Resources used: