特权级别

关于risc-v启动部分的思考-电子发烧友网open in new window

image-20241224162339981

SBI是risc-v架构的特有规范,提供SBI结构供OS调用。

应用程序位于最弱的用户特权级(User Mode), 操作系统位于内核特权级(Supervisor Mode), RustSBI位于机器特权级(Machine Mode)。

cargo build --target=riscv64gc-unknown-none-elf --release

rust-objcopy --binary-architecture=riscv64 target/riscv64gc-unknown-none-elf/release/os --strip-all -O binary target/riscv64gc-unknown-none-elf/release/os.bin

qemu-system-riscv64 -machine virt -nographic -bios ../bootloader/rustsbi-qemu.bin -device loader,file=target/riscv64gc-unknown-none-elf/release/os.bin,addr=0x80200000
上次更新:
Contributors: YangZhang