Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bokuweb/r2
A RISC-V emulator written in Rust :crab:
https://github.com/bokuweb/r2
Last synced: 4 days ago
JSON representation
A RISC-V emulator written in Rust :crab:
- Host: GitHub
- URL: https://github.com/bokuweb/r2
- Owner: bokuweb
- Created: 2023-05-06T00:56:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-03T01:18:45.000Z (3 months ago)
- Last Synced: 2024-10-17T07:37:19.623Z (18 days ago)
- Language: Rust
- Homepage: https://bokuweb.github.io/r2/
- Size: 3.57 MB
- Stars: 102
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# R2
[![GitHub Actions Status](https://github.com/bokuweb/r2/workflows/ci/badge.svg)](https://github.com/bokuweb/r2/actions)
A RISC-V emulator written in Rust :crab:.
Inspired [cnlohr/mini-rv32ima](https://github.com/cnlohr/mini-rv32ima).## Capture
You can run linux in your browser.
![capture](https://github.com/bokuweb/r2/blob/main/capture.gif?raw=true)
## Playground
[https://bokuweb.github.io/r2/](https://bokuweb.github.io/r2/)
## Native
```sh
$ cargo run -p app -- -i fixtures/linux.bin -d fixtures/default.dtb
```## WASI
```sh
$ cargo build -p wasi --target wasm32-wasi --release
$ wasmtime ./target/wasm32-wasi/release/wasi.wasm
```## Wasm
```sh
$ cd wasm
$ cargo build --target wasm32-unknown-unknown --release
$ wasm-opt --asyncify [email protected] ../target/wasm32-unknown-unknown/release/wasm.wasm -o out.wasm
$ npx serve
```## Special Thanks
- [cnlohr/mini-rv32ima](https://github.com/cnlohr/mini-rv32ima)
- [Writing a Really Tiny RISC-V Emulator](https://www.youtube.com/watch?v=YT5vB3UqU_E)## References
- [https://github.com/torvalds/linux/tree/master/arch/riscv](https://github.com/torvalds/linux/tree/master/arch/riscv)
- [https://www.five-embeddev.com/riscv-isa-manual/latest/machine.html](https://www.five-embeddev.com/riscv-isa-manual/latest/machine.html)
- [https://github.com/riscv/riscv-isa-manual/releases/download/Priv-v1.12/riscv-privileged-20211203.pdf](https://github.com/riscv/riscv-isa-manual/releases/download/Priv-v1.12/riscv-privileged-20211203.pdf)
- [https://riscv.org/wp-content/uploads/2017/05/riscv-spec-v2.2.pdf](https://riscv.org/wp-content/uploads/2017/05/riscv-spec-v2.2.pdf)## License
MIT