Introduction to Mass Storage Device Driver Programming Guide

This document introduces the architecture of the mass storage driver stack and describes how to write in-kernel drivers for mass storage devices and media filter schemes for content on mass storage media. It includes sample code that illustrates how to develop both in-kernel logical unit and protocol services drivers and in-kernel filter-scheme drivers.

Because this book focuses on kernel-resident drivers for mass storage devices that mount file systems or are bootable, it provides only a brief description of application-based drivers for other mass storage devices, such as tape drives. For general information on how to write drivers for such devices, see Accessing Hardware From Applications.

Who Should Read This Document?

You should read this document if you need to support a mass storage device that mounts a file system or is bootable, or if you need to develop a filter-scheme driver.

Writing drivers for OS X requires the I/O Kit, Apple’s object-oriented framework for driver development. Although this document presents some information on selected I/O Kit principles to provide context for the implementation of the mass storage driver stack, it does not explain these concepts in detail. If you’re not familiar with the I/O Kit, you should read IOKit Fundamentals before reading this document.

In addition, if you’ve never written an in-kernel device driver for OS X, you should read IOKit Device Driver Design Guidelines to become familiar with driver fundamentals such as driver life cycle and driver matching and loading.

Organization of This Document

This document contains the following chapters:

See Also

The ADC Reference Library contains several documents on device driver development for OS X and numerous sample drivers and applications.

If you're ready to create a universal binary version of your device driver or filter scheme to run in an Intel-based Macintosh, see Universal Binary Programming Guidelines, Second Edition. The Universal Binary Programming Guidelines describes the differences between the Intel and PowerPC architectures and provides tips for developing a universal binary.

The OS X mass storage stack supports mass storage devices that comply with the SCSI Architecture Model SCSI primary commands specification, declare peripheral device types of $00, $05, $07, or $0E, and connect to ATAPI, USB, or FireWire buses. In addition, a USB device must be compliant with the USB mass storage class specification and a FireWire device must be compliant with the FireWire Serial Bus Protocol 2 (SBP-2) specification. The following websites provide more information on these specifications: