Skip to content

nkito/exrmips

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIPS Emulator (Rust version)

Overview

This is a Rust version of MIPS32R2 emulator exmips. This emulator works as a console application and also works in a Web browser as WebAssembly codes. OpenWrt, a well-known Linux distribution for home routers, works in the emulator of both console application version and Web browser version.

This page demonstrates the emulator in Web browser. Pressing the "Use sample image" button invokes the emulator.

Build

Console application

A console appliation is obtained as follows.

$ cargo build --release

Note that a program binary obtained with "debug" build may not work properly. It is a known bug. The emulator uses additions with overflow intentionally. However, such overflow causes "panic" when a debug-build version is used.

WebAssembly package

A WebAssembly package of the emulator to use it in Web browsers is obtained as follows.

$ wasm-pack build --target web

wasm-pack is necessary to compile it. It can be installed by cargo install wasm-pack.

Flash memory image (consisting of U-Boot and OpenWrt)

A flash-memory image file is necessary to use the emulator. The generation of a necessary ROM image is described in exmips. Some prebuild flash-memory image files are in this repository. If customization is unnecessary, using a prebuilt image is an easy way.

Usage

The emulator works using a flash-memory image.

The following command invokes the console application.

$ cargo run --release flash_memory_image_file.bin

The emulator halts with "reset" command in U-Boot or "reboot" command in Linux terminal. Twice inputs of Ctrl+C also halt the emulator.

The emulator simulates 64Mbit (8MBytes) Spansion S25Fl164K SPI flash memory by default. It also support 2Gbit (256MBytes) Macronix MX66U2G45G SPI flash memory and the 2Gbit flash is selected when "-f 256" option is used. The emulator loads the flash-memory image before starting the emulation. The image file will not be modified even if the flash is modified in emulator.

Note that this Rust version has no support for ethernet interfaces.

About

MIPS32R2 emulator (Rust version)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages