Mac 68K emulator

Mac 68K emulator

The Mac 68K emulator was a software emulator built into all versions of the Mac OS for PowerPC. This emulator permitted the running of applications and system code that were originally written for the 680x0 based Macintosh models. The emulator was completely seamless for users, and reasonably seamless for programmers. It is thought that this aspect of the Mac OS is the first time that such a dual hardware architecture operating system had ever been successfully implemented. The first version was written by Gary Davidian, who had originally created it for use on the Motorola 88000 CPU, used in Apple's abortive first attempt at a RISC target platform. A later version, using dynamic recompilation, was developed by Eric Traut, who later worked on successful emulation projects such as Connectix Virtual Game Station and Microsoft Virtual PC.

All versions of this emulator emulated the 'user' subset of the 68EC040 instruction set with a 68020/68030 exception stack frame. [http://developer.apple.com/documentation/mac/PPCSoftware/PPCSoftware-13.html Apple developer documents] indicate that the emulator will provide an operating environment most closely resembling that of the Macintosh Centris 610, a system based on the Motorola 68LC040 microprocessor. Early versions emulated it by decoding each instruction and immediately carrying out a series of equivalent PowerPC instructions. For the PCI PowerMacs, the dynamic recompilation emulator was used to boost performance. Dynamic recompilation works by "recompiling" common sections of the code into faster, PowerPC-native, sequences that were locally cached. The emulator could recognise the same sequence of 680x0 code, and run the previously cached PowerPC code to avoid doing the translation again. This emulator was theoretically capable of emulating 680x0 code faster than any real 680x0 was capable of running. The 68LC040 had no floating point instructions, making this feat slightly simpler but no less impressive.

One reason that this emulation was so successful is that many of the APIs for the Mac OS were originally implemented as traps on the 680x0 processor - calling an API actually was recognised by the 680x0 as the equivalent of an error condition, which would cause it to handle that error through one of its hardware vectors, which in turn would look up and run the operating system routine from ROM or RAM. In the emulator, such traps could be replaced by native PowerPC code, so the only code being emulated was the application itself - any system API it called could be accelerated with native PowerPC code. It also allowed Apple time to port the OS to the PowerPC - at first only time critical aspects were rewritten in native code, leaving much of the OS emulated. Gradually most of the OS was rewritten to be native, so the OS got faster over time.

For the programmer, the transition to the PowerPC was made fairly painless, as the emulator was started and stopped automatically. This was achieved using a new type of pointer called a Universal Procedure Pointer (UPP). For 68k code, this pointer appeared and used as an ordinary pointer to code, but actually led to a special data structure, which contained a special trap instruction and flags indicating the instruction set architecture (ISA) of the called code, and from PowerPC code, can be passed to the CallUniversalProc() function to call it. The 68k emulator then dealt with details such as presenting passed parameters in the right order for the ISA in question, as well as starting and stopping the emulator as required. The compilers for Mac OS created such UPPs automatically when the proper macros were used, and the PowerPC system libraries contained native stubs to transparently call through to native or still-68k functions as needed, so dealing with the dual architecture required very little work for the programmer. And just like the OS, applications themselves could mix and match 680x0 and PowerPC code fairly easily.

The emulator is no longer part of Mac OS X, though it remains as an integral part of the Classic environment.

See also

* Mac OS nanokernel
* Rosetta, a similar feature in Mac OS X that translates PowerPC instructions to x86 instructions


Wikimedia Foundation. 2010.

Look at other dictionaries:

  • Mac - получить на Академике действующий промокод Алиэкспресс или выгодно mac купить со скидкой на распродаже в Алиэкспресс

  • Mac OS nanokernel — Before Mac OS X, PowerPC versions of the Mac OS were based on a nanokernel, or extremely simple operating system kernel. The initial revision of this software is an extremely simple, single tasking system which delegates most tasks to an emulator …   Wikipedia

  • Mac OS X — OSX redirects here. For other uses, see OSX (disambiguation). Mac OS X …   Wikipedia

  • Mac OS 9 — Basisdaten Entwickler Apple Computer, Inc Sprache(n) Multilingual Version 9.2.2 (stable) (5. Dezember 2001 …   Deutsch Wikipedia

  • Mac OS — MacOS redirects here. For the American humanities teaching program, see Man: A Course of Study. Mac OS Company / developer Apple OS family Mac OS (System 1–7, Mac OS 8–9) …   Wikipedia

  • Emulator — Als Emulator (von lat. aemulare, „nachahmen“) wird in der Computertechnik ein System bezeichnet, das ein anderes in bestimmten Teilaspekten nachbildet. Das nachgebildete System erhält die gleichen Daten, führt vergleichbare Programme aus und… …   Deutsch Wikipedia

  • Mac OS — Logo des Mac OS Mac OS [mæk oʊˈɛs] ist der Name des Betriebssystems von Apple für Macintosh Computer. Der Begriff ist abgeleitet von Macintosh Operating System, einer Bezeichnung, die so niemals verwendet wurde. Im Gegensatz zu den anderen… …   Deutsch Wikipedia

  • Apple Power Mac — Power Macintosh oder auch Power Mac ist der Produktname für die Macintosh Modelle der Firma Apple mit PowerPC Prozessor. Die vorher nur umgangssprachlich benutzte Bezeichnung „Power Mac“ wird von Apple seit den G4 Modellen offiziell verwendet,… …   Deutsch Wikipedia

  • Apple Power Mac G4 — Power Macintosh oder auch Power Mac ist der Produktname für die Macintosh Modelle der Firma Apple mit PowerPC Prozessor. Die vorher nur umgangssprachlich benutzte Bezeichnung „Power Mac“ wird von Apple seit den G4 Modellen offiziell verwendet,… …   Deutsch Wikipedia

  • Apple Power Mac G5 — Power Macintosh oder auch Power Mac ist der Produktname für die Macintosh Modelle der Firma Apple mit PowerPC Prozessor. Die vorher nur umgangssprachlich benutzte Bezeichnung „Power Mac“ wird von Apple seit den G4 Modellen offiziell verwendet,… …   Deutsch Wikipedia

  • Power Mac — Power Macintosh oder auch Power Mac ist der Produktname für die Macintosh Modelle der Firma Apple mit PowerPC Prozessor. Die vorher nur umgangssprachlich benutzte Bezeichnung „Power Mac“ wird von Apple seit den G4 Modellen offiziell verwendet,… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”