Blame


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.
4 9c836066 2024-04-07 benni
5 452f8ae7 2024-04-07 benni ## Instructions
6 452f8ae7 2024-04-07 benni Building rvemu is very simple, just do:
7 452f8ae7 2024-04-07 benni
8 452f8ae7 2024-04-07 benni $ make rvemu
9 452f8ae7 2024-04-07 benni
10 452f8ae7 2024-04-07 benni To install rvemu, do:
11 452f8ae7 2024-04-07 benni
12 452f8ae7 2024-04-07 benni # make [PREFIX=/usr/local] install
13 452f8ae7 2024-04-07 benni
14 452f8ae7 2024-04-07 benni If you don't already have a toolchain, you can build it with:
15 452f8ae7 2024-04-07 benni
16 452f8ae7 2024-04-07 benni $ make -C tools -j8
17 452f8ae7 2024-04-07 benni
18 452f8ae7 2024-04-07 benni To run a test program do:
19 452f8ae7 2024-04-07 benni
20 452f8ae7 2024-04-07 benni $ make run
21 452f8ae7 2024-04-07 benni
22 452f8ae7 2024-04-07 benni Look into the examples directory, for example programs.
23 452f8ae7 2024-04-07 benni You can specify which example to run with the T parameter.
24 452f8ae7 2024-04-07 benni Example for the cat.elf program:
25 452f8ae7 2024-04-07 benni
26 452f8ae7 2024-04-07 benni $ make T=cat run
27 452f8ae7 2024-04-07 benni
28 452f8ae7 2024-04-07 benni ## Supported Host Architectures
29 452f8ae7 2024-04-07 benni Due to design decisions, only 64bit archs can be supported:
30 452f8ae7 2024-04-07 benni
31 452f8ae7 2024-04-07 benni - amd64
32 f3444ea0 2024-04-10 benni - arm64
33 452f8ae7 2024-04-07 benni
34 452f8ae7 2024-04-07 benni Note: Once I get more hardware, I can port it to other architectures.
35 452f8ae7 2024-04-07 benni
36 452f8ae7 2024-04-07 benni ## Supported Host OSs
37 9c836066 2024-04-07 benni - OpenBSD
38 9c836066 2024-04-07 benni - FreeBSD
39 9c836066 2024-04-07 benni - NetBSD
40 9c836066 2024-04-07 benni - Linux
41 9c836066 2024-04-07 benni
42 452f8ae7 2024-04-07 benni ## Non-standard Toolchain Dependencies
43 9c836066 2024-04-07 benni - gsed (GNU sed)
44 9c836066 2024-04-07 benni - gmake (GNU make)
45 452f8ae7 2024-04-07 benni - sudo or doas (only for `make run`, see config.mk.*)
46 452f8ae7 2024-04-07 benni - wget or curl (only on Linux)
47 72b29795 2024-04-07 benni - clang (only on NetBSD, because the distribution gcc is too old)
48 452f8ae7 2024-04-07 benni
49 452f8ae7 2024-04-07 benni ## Resources
50 452f8ae7 2024-04-07 benni - https://riscv.org/wp-content/uploads/2017/05/riscv-spec-v2.2.pdf
51 452f8ae7 2024-04-07 benni - https://five-embeddev.com/riscv-isa-manual/latest/instr-table.html
52 452f8ae7 2024-04-07 benni
53 452f8ae7 2024-04-07 benni
54 452f8ae7 2024-04-07 benni ## Bugs
55 452f8ae7 2024-04-07 benni This project is still very experimental and has bugs!
56 452f8ae7 2024-04-07 benni If you find one, please contact Benjamin Stürz <benni AT stuerz DOT xyz>.