Skip to content

Commit

Permalink
rvvm_user: WIP RISC-V Linux userland emulator
Browse files Browse the repository at this point in the history
- Uses existing elf_load library to map a foreign ELF into the process address space
- Uses existing RVVM Userland emulation API to run emulated RISC-V contexts in the same process
- Sets up the process initial stack, like the kernel does upon exec()
- Shims a few syscalls up into the libc and to the host kernel

This is able to run some statically built binaries: Dhrystone, Coremark, RAMspeed, mandelbrot, and probably a few more. However most dynamic binaries crash at one place or another, even tho it was attempted to implement a working ELF interpreter loading, passing AT entries, PHDRs and such.

Most likely the problem lies either in ELF loader or stack setup code since the x86_64 version of jump_start() with native binaries crashes down the road too.

This code is entirely disabled from build right now, but it's a good thing to have in the tree if anyone wants to mess with it
  • Loading branch information
LekKit authored Jan 12, 2024
1 parent bdb23a5 commit cdfea8b
Showing 1 changed file with 479 additions and 0 deletions.
Loading

0 comments on commit cdfea8b

Please sign in to comment.