Repository navigation
v0.5.0: SBI Firmware & Linux Boot Infrastructure
🚀 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/pmpcfg2andpmpaddr0-15CSR 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
TIMECSR now reads CLINTmtime(was returning 0)MSTATUSinitializes UXL/SXL to 2 (64-bit), preserved on writes- Added
MVENDORID,MARCHID,MIMPIDread-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:
- ✅ Boot ROM → kernel entry with DTB
- ✅ Kernel probes SBI extensions
- ✅ Kernel sets up S-mode trap handlers
- ✅ Timer interrupts delegate to S-mode via SBI
- 🔜 Next: test with actual Linux kernel image