A basic riscv os just in Rust
Inspirations from xv6-riscv, rrxv6, Writing an OS in Rust and vanadinite
In order to build and run the os you'll need :
- 🦀 Rust
- cargo-make which you can install via
cargo install --force cargo-make
- QEMU for Riscv
- (for linux, if you want to use gdb on your machine) The Newlib cross-compiler of Riscv-GNU-Toolchain
You can use the usual commands cargo build
and cargo run
to run the OS with QEMU
cargo run
just doescargo make qemu
(see.cargo/config.toml
) which is described in theMakefile.toml
To setup the target just change the target in the .cargo/config.toml
[build]
target = "riscv64imac-unknown-none-elf"
Run in a terminal cargo make qemu-gdb
And in another terminal (in this directory) riscv64-unknown-elf-gdb