I had a VisionFive V1 sitting unused because almost nothing is published for it any more, so I ported MIT's xv6 teaching OS to it. Upstream xv6 only targets QEMU's virt machine.
It boots from the factory U-Boot (OpenSBI in M-mode, xv6 in S-mode) to a shell on the serial console, and `usertests -q` passes on the board.
What had to change:
- S-mode entry at 0x80200000 via U-Boot's `go`, no M-mode setup
- timer through SBI `set_timer`, since the U74 has no sstc
- DesignWare APB UART instead of the 8-bit 16550 (32-bit registers, busy-detect interrupt)
- PLIC with 133 sources
- kernel sets A/D bits in PTEs, because the U74 faults instead of setting them
- RAM disk in place of virtio
The bug that cost the most time: the kernel printed fine with polling but hung on its first interrupt-driven write. U-Boot on this board runs on hart 1, not hart 0, so I had enabled the UART interrupt in the wrong hart's PLIC context. U-Boot leaves its hart id in `tp`, which is how the port finds it now.
Single hart and RAM-backed filesystem for now. Next on the list are the second hart via SBI HSM and an SD driver for the dw_mmc controller.
Built with some AI assistance. Repo, with boot steps and the full diff against upstream:
https://github.com/HackHobby-Lab/xv6-visionfive-v1
If anyone else still has a V1 and tries it, I'd like to hear whether it boots on your firmware version.