All Projects → copy → V86

copy / V86

Licence: bsd-2-clause
x86 virtualization in your browser, recompiling x86 to wasm on the fly

Programming Languages

javascript
184084 projects - #8 most used programming language
rust
11053 projects
c
50402 projects - #5 most used programming language
WebAssembly
147 projects
assembly
5116 projects
HTML
75241 projects

Projects that are alternatives of or similar to V86

Dosbox Staging
DOS/x86 emulator focusing on ease of use
Stars: ✭ 412 (-96.77%)
Mutual labels:  x86, emulator
Wasmboy
Game Boy / Game Boy Color Emulator Library, 🎮written for WebAssembly using AssemblyScript. 🚀Demos built with Preact and Svelte. ⚛️
Stars: ✭ 963 (-92.46%)
Mutual labels:  emulator, wasm
Unicorn
Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, X86)
Stars: ✭ 4,934 (-61.35%)
Mutual labels:  x86, emulator
Riscv Rust
RISC-V processor emulator written in Rust+WASM
Stars: ✭ 253 (-98.02%)
Mutual labels:  emulator, wasm
Bap
Binary Analysis Platform
Stars: ✭ 1,385 (-89.15%)
Mutual labels:  x86, emulator
Simpleator
Simpleator ("Simple-ator") is an innovative Windows-centric x64 user-mode application emulator that leverages several new features that were added in Windows 10 Spring Update (1803), also called "Redstone 4", with additional improvements that were made in Windows 10 October Update (1809), aka "Redstone 5".
Stars: ✭ 260 (-97.96%)
Mutual labels:  emulator, virtualization
Gameboy
🎮 Game Boy emulator written in Rust
Stars: ✭ 17 (-99.87%)
Mutual labels:  emulator, wasm
ts-c99-compiler
ANSI C 16bit Compiler + NASM Assembler + Intel 8086 / 80186 + X87 emulator written entirely in TypeScript
Stars: ✭ 78 (-99.39%)
Mutual labels:  emulator, x86
I8086.js
16bit Intel 8086 / 80186 + X87 emulator written in TypeScript with REPL assembly compiler and tiny C compiler
Stars: ✭ 54 (-99.58%)
Mutual labels:  x86, emulator
Emu
cybozu labs youth 7th
Stars: ✭ 51 (-99.6%)
Mutual labels:  x86, emulator
Corium
Corium is a modern scripting language which combines simple, safe and efficient programming.
Stars: ✭ 18 (-99.86%)
Mutual labels:  emulator, virtualization
Gbemu
WebAssembly based Gameboy Emulator
Stars: ✭ 120 (-99.06%)
Mutual labels:  emulator, wasm
FEX
A fast usermode x86 and x86-64 emulator for Arm64
Stars: ✭ 650 (-94.91%)
Mutual labels:  emulator, x86
Rustynes
👾 An NES emulator by Rust and WebAssembly
Stars: ✭ 399 (-96.87%)
Mutual labels:  emulator, wasm
emu
cybozu labs youth 7th
Stars: ✭ 50 (-99.61%)
Mutual labels:  emulator, x86
Bddisasm
bddisasm is a fast, lightweight, x86/x64 instruction decoder. The project also features a fast, basic, x86/x64 instruction emulator, designed specifically to detect shellcode-like behavior.
Stars: ✭ 540 (-95.77%)
Mutual labels:  x86, emulator
SaltyNES
A NES emulator in WebAssembly
Stars: ✭ 69 (-99.46%)
Mutual labels:  emulator, wasm
vrcpu
Code, documentation, schematics, notes for my Ben Eater inspired breadboard computer and emulator
Stars: ✭ 98 (-99.23%)
Mutual labels:  emulator, wasm
Dustbox Rs
DOS emulator (work in progress)
Stars: ✭ 34 (-99.73%)
Mutual labels:  x86, emulator
Microx
Safely execute an arbitrary x86 instruction
Stars: ✭ 120 (-99.06%)
Mutual labels:  x86, emulator

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

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:

  • An x86-compatible CPU. The instruction set is around Pentium III level, including full SSE2 support. Some features are missing, in particular:
    • Task gates, far calls in protected mode
    • Some 16 bit protected mode features
    • Single stepping (trap flag, debug registers)
    • Some exceptions, especially floating point and SSE
    • Multicore
    • PAE
    • 64-bit extensions
  • A floating point unit (FPU). Calculations are done using the Berkeley SoftFloat library and therefore should be precise (but slow). Trigonometric and log functions are emulated using 64-bit floats and may be less precise. Not all FPU exceptions are supported.
  • 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).
  • Partial APIC support.
  • 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.

Demos

Arch LinuxDamn Small LinuxBuildroot LinuxReactOSWindows 2000Windows 98Windows 95Windows 1.01MS-DOSFreeDOSFreeBSDOpenBSD9frontHaikuOberonKolibriOSQNX

Compatibility

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

  • Linux works pretty well. Neither 64-bit nor PAE kernels are supported.
    • Damn Small Linux (2.4 Kernel) works.
    • All tested versions of TinyCore work.
    • BuildRoot can be used to build a minimal image. humphd/browser-vm has some useful scripts for building one.
    • Archlinux works. See archlinux.md for building an image.
    • Debian works. An image can be built from a Dockerfile, see tools/docker/debian/.
    • Ubuntu up to 10.04 works.
    • Alpine Linux works.
  • ReactOS works.
  • FreeDOS, Windows 1.01 and MS-DOS run very well.
  • KolibriOS works.
  • Haiku works.
  • Android x86 1.6-r2 works if one selects VESA mode at the boot prompt. Newer versions may work if compiled without SSE3. See #224.
  • Windows 1, 3.0, 95, 98, ME and 2000 work. Other versions currently don't (see #86, #208).
    • In Windows 2000 and higher the PC type has to be changed from ACPI PC to Standard PC
  • Many hobby operating systems work.
  • 9front works.
  • Plan 9 doesn't work.
  • QNX works.
  • OS/2 doesn't work.
  • FreeBSD works.
  • OpenBSD works with a specific boot configuration. At the boot> prompt type boot -c, then at the UKC> prompt disable mpbios and exit.
  • NetBSD works only with a custom kernel, see #350.
  • SerenityOS doesn't work due to missing PAE support.

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

How to build, run and embed?

You need:

  • make
  • Rust with the wasm32-unknown-unknown target
  • A version of clang compatible with Rust
  • java (for Closure Compiler, not necessary when using debug.html)
  • nodejs (a recent version is required, v16.11.1 is known to be working)
  • To run tests: nasm, gdb, qemu-system, gcc, libc-i386 and rustfmt

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

  • Run make to build the debug build (at debug.html).
  • Run make all to build the optimized build (at index.html).
  • 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 http module.
  • If you only want to embed v86 in a webpage you can use libv86.js. For usage, check out the examples. You can download it from the release section.

Alternatively, to build using docker

  • If you have docker installed, you can run the whole system inside a container.
  • See tools/docker/exec to find Dockerfile required for this.
  • You can run docker build -f tools/docker/exec/Dockerfile -t v86:alpine-3.14 . from the root directory to generate docker image.
  • Then you can simply run docker run -it -p 8000:8000 v86:alpine-3.14 to start the server.
  • Check localhost:8000 for hosted server.

Testing

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

wget -P images/ https://k.copy.sh/{linux.iso,linux4.iso,buildroot-bzimage.bin,openbsd-floppy.img,kolibri.img,windows101.img,os8.img,freedos722.img}

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 infos.

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 starter.js.

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.

Author

Fabian Hemmer (https://copy.sh/, [email protected])

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].