This is a pet project to write a small Kernel in Rust for the RISC-V 64GC architecture, targeting the QEMU virt machine.
A minimal dependency approach is used in this project. The following dependencies are used:
fdt
: Used for parsing the device tree to avoid the redundant work of parsing it manually (boring).embedded-io
: This crate provides Hardware Abstraction Layer (HAL) traits for I/O operations, which are used for convenience.
This project uses nightly Rust features. You will need to use a nightly toolchain to build and run it.
- Install a nightly Rust toolchain. You can do this using
rustup
:rustup toolchain install nightly rustup default nightly
- Add the
riscv64gc-unknown-none-elf
target:rustup target add riscv64gc-unknown-none-elf
- Install QEMU. On macOS, you can use Homebrew:
brew install qemu
To run the OS in QEMU, use the following command:
cargo run