This is step 5 of the book Writing a RISC-V Emulator from Scratch in 10 Steps, whose goal is running xv6, a small Unix-like OS, in your emulator in the final step.

The source code is available at d0iasm/rvemu-for-book/step5/.

Goal of This Page

In the end of this page, we support exceptions and can execute ecall, ebreak and fence, parts of the base integer instruction set (RV64I). The ecall and ebreak instructions raise an exception.