There is a clear distinction between device initialization and device opening. A device opening action is a connection-oriented response to client requests. Device drivers should expect to run with multiple Open and Close commands. This means that each driver is responsible for counting open requests from clients, and must not close itself until all clients have issued close requests. Initialization can occur independently of client requests--for example at startup time, or (in the case of PCMCIA devices) when a device is hot-swapped into or out of the system.
Initialization of native driver-controlled devices is handled in phases as described in the previous section. It is necessary to make a distinction here between PCI drivers and 68K drivers because the 68K driver initialization path has not changed.
The first phase of native driver initialization consists of searching the device portion of the Name Registry for boot devices. Boot device nodes should be flagged as kDriverIsLoadedUponDiscovery and kDriverIsOpenedUponLoad in the driver-descriptor property associated with the device node. The contents of the driver-descriptor property is a TheDriverDescription structure. Boot devices are loaded, initialized, and opened by the system. Their drivers, which must be in ROM, should be passive code controlled by the system starting up.
The second phase of startup comes after the Mac OS file system is available. In this second phase the Extensions folder is scanned for family experts, which are run as they are located. Their job is to locate and initialize all devices of their particular service category in the Name Registry. The family experts are initialized and run before their service category devices are initialized because the family expert extends the system facilities to provide services to their service category devices. For example, the Display Manager extends the system to provide VBL capabilities to 'disp' service category drivers. In the past, VBL services have been provided by the Slot Manager; but with native drivers, family-specific services such as VBL services move from being a part of bus software to being a part of family software.
A family expert, whether ROM based or disk based, scans the Name Registry for devices of a particular service category. Each device entered in the Registry with the specified service category is initialized and installed in the system in a family-specific way.
Note that startup steps 10 and 11 listed in PCI Boot Sequence initialize the Display Manager and the SCSI Manager. The Display Manager and SCSI Manager are both family experts. These are ROM-based experts that look for service category 'disp' ( 'ndrv' for current display devices) and service category 'blok' respectively. The SCSI Manager loads and activates PCI SIMs in the way described in Inside Macintosh: Devices and in SIMs for Current Versions of Mac OS. The Display Manager loads, initializes, and opens display devices. Disk-based experts perform exactly the same task as ROM-based experts, but disk-based experts are run after the file system is available. For more information about the Display Manager, see Display Device Driver Guide, listed in Apple Publications.