Skip to content
Catalin Dumitru edited this page Jun 3, 2013 · 8 revisions

Fake86JS

Fake86JS is personal learning project aimed to show that a simple x86 emulator can be easily translated to run in the browser. The original emulator is written by Mike Chambers, and only a very small amount of alterations were needed to make the translation to JavaScript, as the emulator already uses SDL which is supported by Emscripten.

The result doesn't run very well, but it serves nonetheless as a proof of concept. It comes pre-loaded with a version of MS-DOS to test the virtual machine.

The only browser that can run the page for now is Firefox, as Chrome stops the script as it uses to much memory.

Demo

You can view a live demo by visiting this page (warning it uses a lot of memory)

Compiling The Project

The only prerequisite to compile the project is to have Emscripten installed and configured and then run:

./make.sh

from the sources directory. A new file called fake86.html should be created in the bin directory which can then be opened in FireFox (for now).

Changes

The only alteration to the original project needed to run the emulator was how threads are created. As JavaScript does not support threads, fake concurrent methods were started using the methods in the common.js library. I've also tried to optimize the general speed of the execution process by replacing the large opcode switch statement with a lookup table. There was an almost nonexistent change in performance, but the change was kept nonetheless.

Clone this wiki locally