Documentation Home
> Device Driver Tutorial
Device Driver Tutorial
Book Information
Index
A
B
C
D
E
F
G
H
I
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Preface
Chapter??1 Introduction to Device Drivers
Oracle Solaris Operating System Definition
Kernel Overview
Differences Between Kernel Modules and User Programs
Execution Differences Between Kernel Modules and User Programs
Structural Differences Between Kernel Modules and User Programs
Data Transfer Differences Between Kernel Modules and User Programs
User and Kernel Address Spaces on x86 and SPARC Machines
Device Drivers
Driver Directory Organization
Devices as Files
Devices Directories
Device Tree
Character and Block Devices
Device Names
Device Numbers
Development Environment and Tools
Writing a Driver
Writing a Driver Module
Writing a Configuration File
Building a Driver
Compiling with Oracle Solaris Studio
Compiling with the GNU C Compiler
Installing a Driver
Adding, Updating, and Removing a Driver
Loading and Unloading a Driver
Testing a Driver
Chapter??2 Template Driver Example
Overview of the Template Driver Example
Writing the Template Driver
Writing the Loadable Module Configuration Entry Points
Declaring the Loadable Module Configuration Entry Points
Defining the Module Initialization Entry Point
Defining the Module Information Entry Point
Defining the Module Unload Entry Point
Including Loadable Module Configuration Header Files
Writing the Autoconfiguration Entry Points
Declaring the Autoconfiguration Entry Points
Defining the Device Attach Entry Point
Defining the Device Detach Entry Point
Defining the Get Driver Information Entry Point
Defining the Report Driver Property Information Entry Point
Including Autoconfiguration Header Files
Writing the User Context Entry Points
Declaring the User Context Entry Points
Defining the Open Device Entry Point
Defining the Close Device Entry Point
Defining the Read Device Entry Point
Defining the Write Device Entry Point
Including User Context Header Files
Writing the Driver Data Structures
Defining the Character and Block Operations Structure
Defining the Device Operations Structure
Defining the Module Linkage Structures
Including Data Structures Header Files
Writing the Device Configuration File
Building and Installing the Template Driver
Testing the Template Driver
Adding the Template Driver
Reading and Writing the Device
Removing the Template Driver
Complete Template Driver Source
Chapter??3 Reading and Writing Data in Kernel Memory
Displaying Data Stored in Kernel Memory
Writing Quote Of The Day Version 1
Building, Installing, and Using Quote Of The Day Version??1
Displaying Data on Demand
Writing Quote Of The Day Version 2
Managing Device State
Initializing and Unloading
Attaching and Detaching
Opening the Device, Closing the Device, and Getting Module Information
Reading the Data
Checking Data Validity
Quote Of The Day Version 2 Source
Building, Installing, and Using Quote Of The Day Version??2
Modifying Data Stored in Kernel Memory
Writing Quote Of The Day Version 3
Attaching, Allocating Memory, and Initializing a Mutex and a Condition Variable
Checking for Changes, Cleaning Up, and Detaching
Allocating and Freeing Kernel Memory
Managing Thread Synchronization
Locking Rules for Quote Of The Day Version 3
Lock and Condition Variable Members of the State Structure
Creating and Destroying Locks and Condition Variables
Waiting on Signals
Writing New Data
Reporting and Setting Device Size and Re-initializing the Device
Quote Of The Day Version 3 Source
Building and Installing Quote Of The Day Version??3
Using Quote Of The Day Version 3
Reading the Device
Writing the Device
Exercising the Driver's I/O Controls
Chapter??4 Tips for Developing Device Drivers
Device Driver Coding Tips
Device Driver Testing Tips
Device Driver Debugging and Tuning Tips
© 2010, Oracle Corporation and/or its affiliates