x86 virtualization in your browser, recompiling x86 to wasm on the fly
Go to file
Ilya Kreymer e3a2ad90b1
Ne2k Driver Fixes to Support Running in Windows! (#378)
ne2k fixes to support network card in Windows (compared to qemu implementation)
- fix clearing of initial buffer (this appears to be the main fix!)
- additional fixes for write logic
2020-12-07 04:08:00 +01:00
.github/workflows Don't build ACPI 2020-09-06 23:48:42 +02:00
bios Update bochs bios 2017-12-13 13:22:49 -05:00
docs add lock_mouse business 2020-07-17 22:44:24 +02:00
examples Fix tabulators from escaping CLI (copy#217) 2019-11-24 19:52:35 -06:00
lib Port filesystem changes from jor1k 2018-02-14 16:34:54 -06:00
src Ne2k Driver Fixes to Support Running in Windows! (#378) 2020-12-07 04:08:00 +01:00
tests Typos (#371) 2020-10-04 19:46:41 +02:00
.editorconfig Only use vga color linked list for small changes 2018-01-23 11:36:45 -06:00
.gitignore Minor: Newline at end of file 2018-02-14 17:58:27 -06:00
.travis-run-integration-acpi.sh ACPI test for travis 2018-01-24 11:21:26 -06:00
.travis-run-integration.sh Add kvm-unit-test to travis CI (#129) 2017-05-01 13:49:40 -05:00
.travis-run-nasm.sh Update test scripts 2017-06-20 16:24:40 -05:00
.travis-run-unit-qemu.sh Update test scripts 2017-06-20 16:24:40 -05:00
.travis-run-unit.sh Add kvm-unit-test to travis CI (#129) 2017-05-01 13:49:40 -05:00
.travis.yml ACPI test for travis 2018-01-24 11:21:26 -06:00
debug.html Exposing the option to specify the second hard disk as a slave 2020-06-29 17:10:15 +02:00
index.html Clean up after #354 2020-09-06 14:01:50 -05:00
LICENSE Update copyright year to 2018 2018-01-02 11:03:22 -06:00
loader.js Roughly implement sb16 behaviour 2017-12-16 22:51:40 -06:00
Makefile Include sourcemap in libv86.js 2020-04-22 22:43:25 +02:00
package.json Simple initial package.json 2015-11-06 17:19:04 +01:00
Readme.md Fix readme 2018-02-14 19:24:39 -06:00
v86.css Fix keyboard on ios, fixes #105 2017-11-09 18:13:37 +01:00

Join the chat at https://gitter.im/copy/v86

Demos

API examples

Using v86 for your own purposes is as easy as:

var emulator = new V86Starter({
    screen_container: document.getElementById("screen_container"),
    bios: {
        url: "../../bios/seabios.bin",
    },
    vga_bios: {
        url: "../../bios/vgabios.bin",
    },
    cdrom: {
        url: "../../images/linux.iso",
    },
    autostart: true,
});

See API.

How does it work?

v86 emulates an x86-compatible CPU and hardware. Here's a list of emulated hardware:

  • An x86 compatible CPU. The instruction set is around Pentium 1 level. Some features are missing, more specifically:
    • Task gates, far calls in protected mode
    • 16 bit protected mode features
    • Single stepping
    • MMX, SSE
    • A bunch of FPU instructions
    • Some exceptions
  • A floating point unit (FPU). Calculations are done with JavaScript's double precision numbers (64 bit), so they are not as precise as calculations on a real FPU (80 bit).
  • A floppy disk controller (8272A).
  • An 8042 Keyboard Controller, PS2. With mouse support.
  • An 8254 Programmable Interval Timer (PIT).
  • An 8259 Programmable Interrupt Controller (PIC).
  • A CMOS Real Time Clock (RTC).
  • A generic VGA card with SVGA support and Bochs VBE Extensions.
  • A PCI bus. This one is partly incomplete and not used by every device.
  • An IDE disk controller.
  • An NE2000 (8390) PCI network card.
  • A virtio filesystem.
  • A SoundBlaster 16 sound card.

Testing

The disk images are not included in this repository. You can download them directly from the website using:

wget -P images/ https://copy.sh/v86/images/{linux.iso,linux3.iso,kolibri.img,windows101.img,os8.dsk,freedos722.img,openbsd.img}.

A testsuite is available in tests/full/. Run it using node tests/full/run.js.

How to build, run and embed?

  • Building is only necessary for releases, open debug.html and everything should load out of the box
  • If you want a compressed and fast (i.e. with debug code removed) version, you need Closure Compiler. Download it as shown below and run make build/v86_all.js.
  • ROM and disk images are loaded via XHR, so if you want to try out index.html locally, make sure to serve it from a local webserver. You can use make run to serve the files using Python's SimpleHTTPServer.
  • If you only want to embed v86 in a webpage you can use libv86.js. For usage, check out the API and examples.
  • A couple of disk images are provided for testing. You can check them out using wget -P images/ https://copy.sh/v86/images/{linux.iso,linux3.iso,kolibri.img,windows101.img,os8.dsk,freedos722.img,openbsd.img}.

Short summary:

# grab the main repo
git clone https://github.com/copy/v86.git && cd v86

# grab the disk images
wget -P images/ https://copy.sh/v86/images/{linux.iso,linux3.iso,kolibri.img,windows101.img,os8.dsk,freedos722.img,openbsd.img}

# grab closure compiler
wget -P closure-compiler https://dl.google.com/closure-compiler/compiler-latest.zip
unzip -d closure-compiler closure-compiler/compiler-latest.zip *.jar

# build the library
make build/libv86.js

# run the tests
./tests/full/run.js

Compatibility

Here's an overview of the operating systems supported in v86:

  • Linux works pretty well.
    • Tinycore (3.16, 4.8 kernel): Works.
    • Nanolinux works.
    • Archlinux works with some caveats. See archlinux.md.
    • Damn Small Linux (2.4 Kernel): Doesn't work.
  • ReactOS works.
  • FreeDOS, Windows 1.01 and MS-DOS run very well.
  • KolibriOS works. A few applications need SSE.
  • Haiku boots, but takes very long (around 30 minutes).
  • No Android version seems to work, you still get a shell.
  • Windows 1, 3, 95 and 98 work. Windows XP is unstable, but can work with some tweaks (see this issue). Other versions might work but haven't been tested.
  • Many hobby operating systems work.
  • FreeBSD works.
  • OS/2 doesn't work.

You can get some infos on the disk images here: https://github.com/copy/images. The Windows images are from WinWorld.

How can I contribute?

  • Add new features (hardware devices, fill holes in the CPU), fix bugs. Check out the issues section and contact me if you need help.
  • Report bugs.
  • If you want to donate, let me know.

License

Credits

More questions?

Shoot me an email to copy@copy.sh. Please don't tell about bugs via mail, create a bug report on GitHub instead.

Author

Fabian Hemmer (http://copy.sh/, copy@copy.sh)