The name Fabrice Bellard may not be recognizable to a lot of people, but the work he carries out as a programmer and computer scientist is. He is the man behind the LZEXE compression engine, FFmpeg audio and video converter, the QEMU emulator and virtualizor, and he also held the World Record for the computation of PI to 2,700 billion digits in 2009.

He is a very talented programmer, and his latest project demonstrates once again just how talented he is. Using the super-fast JavaScript engines that now come as standard in popular web browsers, he has managed to create a PC emulator that runs in a browser. As a demonstration he has posted a link to a version of the Linux kernel running in such a scenario.

Bellard wrote the entire emulator in JavaScript and says it runs fine in both Firefox 4 and Google Chrome 11. As it’s in a browser it automatically becomes platform independent meaning whatever platform your browser runs on, the emulator will work.

The emulation on offer serves up a 32-bit x86 CPU, 8259 programmable interrupt controller, 8254 programmable interrupt timer, and a 16450 UART. There is no FPU, but then the Linux kernel used has one emulated in software. The version of Linux running is the 2.6.20 kernel which is executed in RAM on your machine.

Bellard says that he wrote the emulator for fun, but also to help him learn to write optmized code for the latest JavaScript engines. One thing he can’t explain from the implementation is why the Firefox 4 Jaeger Monkey engine runs the emulator twice as fast as the Chrome V8 engine. A little investigation by Google may find the issue, though, if they care to look.

There are many uses for such an emulator running in a browser instance. One of the more exciting for this writer is the potential to run old DOS games.

Read more at Bellard’s website
source: link