Porting xv6 to HiFive Unmatched board
Get picks like this daily. Today's launch numbers, the top launches, AI and tech news, and a daily opportunity pick, straight to your inbox.
Want to reach these readers? Sponsor an issue.
Hi HN,I ported the teaching OS xv6-riscv to HiFive Unmatched and got it running on real hardware, including passing usertests.I've been self-studying OS internals using the MIT 6.1810 materials. After finishing most of the labs, I was eager to see what it's like to run the OS on bare metal, rather than QEMU.The Unmatched may not have the latest RISC-V features, but it's well-documented, and the Rev B release has made it more affordable, which makes it a good learning platform.The porting process involved several interesting challenges:- Hardware Quirks: Handling things like enabling A/D bits in PTEs (the hardware doesn't set them automatically, causing page faults), proper handling of interrupts, and instruction cache synchronization.- Boot Flow: xv6 expects M-mode on startup, but standard RISC-V boot flows (typically via OpenSBI) jump to S-mode. To bridge this gap, I created a minimal U-Boot FIT image that contains only the xv6 kernel. This way, U-Boot SPL handles the complex CPU/DDR initialization, then hands control to xv6 in M-mode (skipping OpenSBI).- Drivers: Ported an SPI SD card driver, replacing the virtio disk driver.I wrote up implementation notes here: https://github.com/eyengin/xv6-riscv-unmatched/blob/unmatche...Hopefully, this is useful for others who are learning OS internals and want to try running their code on real RISC-V hardware.
HN · launched Jan 10, 2026 · 26 upvotes (top 31%) · 0 views
Niche: experimental and embedded operating systems · 142 launches, 6 in the last 7 days ▼ -60% · Explore this niche →
Category and tags
- Education
- Dev tools
- Developer
- Not AI
- Hobby / open-source project
Visit website ↗ Source listing ↗
More like this: all 142 launches in experimental and embedded operating systems →
Could you build this?
No Porting an operating system kernel to bare-metal RISC-V hardware requires low-level assembly, device tree parsing, memory-mapped I/O, and hardware debugging expertise.
What it would actually take: Requires writing RISC-V assembly boot code, configuring the SiFive FU740/HiFive Unmatched MMU page tables, initializing system clocks/PLLs, and implementing device drivers for the physical UART, PLIC (interrupt controller), and PCIe/storage peripherals. Real hardware debugging demands hardware probes (JTAG), UART consoles, and deep knowledge of RISC-V privileged architecture specs. Vibe coding cannot autonomously debug low-level hardware register interactions or timing faults.
Discussion
4 comments analyzed.
Competitors mentioned: asciinema, svg-term-cli, VexRiscv
Competitors
Other products that read as similar to this one : 222 launches clear the similarity bar, closest 8 shown.
Attention rank: #71 of 223 (itself plus its competitors, highest first, normalized so YC and Product Hunt are compared fairly).
Launched 73 days after the earliest competitor.
- A Project Oberon System version running on RISC-V instead of RISC-5 · hn · 2026-08-09 · 121 upvotes · similarity 0.51
- Emacs-riscv · hn · 2026-01-05 · 10 upvotes · similarity 0.46
- We built an 8-bit CPU as 2nd year EE students · hn · 2026-06-15 · 108 upvotes · similarity 0.46
- RISCY-V02: A 16-bit 2-cycle RISC-V-ish CPU in the 6502 footprint · hn · 2026-03-06 · 7 upvotes · similarity 0.45
- fiio-jm21-xnu · github · 2026-11-01 · 55 upvotes · similarity 0.42
- diting-ubuntu · github · 2026-10-14 · 36 upvotes · similarity 0.41
- xiaomipad-6pro-mainline · github · 2026-09-13 · 14 upvotes · similarity 0.41
- xemu-ps4 · github · 2026-10-15 · 22 upvotes · similarity 0.41
The niche, labels, vibe code rating and competitor comparison on this page are analysis by Nicheloom. If you use them, please credit nicheloom.com. How you may use our data.