A fork of v86

Linux on ARM64 and RISC-V,
in your browser

v86 emulates an x86 PC in WebAssembly. This fork adds two more machines to it: a 64-bit ARM (AArch64) computer and a RISC-V computer (64- and 32-bit), each booting real Linux images built with Buildroot, with a serial console, a virtual disk and networking, entirely client-side.

Pick a machine

Illustration of an AArch64 processor chip

ARM64 (AArch64)

An ARMv8-A CPU with a QEMU virt-like machine: GIC interrupt controller, PL011 UART, virtio disk, network and input devices, and a framebuffer.

  • Buildroot Linux (ext4 and squashfs)
  • OpenWrt 24.10 with the LuCI web interface
  • U-Boot booting Linux from the disk
  • X11 desktop: openbox, xterm, on-screen keyboard
  • JIT: hot code compiled to WebAssembly
  • gdb-wui: debug programs in the guest from a web UI next to the console
  • Pebble watches running PebbleOS on a new Cortex-M core (Cortex-M4 and Cortex-M33, Thumb-2): the Pebble 2 Duo with its buttons, and the round Pebble Round 2 with its touch screen
  • The card10 badge (CCC camp 2019) on the same core: two Cortex-M4F cores, FreeRTOS on one and MicroPython on the other, with its display, buttons and a MicroPython REPL
Boot ARM64 Linux Debug with gdb-wui on ARM64 Wear a Pebble: PebbleOS in your browser Try the round Pebble Round 2 Boot a card10 badge: two cores, FreeRTOS and MicroPython
Illustration of a RISC-V processor chip

RISC-V (RV64GC and RV32GC)

A RISC-V hart with machine, supervisor and user modes, Sv39 and Sv32 paging, CLINT, PLIC, 16550 UART and virtio devices, started by OpenSBI.

  • Buildroot Linux, riscv64 and riscv32
  • Passes the riscv-tests ISA suites (rv64 and rv32)
  • Checked instruction by instruction against QEMU
  • JIT: hot code compiled to WebAssembly
  • A WCH CH32V003 microcontroller (RV32EC, 2 KB of RAM) running a bare-metal Tetris, with touch controls for phones
  • gdb-wui: debug programs in the guest from a web UI next to the console
  • Stefan Wagner's CH32V003 Mini Game Console: its OLED display, buttons and buzzer, with twelve games (Tris, Invaders, Arkanoid, Pacman, Lander, Life, Doom, Boulder, Bubble, Karate, Run, Shooter)
  • Maksym Curul's CH32V003 Mini Game Console: its colour LCD, buttons and buzzer, with Snake, Pong, Jump Bird and Dino Run, and high scores saved in its flash
  • Vlad Tomoiagă's osillyscope, a CH32V003 pocket oscilloscope: feed it a test signal or your microphone and watch the waveform on its OLED
  • A WCH CH32V307 microcontroller (RV32IMAFC, 64 KB of RAM) running the RT-Thread shell, with snake, an analog clock, CoreMark and Lua
  • Debug the CH32V003's firmware with gdb-wui, through a GDB stub in the emulated core
Boot RISC-V Linux Play Tetris on an emulated CH32V003 Play the CH32V003 game console Play the colour CH32V003 mini game console Watch your voice on the CH32V003 oscilloscope Try the RT-Thread shell on an emulated CH32V307 Debug with gdb-wui on RISC-V Debug Tetris on the CH32V003 with gdb-wui
Illustration of an x86 processor chip

x86 (the original)

The original v86 by its upstream authors: a 32-bit x86 PC that runs Linux, Windows, BSDs, DOS and more, with its own JIT. This fork doesn't change it.

  • Many ready-made operating systems
  • VGA graphics, sound, networking
Open copy.sh/v86

Debugging in the browser: gdb-wui

gdb-wui is a web UI for GDB: source, disassembly, variables, registers, memory, threads and a gdb console in one window, with gdb itself doing the debugging. On both sites an image runs it inside the emulated machine, next to the console: gdb and gdb-wui run in the guest, and the page carries gdb-wui's HTTP and WebSocket traffic over v86's virtual network, so nothing leaves your browser.

Its example programs are in /root/demo: pick one, click Run→main and step. Or start gdbserver :1234 /root/demo/hello & on the console and click connect in gdb-wui's console bar to debug it remotely.

Its Decompiled view works with no Ghidra in the guest: the example programs and the stripped /bin/busybox were decompiled by Ghidra when the image was built, and a picker switches to kuna, Ghidra's decompiler ported to Rust, which the page runs as WebAssembly beside the emulator and gdb-wui asks over the virtual network — for any program in the guest. gdb-wui is made for a desktop browser.

It debugs the microcontrollers' firmware too. Add &debug to a CH32V003 page (Tetris or a game console game): the microcontroller is held at reset, and the page boots the riscv64 gdb-wui image beside it with the firmware's ELF and sources. The emulated core has a GDB stub, which the page offers on the guest's network as a debug probe would, so gdb in the guest connects with target remote: breakpoints in flash, stepping through the C source, registers, memory and monitor reset halt, while the display keeps drawing.

Built with Claude

The ARM64 and RISC-V ports were done entirely using Claude Opus 5.5, Anthropic's model, working in Claude Code: the CPU cores and their JIT compilers (in Rust, compiled to WebAssembly), the device models, the test harnesses that run the cores in lockstep with QEMU, the scripts that build the OpenWrt, U-Boot and X11 images, and these sites.

The original v86 and its x86 emulation are the work of the upstream project's authors.

Links