Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Linux Proxy Kernel

79 views
Skip to first unread message

David Castells Rufas

unread,
Jul 13, 2024, 7:35:17 AM7/13/24
to RISC-V SW Dev
Hi,

Spike implements a proxy kernel to provide a minimal set of syscalls.
(to run applications compiled with riscv64-unknown-elf-gcc)

Then, it provides a bootloader to be able to boot Linux
(and be able to run applications compiled with riscv64-unkown-linux-gnu-gcc).

Does anyone know why they didn't provide a proxy kernel for the Linux syscalls instead ?

Do you know it anyone tried to do this (before myself) ?

BR


Tommy Murphy

unread,
Jul 13, 2024, 8:33:47 AM7/13/24
to David Castells Rufas, RISC-V SW Dev
Doesn't this explain it?


"The RISC-V Proxy Kernel, pk, is a lightweight application execution environment that can host statically-linked RISC-V ELF binaries. It is designed to support tethered RISC-V implementations with limited I/O capability and thus handles I/O-related system calls by proxying them to a host computer."

Tommy Murphy

unread,
Jul 13, 2024, 8:39:49 AM7/13/24
to RISC-V SW Dev, Tommy Murphy, david.c...@gmail.com
Also - as far as I recall the BBL is effectively deprecated in favour of something like OpenSBI?

David Castells Rufas

unread,
Jul 14, 2024, 3:24:19 AM7/14/24
to RISC-V SW Dev, tommy_...@hotmail.com, David Castells Rufas

No, this explains what pk does, i.e. intercepting the syscalls (when executing ECALL instructions) generated by bare-metal applications (compiled with riscv64-unknown-elf-gcc).
The proposed method to simulate Linux applications is to execute the full Linux Kernel on spike, which is a considerable larger piece of code (and time). Moreover, by executing full Linux you cannot access host resources (like files) when running the target (RISC-V) system. 

I am asking because I am implementing a Linux proxy-kernel for the punxa RISC-V python-based simulator (https://github.com/davidcastells/punxa/tree/main/test/proxykernel_linux/hello) and I would like to know...

1) Why Spike didn't go this way ? Is there a problem I missed that will  seriously limit its usefulness. I already succesfully tested a "hello world" application and I find it quite interesting for teaching purposes.  
2) Did anybody make the same/similar experiment before ? 

Christoph Müllner

unread,
Jul 14, 2024, 4:09:31 PM7/14/24
to David Castells Rufas, RISC-V SW Dev
QEMU provides user space emulation
(https://qemu-project.gitlab.io/qemu/user/index.html).

>
> BR
>
>
> --
> You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
> To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/e7b71a56-b3cb-4ddd-9125-43f96cec475fn%40groups.riscv.org.

David Castells Rufas

unread,
Jul 15, 2024, 10:09:12 AM7/15/24
to RISC-V SW Dev, christoph...@vrull.eu, RISC-V SW Dev, David Castells Rufas

You are right. Thanks
Reply all
Reply to author
Forward
0 new messages