Field Notes.GitHub
← All writing

t520z520 / Draft

Booting OpenSBI on a RISC-V machine modeled in Rocq

I ran OpenSBI on an executable model of a QEMU virt-style RISC-V machine. The equivalence proof against Sail is still in progress.

Browse rocq-vm on GitHub ↗

Run the boot

From a checkout of rocq-vm with Nix flakes enabled:

nix run .#opensbi

The runner executes the model and sends the firmware’s output over the modeled UART. The repository records an OpenSBI v1.8 boot and reports results from the RISC-V architecture and smoke suites. See the verification results for what those runs cover.

What steps

The Rocq model describes how the machine state changes one step at a time. It covers the harts and a shared board with RAM, interrupt controllers, a UART, and a VirtIO block device. The native runner is extracted to OCaml.

What remains to prove

A successful boot exercises one execution. The architecture tests exercise more, with results checked against Sail-generated signatures. The Sail equivalence work aims to establish a correspondence between the models. That proof is still underway.