Getting Started with Hardware & Drivers

Technology Overview

Apple's adoption of open standards and support for standard peripheral families yields opportunities for both hardware and device-driver developers.

Hardware developers can take advantage of standard high-performance interfaces to develop add-on or peripheral products that extend the capabilities of the Macintosh. Driver developers can use the I/O Kit, Apple's object-oriented driver-development framework, to create in-kernel or application-level drivers for their own or another vendor's devices. In addition, Mac OS X provides several services that allow applications to communicate with hardware from plug-ins, shared libraries, and other code running outside the kernel.

Start Here

Before you begin developing an add-on or peripheral device, you might want to familiarize yourself with the Apple hardware product lines and the I/O technologies they support. Start with Apple's Hardware and Support websites to get an overview of Apple products, technology specifications, service, and training. Apple’s Hardware & Drivers website provides links to helpful hardware and driver topics, references, and downloads.

Before you begin developing code that accesses or communicates with hardware, read:

Choose a Learning Path

If you're a hardware developer, you want to understand Apple’s implementation of hardware interfaces, protocols, and standards to ensure compatibility and peak performance of your devices. Printer vendors and designers of consumer devices want to ensure compatibility with system software and applications.

If you're a software developer, you should first find out if you can use high-level APIs to access your device and avoid writing a device driver. If you do need to develop a device driver, you want to know whether your driver must be in the kernel or can be in an application. If you're a UNIX developer, you may want to know how to port your driver to Mac OS X.

Developing, Supporting, and Servicing Hardware

Apple provides documentation and resources to help you learn more about the system and identify opportunities for hardware development and support.

  • If you are designing add-on or peripheral devices, read the relevant hardware developer notes in Hardware & Drivers Reference Library. These notes are your main resource for information about the internal design of the system, its hardware-level input-output and expansion capabilities, and issues affecting compatibility.

  • If you are a printer vendor, you'll support your printer by creating a printer module for Mac OS X and providing a printing dialog extension for application-independent access to your printer’s features. Getting Started With Printing lists the resources you should read first. Also, be sure your printer supports Bonjour, Apple’s zero-configuration networking solution.

  • If you’re interested in peripheral device installation or hardware diagnosis and repair, you can sign up for AppleCare Technician Training. Certification through this program also gives you access to Apple’s Service Source materials, including diagnostic tools and take-apart instructions.

Using High-Level APIs to Access Hardware

Many applications can handle all their hardware-access needs using high-level APIs that are available through Carbon and Cocoa. Unless you’re absolutely certain you need to develop a device driver, read the following to find out if there is an easier solution:

Determining Where Your Device Driver Needs to Reside

You know what type of device you need to communicate with, but you’re not sure which access strategy is best. Read the following to help you decide how to proceed:

Developing a Device Driver in an Application

You’ve determined that you can develop an application that communicates with or controls your device. The I/O Kit supports application-level device access with a mechanism called a device interface.

Developing a Device Driver in the Kernel

Developing a kernel-resident device driver is difficult at best and should be done only if there is no alternative. If you’ve determined that your device driver must reside in the kernel, you want to learn more about the kernel and how to program in it.

Porting a Device Driver from UNIX

If you’ve written a device driver for a UNIX environment and you want to learn how to port it to Mac OS X, read Porting UNIX/Linux Applications to Mac OS X for an overview of Mac OS X targeted at the UNIX developer. As a device-driver developer, you should read the Porting File and Device I/O chapter in particular.

Next Steps

The Hardware & Drivers Reference Library includes the following high-level resource pages of interest to hardware and device-driver developers. These pages can be bookmarked for easy access.

  • Guides

    Conceptual and how-to information for hardware and drivers.

  • Reference

    Focused, detailed descriptions in reference format for driver and device-access APIs, including API reference for specific device types and kernel and I/O Kit framework reference documentation.

  • Release Notes

    Late-breaking news and links to new documentation related to hardware issues, device drivers, and the Darwin kernel.

  • Sample Code

    Samples include in-kernel and application-level device drivers in addition to other applications that access hardware.

  • Technical Notes

    Supplementary documentation on specific hardware and device-access issues.

  • Technical Q&As

    Programming tips, code snippets, and FAQs supplied by Apple’s support engineers.

  • Mailing Lists

    The darwin-drivers mailing list is an excellent place to discuss hardware-access topics with other device-driver developers. To participate in discussions targeting the Darwin kernel in general, you can join the darwin-development mailing list. In addition, there are some mailing lists devoted to specific types of hardware, such as USB (usb) and Bluetooth (bluetooth-dev).

© 2004, 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-05-06)

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.