riscv-rust is a RISC-V processor emulator project written in Rust.
You can run Linux or xv6 on the emulator in your browser. Online demo is here
etc...
This module is released at crates.io. Add the following line into Cargo.toml of your Rust project.
[dependencies]
riscv_emu_rust = "0.1.0"
Refer to cli/src/main.rs as sample code.
sh
$ git clone https://github.com/takahirox/riscv-rust.git
$ cd riscv-rust
$ cargo build --release
```sh $ cd riscv-rust/cli
$ cargo run --release ../resources/linux/bbl -f ../resources/linux/busybear.bin -d ../resources/linux/dtb.dtb
$ cargo run --release ../resources/xv6/kernel -f ../resources/xv6/fs.img ```
Prerequirements - Install wasm-bindgen client
```sh $ cd riscv-rust/wasm $ bash build.sh
```
sh
$ npm install riscv_emu_rust_wasm
Prerequirements - Install riscv-gnu-toolchain - Install riscv-tests
sh
$ cd riscv-rust/cli
$ cargo run $path_to_riscv_tets/isa/rv32ui-p-add -n
xv6-riscv is the RISC-V port of xv6 which is UNIX V6 rewritten by MIT for x86 in the current C language.