You are previewing Beautiful Architecture.

Beautiful Architecture

Cover of Beautiful Architecture by Georgios Gousios... Published by O'Reilly Media, Inc.
O'Reilly logo

Chapter 9. JPC: An x86 PC Emulator in Pure Java

Rhys Newman

Christopher Dennis

 Principles and properties Structures
 Conceptual integrity Dependency
 Independently changeableProcess
Automatic propagation Data access
Growth accommodation  
Entropy resistance  

“Emulators are slow and Java is slow; thus the combination could only mean computation at a snail’s pace.” As this conventional wisdom would suggest, the first JPC prototype ran 10,000 times slower than a real machine.

Nevertheless, a pure Java x86 PC emulator is a compelling idea—imagine booting Linux and Windows inside a secure Java Sandbox while remaining fast enough to be practical. Not that this task was ever likely to be easy, as it required replicating the internals of one of the most complex pieces of machinery humankind has produced. Navigating the task of reproducing the physical x86 PC design, layered on top of the Java Virtual Machine, and then fitting the result inside the security restrictions of the Java Applet sandbox has been an often difficult journey of discovery.

On the way we have experienced computing challenges seldom encountered by modern software engineers, but which offer timely reminders of the fundamentals usually taken for granted. Now we have a beautiful architecture that shows that pure Java emulation of x86 hardware is possible, and also fast enough to be practical after all.


With the increasing processor speed and network performance enjoyed by even domestic ...

The best content for your career. Discover unlimited learning on demand for around $1/day.