Skip to content

Repository files navigation

R2

GitHub Actions Status

A RISC-V emulator written in Rust 🦀.
Inspired cnlohr/mini-rv32ima.

Capture

You can run linux in your browser.

capture

Playground

https://bokuweb.github.io/r2/

Native

$ cargo run -p app -- -i fixtures/linux.bin -d fixtures/default.dtb

The terminal is put into raw mode while the emulator runs, so every keystroke including Ctrl-C is delivered to the guest. Press Ctrl-A x to quit the emulator, or Ctrl-A Ctrl-A to send a literal Ctrl-A to the guest.

WASI

$ cargo build -p wasi --target wasm32-wasip1 --release
$ wasmtime ./target/wasm32-wasip1/release/wasi.wasm

Wasm

$ cd wasm
$ cargo build --target wasm32-unknown-unknown --release
$ wasm-opt --asyncify --pass-arg=asyncify-imports@env.keydown ../target/wasm32-unknown-unknown/release/wasm.wasm -o out.wasm
$ npx serve

Special Thanks

References

License

MIT

About

A RISC-V emulator written in Rust 🦀

Resources

Stars

117 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages