8.6. Chapter Summary This chapter presented a high-level overview of device driver basics and how they fit into the architecture of a Linux system. Armed with the basics, readers new to device drivers can jump into one of the excellent texts devoted to device driver writers. Consult Section 8.6.1 for references. Device drivers enforce a rational separation between unprivileged user applications and critical kernel resources such as hardware and other devices, and present a well-known unified interface to applications. The minimum infrastructure to load a device driver is only a few lines of code. We presented this minimum infrastructure and built on the concepts to a simple shell of a driver module. Device drivers configured as loadable modules can be inserted into and removed from a running kernel after kernel boot. Module utilities are used to manage the insertion, removal, and listing of device driver modules. We covered the details of the module utilities used for these functions. Device nodes on your file system provide the glue between your userspace application and the device driver. Driver methods implement the familiar open, read, write, and close functionality commonly found in UNIX/Linux device drivers. This mechanism was explained by example, including a simple user application to exercise these driver methods. We concluded this chapter with an introduction to the relationship between kernel device drivers and the Open Source GNU Public License. 8.6.1. Suggestions for Additional Reading Linux Device Drivers, 3rd Edition Alessandro Rubini and Jonathan Corbet O'Reilly Publishing, 2005 Filesystem Hierarchy Standard Edited by Rusty Russel, Daniel Quinlan, and Christopher Yeoh The File Systems Hierarchy Standards Group www.pathname.com/fhs/ Rusty's Linux Kernel Page Module Utilities for 2.6 Rusty Russell http://kernel.org/pub/linux/kernel/people/rusty/ |