JPC Key Features Explained

Cross Platform

Programs are generally compiled for a specific computer architecture and, once compiled, will only run on that machine (or another like it). Pure Java can be compiled once and run on any platform that has a Java Virtual Machine (JVM). JPC is pure Java, and thus runs on Windows, Linux, MacOS, mobile phones, set-top boxes, ARM boards and anything else with a JVM -- all without the need to build different versions for each platform.

Secure

Malicious software in a JPC virtual computer cannot harm your real computer because your real machine is protected by multiple independent layers of security. The first layer is JPC itself, supported in turn by the industry-standard Java virtual machine and then finally scrutinized by your machine's operating system. These layers combine to form an impregnable shield for your computer and data.

Flexible

You can interact with the virtual computer through a window on your desktop, or just watch it while a virtual robot taps at a virtual keyboard. The different components of the virtual computer are completely separated. This enables you to use the hard disk of one computer, the CPU of another, while displaying it all on a screen across the network and typing input on a keyboard on a mobile phone.

The JPC Core

There are many different computer emulators available, however, emulators for the x86 PC are rare and until JPC there had not been an x86 emulator written in pure Java. This is because the x86 PC is an extremely complex architecture, with a long history of incremental improvements, and therefore a legacy of many subtle features! Consequently everyone believed an x86 emulator written in Java would be far too slow to be of any use.

JPC is our answer to this challenge: a pure Java x86 PC emulator which currently runs up to 20% native speed. This puts it amongst the fastest emulators of an x86 PC, despite needing only a pure Java environment. At first sight it might seem impossible for a Java based emulator to approach other emulators which use "native" code. However JPC uses a number of optimization strategies to achieve an acceptable speed. In fact these strategies are very similar to those used by modern x86 hardware; e.g. using a RISC microcode set to streamline the x86 instructions. JPC then uses dynamic binary translation to get the best performance.

In fact, as the HotSpot JVM applies its own optimization strategies on top of JPC, some parts of programs can run even faster inside JPC.

Real, Protected Mode and all those other modes...

PC's have two commonly used modes of operation. The first, Real Mode, is more of a historical relic. MS-DOS runs in real mode and all modern PC's start their boot process in real mode. JPC currently runs real mode at up to 20% of native speed. This speed is achieved despite of the fact that Real mode is essentially a 16-bit mode of operation, which is running on a 32 bit Java Virtual Machine. The second, Protected Mode, is a 32 bit mode, to which all modern operating systems switch to during the boot process. In between Real and Protected Mode, are other modes that evolved at various stages of the x86's lifetime. These modes, like Virtual 8086 Mode and 'Unreal' Mode are often not necessary for modern operating systems once they are up and running, however, operations like boot up and graphic initialization still rely on these obscure modes of operation.

JPC currently has interpreters and compilers which work in all modes of x86 CPU operation. Note that although the table below seems complete, there are still a few issues/bugs with the complex task switching and screen mode alteration which mean JPC still cannot boot into full graphical Linux (for example). We are working on these and hope to have a more complete implementation soon!

Interpreted mode Compiled Mode
Real Mode
Protected Mode
Beta
Virtual 8086 Mode
Beta
Beta
'Unreal' Mode