Wednesday, May 18th, 2011
js/linux
This PC emulator is written in Javascript. The emulated hardware consists of:
a 32 bit x86 compatible CPU
a 8259 Programmble Interrupt Controller
a 8254 Programmble Interrupt Timer
a 16450 UARTThe code is written in pure Javascript using Typed Arrays which are available in recent browsers. It was tested with Firefox 4 and Google Chrome 11 on Linux, Window and Mac (it does not work with Chrome 12 beta. As far as I know, it is a bug in the browser). In any case, a fast Javascript engine is needed to have good performance.
I compiled a 2.6.20 Linux kernel (I guess any other version would work provided there is still an FPU emulator). The configuration is here and there is a small optional patch to avoid outputting warnings due to the slow serial port. An uncompressed kernel image is used instead of a compressed one to have a faster boot. It is generated with “objcopy -O binary vmlinux vmlinux.bin”.
The disk image is just a ram disk image loaded at boot time. It contains a filesystem generated with Buildroot containing BusyBox. I added my toy C compiler TinyCC and my unfinished but usable emacs clone QEmacs.
June 29th, 2011 at 5:22 pm
jslinux said:
We added a shortcut url for jslinux- see http://jslinux.org