Skip to Content
Sun and Oracle
Channel Sun
How to Buy
Log In
简体中文
docs.sun.com 主页
>
OpenSolaris Software Developer Collection
> Device Driver Tutorial
Device Driver Tutorial
只搜寻这本书
搜索帮助
包含在
OpenSolaris Software Developer Collection
Solaris Express Software Developer Collection
查找更多文档
浏览文档标题
浏览产品文档
专项支持资源
Sun 培训课程
BigAdmin 系统管理门户
Sun 支持中心
Sun Solve
以 PDF 格式下载本书 (1011 KB)
Device Driver Tutorial
Index
A
B
C
D
E
F
G
H
I
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Book Information
Preface
What's New
Who Should Use This Book
User Background
How This Book Is Organized
Related Books
Documentation, Support, and Training
Sun Welcomes Your Comments
Typographic Conventions
Shell Prompts in Command Examples
1. Introduction to Device Drivers
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 Sun Studio
Compiling with the GNU C Compiler
Installing a Driver
Adding, Updating, and Removing a Driver
Loading and Unloading a Driver
Testing a Driver
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
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
4. Tips for Developing Device Drivers
Device Driver Coding Tips
Device Driver Testing Tips
Device Driver Debugging and Tuning Tips
News Center
About Sun
Contact Sun
Terms of Use
Privacy
Copyright
1994-2009
Sun Microsystems, Inc.