# 64-Bit Linux Userspace RISC-V Emulator
This emulator allows you to run statically-compiled binaries for riscv64-unknown-linux-musl.
The goal is to support most POSIX-compatible OS on most 64bit CPU architectures.
## Instructions
Building rvemu is very simple, just do:
$ make rvemu
To install rvemu, do:
# make [PREFIX=/usr/local] install
If you don't already have a toolchain, you can build it with:
$ make -C tools -j8
To run a test program do:
$ make run
Look into the examples directory, for example programs.
You can specify which example to run with the T parameter.
Example for the cat.elf program:
$ make T=cat run
## Supported Host Architectures
Due to design decisions, only 64bit archs can be supported:
- amd64
- arm64
- riscv64
Note: Once I get more hardware, I can port it to other architectures.
## Supported Host OSs
- OpenBSD
- FreeBSD
- NetBSD
- Linux
## Non-standard Toolchain Dependencies
- gsed (GNU sed)
- gmake (GNU make)
- sudo or doas (only for `make run`, see config.mk.*)
- wget or curl (only on Linux)
- clang (only on NetBSD, because the distribution gcc is too old)
## Resources
- https://riscv.org/wp-content/uploads/2017/05/riscv-spec-v2.2.pdf
- https://five-embeddev.com/riscv-isa-manual/latest/instr-table.html
## Bugs
This project is still very experimental and has bugs!
If you find one, please contact Benjamin Stürz <benni AT stuerz DOT xyz>.