Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: PowerPC System Software /


Chapter 1 - Introduction to PowerPC System Software

This chapter is a general introduction to the system software provided on PowerPC processor-based Macintosh computers. It describes the mixed environment provided by the 68LC040 Emulator and the Mixed Mode Manager. These two new system software services work together to allow existing 680x0 applications, extensions, drivers, and other software to execute without modification on PowerPC processor-based Macintosh computers. The 68LC040 Emulator and the Mixed Mode Manager also make it possible for parts of the system software to remain as 680x0 code, while other parts of the system software are reimplemented (primarily for reasons of speed) as native PowerPC code.

This chapter also describes the native PowerPC execution environment. Although the process-scheduling mechanism used for both native and emulated applications has not changed, the run-time environment for PowerPC applications is significantly different from the run-time environment used for 680x0-based Macintosh applications. In cases where your application (or other software) relies on features of the 680x0 run-time environment, you'll need to modify your application before recompiling it as a PowerPC application. For example, if your application directly accesses information stored in low memory (such as system global variables) or in its A5 world, you might need to rewrite parts of your application to remove the dependence on that information. See "The PowerPC Native Environment" beginning on page 1-19 for complete instructions on doing this.

You should read this chapter if you want your application to run on PowerPC processor-based Macintosh computers, either under the 68LC040 Emulator or in the PowerPC native environment. If you choose not to rebuild your application for the PowerPC environment, you should at least make certain that it doesn't violate any of the known restrictions on the emulator. See "Emulator Limitations" on page 1-8 for specific information about the known operational differences between the 68LC040 Emulator and a 680x0 microprocessor.

You should also read this chapter for information about the PowerPC execution environment. Although the existing software development tools build your source code into executable PowerPC code that conforms to the requirements of this new environment, you might need to know about the native run-time environment for debugging purposes or if your application uses external code modules. Otherwise, the new execution environment should be completely transparent to your application.

You should be able to accomplish much of the work involved in porting your application from the 680x0 platform to the PowerPC platform using the information in this chapter. If your application installs callback routines with nonstandard calling conventions, however, you might need to read the chapter "Mixed Mode Manager" in this book. In addition, if your application explicitly loads external code modules (such as file translators or custom definition procedures), you might need to read the chapter "Code Fragment Manager" in this book. Read the chapter "Exception Manager" if you want your native application to handle any exceptions that arise while it is executing.

To use this chapter, you should already be generally familiar with the Macintosh Operating System. See the books Inside Macintosh: Processes and Inside Macintosh: Memory for information about the run-time environment of 680x0-based Macintosh computers.

This chapter begins with a description of the mixed environment provided by the PowerPC system software. Then it gives information about the native PowerPC run-time environment. This chapter ends by explaining how to perform a number of specific
tasks in the PowerPC environment, such as patching system software traps.

Note
For ease of exposition, this book occasionally focuses on porting applications from the 680x0 environment to the PowerPC environment. In general, however, any changes required for applications are required also for all other kinds of software.

Chapter Contents
Overview of the PowerPC System Software
The 68LC040 Emulator
Emulator Operation
Emulator Limitations
Coprocessors
Instruction Timings
Deleted Instructions
Unsupported Instruction Features
Instruction Caches
Address Error Exceptions
Bus Error Exceptions
Memory-Mapped I/O Locations
Mixed Mode
Cross-Mode Calls
Routine Descriptors
Memory Considerations
The PowerPC Native Environment
Fragments
The Structure of Fragments
Imports and Exports
The Table of Contents
Special Routines
Fragment Storage
Executable Resources
Calling Conventions
The 680x0 Calling Conventions
The PowerPC Calling Conventions
Parameter Passing
Import Libraries
The Organization of Memory
File Mapping
The System Partition
Application Partitions
Data Alignment
Compatibility and Performance
Patches
The Memory Manager
Performance Tuning
Mode Switches
Routine Parameters

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996