v86 README

The project's README from github.com/copy/v86. As one markdown file: README.md.

Join the chat at https://gitter.im/copy/v86 or #v86 on irc.libera.chat

v86 emulates an x86-compatible CPU and hardware. Machine code is translated to WebAssembly modules at runtime in order to achieve decent performance. Here's a list of emulated hardware:

Demos

9front — Arch Linux — Android-x86 1.6-r2 — Android-x86 4.4-r2 — BasicLinux — Buildroot Linux — Damn Small Linux — ELKS — FreeDOS — FreeBSD — FiwixOS — Haiku — SkiffOS — ReactOS — Windows 2000 — Windows 98 — Windows 95 — Windows 1.01 — MS-DOS 6.22 — OpenBSD — Oberon — KolibriOS — SkiftOS — QNX

Documentation

How it works — Networking — Dial-up modem networking — Alpine Linux guest setup — Arch Linux guest setup — Debian with xfce guest setup — MS-DOS/FreeDOS guest setup — Windows 3.1x guest setup — Windows 9x guest setup — Windows NT guest setup — 9p filesystem — Linux rootfs on 9p — Profiling

Compatibility

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

You can get some information on the disk images here: https://github.com/copy/images.

How to build, run and embed?

You need:

See tools/docker/test-image/Dockerfile for a full setup on Debian or WSL.

Alternatively, to build using Docker

Running via Dev Container

Testing

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

mkdir -p images && curl --compressed --output-dir images/ --remote-name-all https://i.copy.sh/{linux.iso,linux3.iso,linux4.iso,buildroot-bzimage68.bin,TinyCore-11.0.iso,oberon.img,msdos.img,openbsd-floppy.img,kolibri.img,windows101.img,os8.img,freedos722.img,mobius-fd-release5.img,msdos622.img}

Run integration tests: make tests

Run all tests: make jshint rustfmt kvm-unit-test nasmtests nasmtests-force-jit expect-tests jitpagingtests qemutests rust-test tests

See tests/Readme.md for more information.

API examples

Using v86 for your own purposes is as easy as:

var emulator = new V86({
    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 v86.d.ts for TypeScript definitions. You can use make doc (TypeDoc) or make denodoc (Deno) to generate HTML documentation in ./docs/api/.

Generative AI

At this time, v86 does not accept pull requests or issues written partially or entirely by generative AI tools. Exceptions may be made on a case-by-case basis.

License

v86 is distributed under the terms of the Simplified BSD License, see LICENSE. The following third-party dependencies are included in the repository under their own licenses:

Credits

More questions?

Shoot me an email to [email protected]. Please report bugs on GitHub.

v86 (copy/v86)

cpu
Searching Database…

23.6K ·GitHub
What is this?v86 is an x86 PC emulator that runs entirely in the browser. It emulates a Pentium-4-class CPU and classic PC hardware, translating guest machine code to WebAssembly at runtime for decent speed.
Is this something I install like VirtualBox, or does it just run in a web page?There is nothing to install — it runs in a web page. You can try the hosted demos, embed it in your own site via libv86.js, or pull in the official npm package for bundler-based projects.
How do I add it to my own project, then?For Vite, React, Next or Webpack setups run 'npm install v86'. Otherwise take libv86.js from the release section and follow the bundled examples; building from source means 'make' for a debug build or 'make all' for the optimized one.
How capable is the emulated machine?The CPU is only around Pentium 4 level with full SSE3. There are no 64-bit extensions and no multicore, so 64-bit kernels will not run — you are limited to 32-bit guests.
Does it matter which OS or browser I am on?Not really — everything runs client-side, so any modern browser works. If you would rather serve the emulator yourself, the repo ships a Dockerfile and a single docker run command starts a server.
Can I embed it in my own site without license headaches?Yes — it uses the permissive Simplified BSD License (BSD-2-Clause). A few bundled third-party parts such as SoftFloat and zstd keep their own licenses.
Which operating systems actually run well on it?Linux works well (32-bit only), as do FreeDOS, MS-DOS, Windows 1.01 through 2000, ReactOS, Haiku, KolibriOS, QNX and FreeBSD. Plan 9 and OS/2 do not work, and Windows XP or newer runs only under certain conditions.
What hardware does the emulated PC have?Classic PC parts: PS/2 keyboard and mouse, floppy and IDE disk controllers, VGA with SVGA and Bochs VBE extensions, a SoundBlaster 16, virtio devices and even a Hayes-compatible dial-up modem.
Can the emulated machine go online?Yes — you get an NE2000 PCI network card plus virtio networking, and the docs cover both regular and dial-up modem networking. One example even networks two emulator instances via the Broadcast Channel API.
Can I save a running machine and resume it later?Yes — the API lets you save and restore emulator state, and zstd compression keeps the saved state images small.
What are similar projects?ra2, martypc, esp32sim, daedalOS, webvm, liteparse, frank-386, windows95
Which topics is it in?jit, retro, cpu, x86, emulator, virtualization, wasm, hardware, bsd, browser, rust, npm
Creator
copy
Size
16.4 MB
Stars
23.6K
Updated
CommitOct 18
Age
12y
Commits · 90 Days