riscv-software-src / riscv-pk

RISC-V Proxy Kernel
Other
570 stars 304 forks source link

[question]A request on c-based bbl payload example #304

Open SoloGao opened 10 months ago

SoloGao commented 10 months ago

Hi, I'm new for risc-v development. We aim to build a risc-v machine mode program can run on spike. Because we want to use htif functions, we try to use bbl with --enable-boot-machine, just like what's mentioned in https://github.com/riscv-software-src/riscv-pk/pull/104 . However, because the dummy payload is written purely in ASM, and used some "magic for me" ecalls, I can neither reproduce the "sbi_console_putchar" and "sbi_shutdown" in c, nor make a usable ld to link all things together. Could someone give a payload example in c to show how to build/how to use the putchar/shutdown function? Thanks!