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


  

Common Packaging of Loadable Software

Native device drivers are created as CFM fragments. Each CFM fragment exports a driver description structure that the system uses to locate, load, and initialize the driver. Previously, device drivers were created as Mac OS resources.

Hence native drivers are packaged differently from previous Mac OS drivers. Because they are CFM fragments, they have easy access to global data storage, and they can be written in a high-level language without assembly-language headers. Each instance of a single driver has private static data and shares code with every other instance of that driver. The CFM is responsible for maintaining the driver context (similar to the "A5 world" in previous Macintosh programming). A device driver no longer locates its private data by means of a field in its device unit table entry.

One consequence of drivers as CFM code fragments is that a single device driver no longer controls multiple devices. Normally there is an instance of the driver for each device, although only one copy of the driver's code is loaded into memory.


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