Skip to content

v0.5.0: SBI Firmware & Linux Boot Infrastructure

Choose a tag to compare

@quantumnic quantumnic released this 18 Feb 05:36
· 86 commits to main since this release

🚀 v0.5.0 — SBI Firmware & Linux Boot Infrastructure

Major milestone: microvm now has an SBI firmware layer, which is the interface Linux uses to communicate with machine-mode firmware. This is the critical missing piece for Linux kernel boot.

New Features

SBI (Supervisor Binary Interface)

  • Legacy extensions: set_timer, console_putchar, console_getchar, shutdown
  • SBI v0.2 Base extension: spec version, implementation ID, extension probing
  • Timer extension (TIME): set_timer with proper STIP management
  • IPI extension (sPI): send_ipi for single-hart system
  • HSM extension: hart status reporting
  • SRST extension: system reset/shutdown

PMP (Physical Memory Protection)

  • pmpcfg0/pmpcfg2 and pmpaddr0-15 CSR support (RV64 layout)
  • Linux probes PMP registers during early boot — no longer causes illegal instruction

Interrupt Delegation (Fixed)

  • Properly checks SIE for S-mode delegated interrupts
  • Correct priority handling across M/S-mode interrupt sources
  • Timer interrupts now set both MTIP and STIP for S-mode delegation
  • SEIP properly cleared when PLIC has no pending interrupt

CSR Improvements

  • TIME CSR now reads CLINT mtime (was returning 0)
  • MSTATUS initializes UXL/SXL to 2 (64-bit), preserved on writes
  • Added MVENDORID, MARCHID, MIMPID read-only CSRs

Test Suite

  • 68 tests total (52 integration + 16 unit tests)
  • 12 new tests covering SBI calls, PMP, MSTATUS, TIME CSR, SRET, interrupt delegation

Boot Progress

With SBI firmware in place, the emulator can now handle the fundamental Linux kernel boot sequence:

  1. ✅ Boot ROM → kernel entry with DTB
  2. ✅ Kernel probes SBI extensions
  3. ✅ Kernel sets up S-mode trap handlers
  4. ✅ Timer interrupts delegate to S-mode via SBI
  5. 🔜 Next: test with actual Linux kernel image