2 unstable releases

0.2.0 Dec 13, 2022
0.1.0 Dec 13, 2022

#752 in Hardware support

27 downloads per month

MIT license

92KB
2K SLoC

valheim

Learning purpose riscv64 (RV64GC) emulator. This project is built for 一生一芯 as a reference implementation.

Highlights

  • Type-safe instructions which makes the decoding less error-prone.
  • Full emulation trace (registers, memory, etc.) like persistent data structures, which is useful for debugging the real hardware.
  • MISA = RV64ACDFIMSU
    • RV64G (IMAFD_Zicsr_Zifencei) instruction set
    • RVC extension
    • Supervisor mode extension
    • User mode extension

Amazing Moments

Running openEuler Linux for RISC-V

Currently, the init program cannot use serial device as console (I am trying hard to find the cause). But the kernel was indeed successfully booted and initialized.

I was thinking that should I just give up trying to fix the console problem, instead, go and implement a virtio-net device and start the sshd service when booted? It's not that hard comparingly, and it's closer to the real-world use case.

asciicast

Running RustSBI-QEMU with its test kernel

With the following command:

cargo run --release -- --kernel tests/test-kernel.bin --bios tests/rustsbi-qemu.bin

rustsbi-booting

Running xv6 for RISC-V

With the following command:

$(CROSS)objcopy -O binary xv6/kernel xv6/kernel.bin
cargo run --release -- --kernel xv6/kernel.bin --disk xv6/fs.img

xv6-booting

Dependencies

~1.5MB
~34K SLoC