Company aims to emulate PowerPC and Mac OS on PC

Emulators Inc. President Darek Mihocka boldly suggested at the MacHack conference that low prices and the considerable power of X86 processors make it more attractive than ever to run the Mac OS on X86 hardware instead of Apple hardware. Emulators' flagship product, SoftMac, emulates the Mac OS as a standard Windows application.

Currently, SoftMac emulates a Motorola 68K processor on X86 processors from AMD and Intel. This limits the product to emulating Mac OS software that does not require a PowerPC processor. However, the company is working on a software PowerPC emulator for X86 processors. This will allow the company to emulate the Mac OS up to version 9.1.

Mihocka believes that the competition between Intel and AMD has resulted in far lower comparative prices for X86 processors. Additionally, stiff competition has made these lower priced products rise in performance more quickly than the PowerPC.

During his MacHack presentation, Mihocka drew a chart where he plotted the prices and performances of processors from Motorola, IBM, Intel and AMD. When curves were drawn connecting all of a company's processors over time, the point was clearly illustrated. However, the curves of processors from AMD and Intel showed a steep break around the point where AMD began competing directly with Intel.

IBM and Motorola have not responded to this desktop competition, perhaps because their offerings need to meet the power consumption and heat generation requirements of the embedded market. Heat generation is of lesser importance for Intel and AMD, because fans are used regularly.

Mihocka suggests that this break in the curve represents the benefit to consumers brought about by the competition between AMD and Intel. While X86 based products have dropped significantly in price, Apple products have maintained a consistent price. By consistent price, Mihocka means that, with a specific processor generation, Apple's high-end models retail for around US$2,500, mid-range desktops for $1,500, and so forth. Currently, it is possible to build a top of the line AMD system for less than $1,000.

At some point, and Mihocka suggests that this point is now or very soon, it will make more sense for performance and cost to emulate the Mac OS on X86 hardware instead of buying a new Mac. Additionally, Mihocka believes that the softening economy will make users more likely to explore less expensive options instead of paying a premium for a pretty Apple box. Emulators Inc. is working on making SoftMac support the latest version of the Classic Mac OS to take advantage of this.

Nevertheless, there is the charge that emulators are slow. So slow that running in emulation is almost unfeasible. Mihocka says that this is no longer the case. "Products are available that now prove that emulation works," said Mihocka. He cited Transmeta's Crusoe processor as an example.

Mihocka said that advances in how the emulation is done coupled with the higher performance of new memory buses and processors make emulation feasible.

The textbook method of emulation is to create a map connecting one set of processor instructions to those of the actual processor that will be running the emulation. This 'hash' is then compiled, and the processor runs through a loop where it must dispatch the translation before it can complete each instruction.

"If you write an emulator using the textbook method, it is going to be slow," said Mihocka. "Inefficiencies come from the compiler and the rules of C++." Mihocka looks at how the processor operates and then hand optimizes his emulator's code in assembly language to waste as few cycles as possible. Additionally, Mihocka tries to make the emulator tiny so it can reside on the processor's cache. SoftMac is a 600KB file, and its working set is small enough to reside on the cache of a standard AMD 'Thunderbird' or Pentium III or IV processor.

Currently, SoftMac emulates a Motorola 68K processor. The 68K processor is a 32-bit processor, but its instructions are 16-bit. This means that there are at most 65,536 items in the instruction matrix that need to be translated to the X86's instruction set. This creates a relatively small loop to run through for emulation. This small number of translations also requires little memory and can even reside in the cache for optimal emulation performance. SoftMac on a high-end PC runs orders of magnitude faster than the fastest 68K processor. However, this processor family was last used in Macs in the mid-nineties.

To run the latest Mac OS versions, a PowerPC processor is required. Emulating the PowerPC is a far more difficult proposition, as it is a true 32-bit processor. This means that millions of instructions need to be translated. This larger 'hash' table explains why memory performance is so crucial in emulation. Moreover, such a large matrix running in the emulation loop can stymie performance. Mihocka says that there are techniques to improve the performance of an emulator with such a large loop. For example, Mihocka says that it is possible to bunch related instructions together to ease some of the performance penalty.

Mihocka is confident that he can create a fast PowerPC emulator for X86 processors. "PowerPC and X86 instructions map together fairly nicely," said Mihocka. He is not yet ready to say exactly how the next SoftMac's emulator will work, but said that more details will be available when the company's new product, SoftMac XP, is launched at Macworld New York in July.

This story, "Company aims to emulate PowerPC and Mac OS on PC" was originally published by PCWorld.

Shop Tech Products at Amazon