Knowledge of Linux Drivers
Operating system through a variety of drivers rely on home and hardware devices, it has shielded a variety of devices for users, drive hardware is the most basic function of the operating system, and provide a unified operation. Device drivers are one of the most basic components of the operating system and are more than 60% in the Linux kernel source program, so familiarity with driver writing is important.
The Linux system maps each driver into a single file. These files are referred to as device files or driver files and are present in the/dev directory. Thus, in the application's view, the hardware device is just a device file, and the application can operate the hardware device as if it were a normal file, which greatly facilitates the processing of the device.
Steps to write a driver:
(1) Build Linux driver skeleton (load and unload Linux drivers) any type of program has a basic structure, and Linux drivers are no exception. The Linux kernel needs to load the driver first when it uses the driver. Some initialization work is also required during the loading process.
(2) Registration and cancellation of equipment files
Any Linux driver requires a device file, or the application will not be able to interact with the driver.
(3) Specify driver-related information
The driver is self-describing.
(4) Specifying a callback function
A driver does not necessarily specify all of the callback functions.
(5) Writing business logic
(6) Writing makefile files
(7) Writing Linux drivers
(8) Installing and uninstalling Linux drivers
http://www.cnblogs.com/cherry-blossom/
Knowledge of Linux Drivers