What is the difference in pk and bbl?


(tugouxp) #1

in the freedom-u-sdk dir, the subdrir ricsv-pk can generout two type of binarise, bbl and pk .what is the difference and what the pk aim to ?

thanks for your support.


(Jim Wilson) #2

pk is the proxy kernel. It can allow a regular linux application to run on a bare metal target simulator by providing a linux startup environment and emulating linux system calls. This has a lot of limitations as it doesn’t support all syscalls or all features of the syscalls it supports. In a freedom-u-sdk tree I can do for instance

gamma05:2015$ cat tmp.c
#include <stdio.h>
int main (void) { printf ("hello world\n"); }
gamma05:2016$ toolchain/bin/riscv64-unknown-linux-gnu-gcc tmp.c --static
gamma05:2017$ work/riscv-isa-sim/prefix/bin/spike work/riscv-pk/pk a.out
bbl loader
hello world
gamma05:2018$ 

bbl is the berkely boot loader. It is code meant to be run at system start up which then can load a linux kernel or some other OS kernel or the proxy kernel. It can also provide an interface for supervisor mode programs like the linux kernel to access machine mode registers, as it has machine mode trap handlers. Or at least I think this is how it works.

riscv-pk is nice for simple demos and experiments, but shouldn’t be used for real work. The plan is to replace bbl with OpenSBI.