PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

Native Driver Package

The driver model in the second generation of Power Macintosh defines a new driver packaging format. This package may contain generic drivers that have the generic driver call interface or may contain device family drivers that have call interfaces specific to the device family.

The Native Driver package is a CFM code fragment. It may reside in the Macintosh ROM, in an expansion ROM, or in the data fork of a file. File-based native driver code fragments contain no resource fork and have a file type of 'ndrv'. The DLL ignores the file's creator; by specifying a custom creator value registered with Apple, you can use this value to distinguish one driver from another. For a discussion of this technique, see Using NVRAM to Store Name Registry Properties.

The Native Driver package may house various types of drivers. The driver is expected to support services defined for the particular device family. One predefined driver type is a generic type and is called 'ndrv' (not to be confused with the Native Driver file type 'ndrv' ).

The Native Driver package requires that at least one symbol be defined and exported by the CFM's export mechanism. This symbol must be named TheDriverDescription ; it is a data structure that describes the driver's type, functionality, and characteristics.

Depending on the type of driver, additional symbols must be exported. The generic driver must export a single code entry point, DoDriverIO, which is passed to all driver I/O requests. DoDriverIO must respond to the kOpenCommand, kCloseCommand, kReadCommand, kWriteCommand, kControlCommand, kStatusCommand, kKillIOCommand, kInitializeCommand, kFinalizeCommand, kReplaceCommand, and kSupersededCommand commands. Native drivers must also keep track of I/O permissions for each instance of multiple open actions and return error codes if permissions are violated. Other driver types that support device families must export the symbols and entry points defined by the device family or device expert.

IMPORTANT

Native drivers must handle a new type of error return code, OSStatus. This data type is described in Error Returns.

Driver Description Structure

Driver Type Structure

Driver Run-Time Structure

Driver Services Structure

Driver Services Information Structure


© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)