This chapter provides an overview of some of the issues related to developing a universal binary version of an I/O Kit device driver. Before you read this chapter, be sure to read Universal Binary Programming Guidelines, Second Edition. That document covers architectural differences and byte-ordering formats and provides comprehensive guidelines for code modification and building universal binaries. Most of the guidelines in that document apply to kernel extensions as well as to applications.
Before you build your device driver as a universal binary, make sure that:
All targets in your Xcode project are native
You develop your project in Xcode 2.2.1 or later
The Intel side of your universal I/O Kit driver must be built using GCC 4.0 and the Mac OS X 10.4u (Universal) SDK available in Xcode 2.2.1 or later. This allows your driver to load and run on Intel-based Macintosh computers running Mac OS X 10.4.4 or later.
To determine the compiler version and SDK to use when building the PowerPC side of your universal I/O Kit driver, decide which versions of Mac OS X you plan to target:
If you’re targeting versions of Mac OS X earlier than 10.4, use GCC 3.3 and the Mac OS X SDK representing the oldest version of Mac OS X you need to support.
If you’re targeting Mac OS X v10.4.x and you’re using Xcode 2.2.x or Xcode 2.3, use GCC 4.0 and the Mac OS X 10.4.0 SDK (not the Mac OS X 10.4u (Universal) SDK). Note that this differs from universal applications, which can be built using the Mac OS X 10.4u (Universal) SDK for both architectures.
If you’re targeting Mac OS X v10.4.x and you’re using Xcode 2.4 or later, you can define the KPI_10_4_0_PPC_COMPAT preprocessor symbol when building for the PowerPC architecture. Defining this symbol allows you to use the Mac OS X 10.4u (Universal) SDK for both PowerPC and Intel architectures.
For more details on building a universal binary version of your driver, including Xcode project settings, see Technical Note TN2163: Building Universal I/O Kit Drivers.
Note: For general guidance on debugging drivers, including the universal binary version of a device driver running on an Intel-based Macintosh computer, see “Debugging Drivers” and Hello Debugger: Debugging a Device Driver With GDB.
Byte Swapping
Handling Architectural Differences
Viewing Values in the Device Tree Plane
Interrupt Sharing in an Intel-Based Macintosh
Using the OSSynchronizeIO Function
Accessing I/O Space
Debugging on an Intel-Based Macintosh
Last updated: 2007-03-06