# 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
1. Build the toolchain:
$ cd tools && make -jN # with N being the number of cores of your system
2. Build the emulator itself and a few example programs:
$ cd .. && make
3. Build a additional example programs (optional):
$ cd tools && make extra
To run a test program do:
$ make run
## Supported Host Architectures
Due to design decisions, only 64bit archs can be supported:
- amd64
- arm64
- riscv64
- powerpc64 (big-endian, some syscall support missing)
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>.