In association with heise online

17 May 2011, 16:55

Linux PC in a browser

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

Zoom Bellard's JS/Linux runs Linux within a browser.
French hacker Fabrice Bellard has demonstrated how JavaScript can do much more than simply animate web sites and process server data by creating a PC emulator written in the scripting language. JS/Linux emulates a 32-bit x86 compatible CPU, a programmable interrupt controller, a programmable interrupt timer and a serial port – taking just over 90 KB to do so. It lacks a mathematical co-processor and MMX commands, making it roughly on a par with a 486-compatible x86 CPU without FPU. It can, however, be used to run older Linux kernels (2.6.20), as they include an FPU emulator.

In implementing the emulator, Bellard took inspiration from his QEMU emulator/virtualiser. The emulator can be used in most modern web browsers, such as Firefox 4 or Chrome 11 or later. It makes extensive use of typed arrays, which are only available in the latest JavaScript implementations; this allows binary data to be read and written directly in JavaScript. As well as a Linux kernel, JS/Linux also contains a small Emacs clone and a C compiler (Tiny C Compiler), which is significantly smaller and faster than the GNU compiler.

Bellard created LZEXE, one of the first executable zip programs for DOS, and also founded the FFmpeg project, which today forms the core of many popular open source video players including MPlayer and the VLC Media Player. He is also a two-time winner of the International Obfuscated C Code Contest (IOCCC).


Print Version | Send by email | Permalink:

  • July's Community Calendar

The H Open

The H Security

The H Developer

The H Internet Toolkit