Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Device Driver Tutorial
Previous Next

Overview of the Template Driver Example

This example guides you through the following steps:

  1. Create a directory where you can develop your driver and open a new text file named dummy.c.

  2. Write the entry points for loadable module configuration: _init(9E), _info(9E), and _fini(9E).

  3. Write the entry points for autoconfiguration: attach(9E), detach(9E), getinfo(9E), and prop_op(9E).

  4. Write the entry points for user context: open(9E), close(9E), read(9E), and write(9E).

  5. Define the data structures: the character and block operations structure cb_ops(9S), the device operations structure dev_ops(9S), and the module linkage structures modldrv(9S) and modlinkage(9S).

  6. Create the driver configuration file dummy.conf.

  7. Build and install the driver.

  8. Test the driver by loading the driver, reading from and writing to the device node, and unloading the driver.

The entry points that are to be created in this example are shown in the following diagram.

Figure 2-1 Entry Points for the dummy Example
Diagram shows the entry points that are to be created in the dummy examples.
Previous Next

 
 
  Published under the terms fo the Public Documentation License Version 1.01. Design by Interspire