IOHDDrive
Abstract: Generic Hard Disk Driver.
Storage drivers are split into two parts: the Generic Driver handles
all generic device issues, independent of the lower-level transport
mechanism (e.g. SCSI, ATA, USB, FireWire). All storage operations
at the Generic Driver level are translated into a series of generic
device operations. These operations are passed via the Device Nub
to a Transport Driver, which implements the appropriate
transport-dependent protocol to execute these operations.
To determine the write-protect state of a device (or media), for
example, the generic driver would issue a call to the
Transport Driver's reportWriteProtection method. If this were a SCSI
device, its Transport Driver would issue a Mode Sense command to
extract the write-protection status bit. The Transport Driver then
reports true or false to the generic driver.
The generic driver therefore has no knowledge of, or involvement
with, the actual commands and mechanisms used to communicate with
the device. It is expected that the generic driver will rarely, if
ever, need to be subclassed to handle device idiosyncrasies; rather,
the Transport Driver should be changed via overrides.
A generic driver could be subclassed to create a different type of
generic device. The generic driver IOCDDrive class is a subclass
of IOHDDrive, adding CD functions. Similarly, the Transport Driver
IOSCSICDDrive is a subclass of IOSCSIHDDrive, adding CD functions.
© 2000 Apple Computer, Inc. (Last Updated 2/23/2000)