The RISC-V Supervisor Binary Interface (SBI) is a recommended interface between:
The RISC-V SBI specification is maintained as an independent project by the RISC-V Foundation in Github
OpenSBI aims to provides an open-source and extensible implementation of the RISC-V SBI specification for case 1 mentioned above. OpenSBI implementation can be easily extended by RISC-V platform or System-on-Chip vendors to fit a particular hadware configuration.
OpenSBI provides three components:
For cross-compiling, the environment variable CROSS_COMPILE_PREFIX must be defined to specify the toolchain executable name prefix, e.g. riscv64-unknown-elf- if the gcc executable used is riscv64-unknown-elf-gcc.
To build the generic OpenSBI library libsbi.a, simply execute:
make
All compiled binaries will be placed in the build directory. To specify an alternate build directory target, run:
make O=<build_directory>
To generate files to be installed for using libsbi.a in other projects, run:
make install
This will create the install directory with all necessary include files and binary files under it. To specify an alternate installation directory, run:
make I=<install_directory> install
The libplatsbi.a and firmware files are only built if the
PLATFORM= argument is specified on make command lines.
must specify the path to one of the leaf directories
under the platform directory. For example, to compile the library and
firmware for QEMU generic RISC-V virt machine,
should be qemu/virt.
To build libsbi, libplatsbi, and firmwares for a specific platform, run: or To install libsbi, headers, libplatsbi, and firmwares, run: or In addition, platform specific make command-line options to top-level make
,such as PLATFORM_ or FW_ can also be specified. These
options are described under docs/platform/.md and
docs/firmware/.md.
A more detailed documenation is under the docs directory and organized
as follows. The source code is also well documented. For source level documentation,
doxygen style is used. Please refer to Doxygen manual for details on this
format.make PLATFORM=<platform_subdir>
make PLATFORM=<platform_subdir> O=<build_directory>
make PLATFORM=<platform_subdir> install
make PLATFORM=<platform_subdir> I=<install_directory> install`
Documentation