Support for OpenSBI added
Mitchell Horne
mhorne at freebsd.org
Sat Nov 16 19:56:04 UTC 2019
Hi all,
After some recent work, support has been added for booting FreeBSD using
OpenSBI. OpenSBI is a RISC-V bootloader and the successor to BBL (Berkeley
Boot Loader). It has a larger feature set, and is more actively maintained.
For more details on supported features and platforms see its repository[1].
I have documented the steps required to boot FreeBSD using OpenSBI on the
RISC-V wiki page[2]. The steps are simpler than booting with BBL, since the
OpenSBI binaries don't need to be rebuilt each time the payload changes.
In short, the requirements to boot the FreeBSD kernel are:
1. FreeBSD r354722 or newer.
2. The sysutils/opensbi port/package.
3. QEMU 4.1 or greater, either from emulators/qemu-devel or built from source.
To run the test payload:
qemu-system-riscv64 -machine virt -m 2048M -smp 2 -nographic \
-bios /usr/local/share/opensbi/platform/qemu/virt/firmware/fw_payload.elf
To run the FreeBSD kernel:
objcopy -S -O binary /path/to/riscv/kernel kernel.bin
qemu-system-riscv64 -machine virt -m 2048M -smp 2 -nographic \
-kernel kernel.bin \
-bios /usr/local/share/opensbi/platform/qemu/virt/firmware/fw_jump.elf
Please let me know of any issues you encounter, either through mail or IRC
(#freebsd-riscv on freenode).
[1] https://github.com/riscv/opensbi
[2] https://wiki.freebsd.org/riscv
More information about the freebsd-riscv
mailing list