Skip to content
/ valheim Public

Just for fun riscv64 emulator, which boots the Linux.

Notifications You must be signed in to change notification settings

imkiva/valheim

Repository files navigation

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

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

With the following command:

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

rustsbi-booting

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

About

Just for fun riscv64 emulator, which boots the Linux.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published