TL;DR
A community port adapts xv6-riscv to boot and run on the SiFive HiFive Unmatched (FU740) board. The project uses U-Boot SPL to start the kernel in M-mode, includes an SPI-mode SD card driver conversion, and has been validated on real hardware and in QEMU.
What happened
A developer published a port of xv6-riscv targeting the SiFive HiFive Unmatched (FU740). The port replaces the standard OpenSBI startup flow by using U-Boot SPL to load the xv6 kernel directly, minimizing kernel-side changes and performing essential hardware initialization in the SPL. The distribution includes an unmatched build target that converts the kernel ELF into a raw binary and packages it into a FIT image (xv6-unmatched.itb) recognized by the SPL. An SPI-mode SD card driver, adapted from SiFive sources, replaces the earlier VirtIO approach so the system can boot from a microSD card. The repository documents a tested SD card partition layout, the exact U-Boot SPL version to build (v2023.01), and the host prerequisites (Ubuntu 24.04 and various cross-toolchain packages). The port reportedly passes xv6 usertests on actual Unmatched hardware and can also be run on QEMU’s sifive_u machine.
Why it matters
- Demonstrates xv6 running on real RISC-V hardware rather than only in simulators, closing the gap between teaching OS code and physical platforms.
- Using U-Boot SPL to boot the kernel in M-mode reduces reliance on OpenSBI and shows an alternative embedded boot flow.
- Including an SPI SD driver expands practical deployment options for boards lacking VirtIO support.
- Provides reproducible build and SD card setup instructions, aiding educators and researchers who want to run xv6 on SiFive hardware.
Key facts
- Repository: eyengin/xv6-riscv-unmatched on GitHub (source published 2026-01-10).
- Build target 'unmatched' produces a FIT image named xv6-unmatched.itb for U-Boot SPL.
- U-Boot SPL: project builds only the SPL binary (u-boot-spl.bin) and recommends v2023.01; newer U-Boot versions reportedly failed to initialize CPU clocks correctly in SPL.
- SD card: tested with a SanDisk Ultra 32GB UHS-I A1 microSD; partitioning is done with sgdisk and three partitions are written with dd (SPL, xv6 FIT image, fs.img).
- Boot configuration: MSEL switches must be set to SD Boot (1011) on the HiFive Unmatched; UART connection at 115200 baud is used for console output.
- Observed bootlog shows U-Boot SPL starting, then the xv6 kernel booting and multiple harts coming online, finishing with init starting a shell.
- Usertests in the repository passed on hardware; the project also documents validation with 6.1810 labs locally (solutions will not be published).
- The port can be executed under QEMU using the sifive_u machine; developers are instructed to clean builds when switching targets (make clean; make qemu).
What to watch next
- Whether patches or changes are upstreamed to main xv6 or U-Boot repositories: not confirmed in the source
- Broader hardware compatibility beyond the HiFive Unmatched (other SiFive boards or RISC-V platforms): not confirmed in the source
- Support or fixes enabling newer U-Boot versions to work with this SPL flow: not confirmed in the source
Quick glossary
- xv6-riscv: A simple, teaching-focused Unix-like operating system ported to the RISC-V architecture, used in operating-systems courses.
- U-Boot SPL: The Secondary Program Loader stage of U-Boot, a minimal firmware component used to perform early platform initialization and load larger boot components.
- FIT image: A Flattened Image Tree format used to bundle kernel binaries and metadata so bootloaders can recognize and load them as firmware images.
- OpenSBI: An implementation of the RISC-V Supervisor Binary Interface (SBI) that provides environment services to OS kernels; commonly used in RISC-V boot flows.
- hart: Hardware thread in RISC-V terminology; a single hardware execution context (similar to a CPU core or hardware thread).
Reader FAQ
Where is the project hosted?
The port is available in the eyengin/xv6-riscv-unmatched repository on GitHub (source URL in the original post).
Does the port run on actual HiFive Unmatched hardware?
Yes. The author reports successful boots on the Unmatched, passing xv6 usertests and producing kernel console output over UART.
Which U-Boot version should I use?
The instructions specify building U-Boot v2023.01 for the SPL; the source notes later U-Boot releases failed to initialize CPU clocks in SPL testing.
Are prebuilt SD images or binaries provided?
Not confirmed in the source.
Will this work on other SiFive boards or with newer U-Boot releases?
Not confirmed in the source.
xv6-riscv for HiFive Unmatched This is a port of xv6-riscv to the SiFive HiFive Unmatched board (FU740). See notes for the implementation details. Highlights Stability on actual hardware: usertests passed,…
Sources
- Show HN: Porting xv6 to HiFive Unmatched board
- xv6-riscv-unmatched/doc/NOTES.md at unmatched
- Where to start with a hobby OS – HiFive Unmatched
- HiFive™ Unmatched Rev B
Related posts
- Happy 50th Birthday KIM-1: Community Demo Marks Early Microcomputer Milestone
- Conditional HTML-only lazy loading using preload plus media queries
- BasiliskII Macintosh 68k Emulator Ported to ESP32-P4 / M5Stack Tab5