Build Berkeley boot loader

What is this for ?

The RISCV specification defines (optionally) three main modes of operation: user, supervisor, and machine mode. Some documents also refer to a hypervisor mode, which may or may not be necessary. Some of the differences are:

A simple summary of BBL is that it is the executable of last-resort when neither user-mode nor Linux cannot handle an operation. Currently it handles:

  1. Any illegal instructions that the RISCV processor is not equipped to handle directly in hardware.
  2. Initiation and responding to timer interrupts.
  3. Handling unaligned memory accesses (deprecated because it slows things a great deal).
  4. Chain loading and initial console access when Linux is booting, to simplify the first-stage boot loader.

Now configure and build Berkeley Boot loader

cd $TOP/rocket-chip/riscv-tools/riscv-pk/
mkdir -p build
cd build
../configure --prefix=$RISCV --host=riscv64-unknown-elf --with-payload=$TOP/riscv-linux/vmlinux --enable-logo
cp -p bbl $TOP/fpga/board/nexys4_ddr/boot.bin
riscv64-unknown-elf-strip $TOP/fpga/board/nexys4_ddr/boot.bin

The use of the strip command minimises the download size for use with Ethernet or MMC/SD-Card loading.

Next step: