Tiny x86 emulator written in pure golang
Clone or download
Latest commit 9e587fe Jan 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
guest fix Jun 17, 2018
script mod httpserv Jan 7, 2019
wasm fix Sep 19, 2018
xv6-public add log messages for forklet -> iinit -> sleep -> sched Dec 1, 2018
.gitignore mod httpserv Jan 7, 2019
.goreleaser.yml mod Feb 28, 2018
LICENSE first commit Feb 28, 2018
Makefile mod httpserv Jan 7, 2019
README.md fix README.md Jan 8, 2019
eflags.go fix Aug 28, 2018
eflags_test.go fix Apr 21, 2018
emulator.go Revert "remove unused code @ gcc (GCC) 8.2.1 20181105 (Red Hat 8.2.1-5)" Nov 29, 2018
emulator_test.go fix test Oct 30, 2018
io.go add golint Nov 20, 2018
main.go Revert "remove unused code @ gcc (GCC) 8.2.1 20181105 (Red Hat 8.2.1-5)" Nov 29, 2018
main_wasm.go fix Sep 19, 2018
pic.go add golint Nov 20, 2018
pic_test.go fix Aug 28, 2018
screenshot.png fix README Jan 3, 2019
wercker.yml fix README.md Jan 8, 2019
xv6_test.go add xv6_testing.img Nov 19, 2018
xv6_testing.img add xv6_testing.img Nov 19, 2018

README.md

tiny_x86_emu wercker status GoDoc Go Report Card Coverage Status

This is an experimental x86 emulator. Currently, this project is targeted only to xv6 as guest OS.

Demo

https://bobuhiro11.net/tiny_x86_emu/

screenshot

Preparation

Please make sure that make, go (>=1.11), gcc, objdump, nasm and ndisasm are installed. For example, if you are using ubuntu, you can install them using the following command.

$ sudo apt-get install -y nasm gcc git tar wget make bsdmainutils
$ wget https://dl.google.com/go/go1.11.linux-amd64.tar.gz
$ sudo tar -C /usr/local -zxf go1.11.linux-amd64.tar.gz

Usage

make command will build two version of emulators and xv6 image described as below:

  • Emulator for Host OS: An emulator execution binary for the host OS is created. Its name is tiny_x86_emu.
  • Emulator for wasm: A wasm version of the emulator is built to run in the browser. Its name is wasm/tiny_x86_emu.wasm.
  • xv6 image: The makefile for xv6 is also executed recursively.
# Build two version of emulators and guest xv6 image
$ make

# Execute CLI version emulator in your terminal.
$ ./tiny_x86_emu -f xv6-public/xv6.img

# Start web server to host wasm file.
# Then, please open http://localhost:8000 in your browser.
$ ./httpserv

Testing

make test command will execute all tests.

Contribution

Pull requests from anyone are welcome!