|
IntroductionBuilding universal I/O Kit drivers is very similar to building universal applications, but there are critical differences that can affect a driver's binary compatibility. This technical note describes the steps for configuring an Xcode I/O Kit kernel driver project to produce a universal driver and discusses common binary compatibility problems with universal drivers. Which Xcode and Mac OS X SDK Versions to UseXcode 2.2.1 is the oldest version of Xcode that can be used to build universal I/O Kit drivers. Building for Intel-based Mac computersThe Intel side of your I/O Kit KEXT must be built using GCC 4.0 and the Mac OS X 10.4u (Universal) SDK found 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. Building for PowerPC-based Mac computersThe PowerPC side of your KEXT should be built using the Mac OS X SDK representing the oldest version of Mac OS X you wish to support. Building for PowerPC-based Mac computers: Targeting Versions of Mac OS X Earlier than 10.4Building for versions of Mac OS X prior to 10.4 also requires you to build using GCC 3.3. Building for PowerPC-based Mac computers: Targeting Mac OS X 10.4.x Using Xcode 2.2.x or Xcode 2.3When using Xcode 2.2.x or 2.3, I/O Kit drivers targeting Mac OS X 10.4.x on PowerPC-based systems must be built using the Mac OS X 10.4.0 (not Universal) SDK. This is different from universal applications where the 10.4u (Universal) SDK can be used on both architectures. The 10.4.0 SDK is available as a stand-alone installer from the Apple Developer Connection web site. A read me file is available for the SDK installer. The 10.4.0 SDK can also be installed from the Xcode 2.0 installer, located on the Mac OS X 10.4 install DVD. It can be found in the Xcode custom installs under Cross Development. Building for PowerPC-based Mac computers: Targeting Mac OS X 10.4.x Using Xcode 2.4 or LaterBeginning with Xcode 2.4 there is another option, which is to define the preprocessor symbol IMPORTANT: If you are using the class If your project is not configured properly you will see the error described later in Common Problems with Universal I/O Kit Drivers when you try to load your driver. Xcode Project Settings for a Universal I/O Kit Kernel DriverUsing the proper SDK and compiler versions is easily accomplished using Xcode's per-architecture build settings. To convert a PowerPC-only Xcode I/O Kit driver project to a universal project, first make sure that all targets in your project are native Xcode targets. You can check this by opening your project in Xcode, then select the Then, make the following changes to the Project or Target Build settings. Modify the Project settings if you want the settings to apply to all targets in the project. Modify the Target settings if you want just a particular target to produce a universal KEXT.
Common Problems with Universal I/O Kit DriversMost problems you'll encounter after building a universal driver will appear when loading it. For example, com.mycompany.driver.MyDriverClass is not compatible with its superclass, <superclass name> superclass changed? The reason for most load-time errors is that the wrong SDK was used when building the driver. For example, the PowerPC side of the driver is targeting Mac OS X 10.3.x but was built using the 10.4u SDK. Refer to the SDK version information shown earlier in Which Xcode and Mac OS X SDK Versions to Use. Then verify that your Xcode project is set up as described earlier in Xcode Project Settings for a Universal I/O Kit Kernel Driver. Document Revision History
Posted: 2006-11-10 | ||||||||||||||
|