riscv-rust

riscv-rust is a RISC-V processor emulator project written in Rust.

Demo

You can run Linux or xv6 on the emulator in your browser. Online demo is here

Features

Screenshots

animation

Instructions/Features support status

etc...

How to build riscv-rust and run Linux or xv6

Build core library

sh $ git clone https://github.com/takahirox/riscv-rust.git $ cd riscv-rust $ cargo build --release

Run CLI application

```sh $ cd riscv-rust/cli

Run Linux

$ cargo run --release ../resources/linux/bbl -f ../resources/linux/busybear.bin -d ../resources/linux/dtb.dtb

Run xv6

$ cargo run --release ../resources/xv6/kernel -f ../resources/xv6/fs.img ```

Build WebAssembly and run in the browser

Prerequirements - Install wasm-bindgen client

```sh $ cd riscv-rust/wasm $ bash build_wasm.sh

boot local server and access riscv-rust/wasm/public/index.html

```

How to build and run riscv-tests

Prerequirements - Install riscv-gnu-toolchain - Install riscv-tests

sh $ cd riscv-rust/cli $ cargo run $path_to_riscv_tets/isa/rv32ui-p-add -n

Links

Linux RISC-V port

Linux RISC-V port

xv6-riscv

xv6-riscv is the RISC-V port of xv6 which is UNIX V6 rewritten by MIT for x86 in the current C language.

Specifications