Idea · Oct 10, 2026
Build Your Own RISC-V Emulator That Boots
A staged course project where students write an RV32IMA emulator in TypeScript or C, add a UART, timer and traps, and finish by booting a provided mini-kernel and shell in the browser.
What it would do
Inspired by browser projects that embed whole machines (v86, Pyodide) in a page, this assignment walks students up the stack one checkpoint at a time. Week 1: registers, memory and the RV32I decoder, verified against the official riscv-tests suite. Week 2: the M and A extensions plus a disassembler and single-step debugger view. Week 3: memory-mapped UART and CLINT timer, CSRs, and machine-mode traps and interrupts. Week 4: run a provided tiny kernel (a cooperative scheduler with a shell, a few hundred lines of C cross-compiled ahead of time) and get a prompt in an xterm.js terminal. Stretch goals include Sv32 paging, a simple disk device, or a JIT for hot basic blocks. Every checkpoint has an autograder that runs instruction-level conformance tests and compares UART output against golden traces.
Key features
- Four checkpoints, each autograded by riscv-tests conformance and golden UART traces
- Built-in step debugger: registers, CSRs, disassembly and memory view
- Memory-mapped UART and timer devices with interrupt delivery
- Provided cross-compiled mini-kernel and shell as the final boot target
- Stretch tracks: Sv32 virtual memory, block device, basic-block JIT