OpenSBI

SBI (Supervisor Binary Interface) is a boot protocol for RISC-V, which abstracts away common firmware functionality (such as starting harts or printing to UART). It's similar to BIOS and UEFI.

OpenSBI is an implementation of SBI, which lives here, and currently the most common one. QEMU ships with OpenSBI, which is enabled by default when bios was not chosen explicitly, or when using -bios default flag.

la sp, _stack_end
# Disable linker relaxations.
.option push
.option norelax
# Set global pointer, which is used when jumping to nearby addresses.
la gp, _global_pointer
.option pop
j main