- a 32 bit x86 compatible CPU
- a 8259 Programmble Interrupt Controller
- a 8254 Programmble Interrupt Timer
- a 16450 UART.
The code is inspired from my x86 dynamic translator present in QEMU, but there are important differences because here it is an interpreter. The exact restrictions of the emulated CPU are:
- No FPU/MMX/SSE
- No segment limit and right checks when accessing memory (Linux does not rely on them for memory protection, so it is not an issue. The x86 emulator of QEMU has the same restriction).
- No CS/DS/ES/SS segment overrides. FS/GS overrides are implemented because they are needed for Thread Local Storage in Linux.
- A few seldom used instructions are missing (BCD operations, BOUND, …).
- No single-stepping
- No real mode
- No 16 bit protected mode (although most 16 bit instructions are present because they are needed to run 32 bit programs).
Most of these restrictions are easy to remove.
Linux distro & kernel
It runs 2.6.20 Linux kernel with configuration available here.
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.
PC emulator is about 2 times slower using V8 than Jaeger Monkey on 32bit desktops.
I still have to try this on mobile browsers, let me know if that works for you.