1 c791d5e8 2024-04-15 benni # 64-Bit Linux Userspace RISC-V Emulator
2 452f8ae7 2024-04-07 benni This emulator allows you to run statically-compiled binaries for riscv64-unknown-linux-musl.
3 452f8ae7 2024-04-07 benni The goal is to support most POSIX-compatible OS on most 64bit CPU architectures.
5 452f8ae7 2024-04-07 benni ## Instructions
6 d67350d6 2024-07-06 benni 1. Build the toolchain:
8 d67350d6 2024-07-06 benni $ cd tools && make -jN # with N being the number of cores of your system
10 d67350d6 2024-07-06 benni 2. Build the emulator itself and a few example programs:
12 d67350d6 2024-07-06 benni $ cd .. && make
14 d67350d6 2024-07-06 benni 3. Build a additional example programs (optional):
16 d67350d6 2024-07-06 benni $ cd tools && make extra
18 452f8ae7 2024-04-07 benni To run a test program do:
22 452f8ae7 2024-04-07 benni ## Supported Host Architectures
23 452f8ae7 2024-04-07 benni Due to design decisions, only 64bit archs can be supported:
28 e7b41912 2024-07-16 benni - powerpc64 (big-endian, some syscall support missing)
30 452f8ae7 2024-04-07 benni Note: Once I get more hardware, I can port it to other architectures.
32 452f8ae7 2024-04-07 benni ## Supported Host OSs
38 452f8ae7 2024-04-07 benni ## Non-standard Toolchain Dependencies
39 9c836066 2024-04-07 benni - gsed (GNU sed)
40 9c836066 2024-04-07 benni - gmake (GNU make)
42 452f8ae7 2024-04-07 benni - sudo or doas (only for `make run`, see config.mk.*)
43 452f8ae7 2024-04-07 benni - wget or curl (only on Linux)
44 72b29795 2024-04-07 benni - clang (only on NetBSD, because the distribution gcc is too old)
45 14e6dfec 2024-07-16 benni - gcc (only on FreeBSD/powerpc64, because the distribution clang is broken)
47 452f8ae7 2024-04-07 benni ## Resources
48 452f8ae7 2024-04-07 benni - https://riscv.org/wp-content/uploads/2017/05/riscv-spec-v2.2.pdf
49 452f8ae7 2024-04-07 benni - https://five-embeddev.com/riscv-isa-manual/latest/instr-table.html
53 452f8ae7 2024-04-07 benni This project is still very experimental and has bugs!
54 452f8ae7 2024-04-07 benni If you find one, please contact Benjamin Stürz <benni AT stuerz DOT xyz>.