Accessing Hardware From Applications
PDF
Introduction
Hardware-Access Options
Other APIs That Provide Access to Hardware
Where to Go From Here
Device Access and the I/O Kit
I/O Kit Summary
I/O Kit Definitions
I/O Kit Driver-Stack Building
Device Interfaces and Device Files
Inside the Device-Interface Mechanism
Inside the Device-File Mechanism
Communicating With the I/O Kit
Finding and Accessing Devices
Finding Devices in the I/O Registry
Device Matching
Getting the I/O Kit Master Port
Getting Keys and Values for a Device-Matching Dictionary
Personality Property Keys and Values
Examining Driver Personality Information
Examining the I/O Registry
Setting Up a Matching Dictionary to Find Devices
Setting Up a Matching Dictionary to Find Device Files
Looking Up Devices in the I/O Registry
Getting Notifications of Device Arrival and Departure
Examining Matching Objects
Putting It All Together: Accessing a Device
Getting a Device Interface
Getting a Device-File Path
The IOKitLib API
Object Reference-Counting and Introspection
Reference Counting
Introspection
Device Discovery and Notification
Creating Matching Dictionaries
Looking Up Devices
Setting Up and Receiving Notifications
Iterating Over Matching Devices
I/O Registry Access
Traversing the I/O Registry
Getting Information About I/O Registry Objects
Viewing Properties of I/O Registry Objects
Setting Properties of I/O Registry Objects
Determining Busy States
Device-Interface Development
Creating a User Space–Kernel Connection
IOConnectMethod Functions
Memory-Mapping Functions
Managing the User Space–Kernel Connection
Handling Errors
Interpreting I/O Kit Error Return Values
Handling Exclusive-Access Errors
Appendix A: I/O Kit Family Device-Access Support
Revision History
Glossary
Index