JSLinux - Technical Notes

History

This emulator has a long history. In 2011 I wrote the initial version of JSLinux, the first PC/x86 emulator in Javascript running Linux. I reused parts of another of my emulators (QEMU) for the x86 helpers and the devices.

After some time (2015), I modified it to use the asm.js Javascript subset so that it is faster with the browsers supporting it.

In 2016, after having written riscvemu, a RISC-V emulator, I decided to make a Javascript version from its C code by using emscripten. I added a VirtIO 9P filesystem inspired by the one in jor1k by Sebastian Macke so that it is easier to use remote filesystems and to import or export files.

Then I found interesting to reuse the VirtIO devices for the x86 JS emulator, so I converted the JSLinux asm.js code to C and converted it back to Javascript with emscripten ! With a careful tuning, the new version is now faster than the hand-coded asm.js version.

The next step was to run another operating system than Linux, for example Windows NT. A first release of this emulator ran Windows NT with QEMU inside the emulated Linux system. It was still usable because the x86 emulator supports an x86 virtualization extension (AMD SVM) used by QEMU.

The current version of JSLinux runs Windows NT by emulating the few missing PC devices (PS/2 keyboard and mouse, IDE disk, dummy VGA).

CPU Emulation

A x86 CPU with the following features is emulated: Known limitations:

Emulated Devices

Performance

On a typical desktop PC (2017) with a Firefox browser, the emulator runs about 100 MIPS. Detailed benchmarks are possible with the integrated vmtime utility.

Javascript Terminal

It is an improved version of the original JSLinux one. It has a scrollbar and supports URL highlighting.

Linux distribution

It uses the Buildroot embedded distribution. Custom packages are added for vfsync, qemacs, riscvemu, x86emu, tcc, calc. Optional X Window support is available with the Fluxbox window manager.

What's the use ?

I did it for fun, just because Javascript engines are fast enough to do complicated things. Real use could be:

Similar projects

Several other PC or Linux emulators are available. In particular:
[Back to the VM list]