JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Device Driver Tutorial     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Introduction to Device Drivers

2.  Template Driver Example

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

Index

Chapter 3

Reading and Writing Data in Kernel Memory

In this chapter, you will extend the very simple prototype driver you developed in the previous chapter. The driver you will develop in this chapter displays data read from kernel memory. The first version of this driver writes data to a system log every time the driver is loaded. The second version of this driver displays data at user request. In the third version of this driver, the user can write new data to the device.