An object-oriented JavaScript x86 Emulator for Node.js and the browser
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
asm Fixed reference to wrong register in acceptance test Oct 6, 2013
bin Added server and command-line emulation binaries Mar 16, 2014
boot/mikeos/mikeos-4.3/disk_images Added MikeOS bootable disk image May 14, 2012
demos/floppy Add support for multiple floppies to demo Aug 28, 2017
docs/bochs-20100605/bios Added ROMBIOS & VGABIOS images May 14, 2012
images/fonts
js Fix bugs with basic recompiler Aug 28, 2017
tests Fix bugs with basic recompiler Aug 28, 2017
vendor Large commit spanning several years of tweaks: Aug 21, 2017
.gitignore Large commit spanning several years of tweaks: Aug 21, 2017
.jshintrc Added option to jshintrc to enforce use of strict mode May 14, 2013
CNAME Added CNAME for jemul8.com domain Jun 9, 2012
MIT-LICENSE.txt Changed GPL to MIT license Apr 15, 2013
README.md Fixed typo Oct 20, 2013
get.php
index.html Updated demo to pass floppy configuration as args Oct 20, 2013
jemul8.js Removed unnecessary workaround Mar 16, 2014
package.json Large commit spanning several years of tweaks: Aug 21, 2017
server.js

README.md

jemul8

An object-oriented JavaScript x86 Emulator for Node.js and the browser.

jemul8 takes an object-oriented approach to emulation. Primarily an educational tool, it aims to provide a detailed description of the internal workings of an IBM-compatible PC.

It is built using the easy-to-use language JavaScript, so it may be picked up and tweaked by even the amateur programmer.

It aims to reflect computer science concepts, such as Fetch-Decode-Execute, in a largely abstract context, although the only instruction set currently supported is Intel's IA-32/x86 architecture.

Live demo

http://jemul8.com

Run the tests

Note that you will need nasm available in your PATH for the tests to execute.

  • Under Node.js

    From the project root, simply run npm test.

  • In the browser

    From the project root, run npm run-script webtest and visit the URL provided in the output.

Simple example (AMD)

/*global define */
define({
    cache: false
}, [
    "jemul8"
], function (
    jemul8
) {
    "use strict";

    var environment = jemul8.getEnvironment(),
        emulator = jemul8.createEmulator({
            "cmos": {
                "bios": "docs/bochs-20100605/bios/BIOS-bochs-legacy"
            },
            "vga": {
                "bios": "docs/bochs-20100605/bios/VGABIOS-lgpl-latest"
            },
            "floppy": [{
                "driveType": "FDD_350HD",
                "diskType": "FLOPPY_1_44",
                "path": "boot/" + environment.getOption("flp"),
                "loaded": true
            }]
        });

    emulator.loadPlugin("canvas.vga.renderer");
    emulator.loadPlugin("keyboard.input");

    emulator.init().done(function () {
        emulator.run();
    });
});