This chapter is mainly about Linux drivers. The first steps to writing a Linux driver are:
First step: Build Linux driver skeleton (load and unload Linux drivers)
Step two: Register and unregister the device file
Step three: Develop driver-related information
Fourth step: Specify the back-off function
Fifth step: Writing business logic
Sixth step: Writing the makefile file
Seventh step: Compiling Linux Drivers
Eighth Step: Install and Uninstall Linux Drivers
We then learned the first example of a Linux driver, that is, counting the number of words. A complete Linux driver specifies these driver-related information. It is generally necessary to Develop the following information for Linux drivers:
The module uses the module_author macro to specify
Module Description: Using the module_description macro to specify
Module aliases: Using the doudle_altas macro to specify
Open Source protocol: Use the moudle_license macro to specify
the configuration file for the Linux kernel core is as follows:
Config: linux The top-level directory of the kernel source code for hidden files. This file is used to configure the linux modules in the kernel. config linux driver is hosipital in three ways: compiling the driver module, writing the near-core, and from the linux kernel removal.
Fconig: This file is available for each module directory that you want to connect to the Linux kernel. This file is primarily used to define the menu displayed by the Makemenuconfig command, and in addition totheKconfig file, you can import Kconfig in other directories file.
Makeconfig: General and kconfig files appear at the same time. there must be a makeconfig file for each konfig file . The file is used to specify how to compile The source code for the directory where the makefile file is located.
To test the Linux driver steps:
First step: Import the test-word-count.c file
Step two: Set the include path
Step three: Establish taget
Fourth step:Build Project
Fifth step: Run the test program
http://home.cnblogs.com/u/zivjeli/
Android Deep Exploration (Vol. 1) HAL and Driver Development Sixth Chapter summary