A RISC-V Operator System written by Rust.
Some features this project used are still unstable, so a nightly version is required.
- Min Version:
1.65.0.- feature
const_ptr_offset_fromis stable since1.65.0.
- feature
- Nightly Version:
- feature
default_alloc_error_handleris unstable. Needed with the customGlobalAllocatorandalloccrate. - feature
inline_constis unstable. Needed on the custom impl ofoffset_of!macro.
- feature
- Make sure the rust version meets the minimum requirements.
- Make sure the RISC-V target has been installed.
# rustup default nightly rustup target add riscv64gc-unknown-none-elf - Run
cargo buildto build the project.
Before the run, make sure the file named hdd.dsk is existed in the project root dir, this file is used in QEMU as the disk device (See QEMU arguments).
A way to create the hdd.dsk file:
dd if=/dev/zero of=hdd.dsk count=32 bs=1MThe simplest way to launch the kernel is using cargo run command, this will use the cargo config in .cargo/config.toml to run with QEMU.
Another way is to launch QEMU manually, for example:
qemu-system-riscv64 -machine virt -cpu rv64 -smp 4 -m 128M -nographic -s -drive if=none,format=raw,file=hdd.dsk,id=foo -device virtio-blk-device,drive=foo -serial mon:stdio -bios none -kernel ./target/riscv64gc-unknown-none-elf/debug/vosThe QEMU arguments can be customized.
Min Version:7.1.0.- RISC-V privileged spec version 1.12.0 is supported from this version.
- ChangeLog/7.1
Unfortunately, the current stable QEMU version (7.1.0) does not support the RISC-V SSTC extension, we need to manually build the latest master code to get this extension work. See QEMU Page for build instructions.
This project is under the MIT license (LICENSE) and any dependence is using its original license.