Science Fair Projects Ideas - Mac 68K emulator

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

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 and only time that such a dual hardware architecture operating system has ever been successfully implemented.

All versions of this emulator emulated the 68020 chip instruction set. Early versions emulated it in a simple fashion where each instruction was carried out by a series of equivalent PowerPC instructions. Later, a dynamic recompilation emulator was used, to boost performance. This worked by "recompiling" common sections of 680x0 code into faster sequences that were locally cached. The emulator could recognise the same sequence of 680x0 code, and run the previously cached code to avoid doing the translation again. This emulator was capable of emulating the 68020 faster than any real 68040 was capable of running.

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 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 Power PC code, so the only code being emulated was the application itself - any system API it called could be accelerated with native Power PC code. It also allowed Apple time to port the OS to the Power PC - 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 Power PC 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 680x0 code, a UPP was an ordinary pointer, so already compiled code did not need to be changed to run. For Power PC code, the pointer was actually a special trap, which would examine the flags associated with the pointer to determine the instruction set architecture (ISA) of both the caller and called code, and start up or stop the emulator as needed. This trap also dealt with details such as presenting passed parameters in the right order for the ISA in question. The compilers for Mac OS created such UPPs automatically when the proper macros were used, so dealing with the dual architecture required very little work for the programmer.

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

10-26-2009 08:16:03
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice