Chapter 6 :
1. How to write Linux drivers:
(1): Build linux driver skeleton (load and unload Linux drivers)
(2): Registering and unregistering device files
(3): Specify driver-related information
(4): Specify callback function
(5): Writing business logic
(6): Write Makefile file
(7): Compiling Linux Drivers
(8): Install and uninstall Linux Drivers
2.Linux Drive test method:
(1). Use Ubuntu Linux Test Linux Drive
(2). test Linux drivers with the original (Native) C Program
(3). Use Android NDK Test Linux Drive
(4). Use Java code to directly manipulate device files to test Linux Drive
(5). using the DEV Board test Linux Drive:
using the executable program test on the Development Board Linux Drive
use on the Development Board . Android NDK test Linux driver
use on the Development Board Java Code Testing Linux Drive
(6). compile the driver into the Linux Kernel for testing
Section 1 step: Put the source file file into Linux Kernel source code
Section 2 Step: Modify Kconfig file
Section 3 Step: Modify Makefile file
Section 4 Step: Set . config file
Section 5 Step: Compile Linux Kernel
3. developing and testing Linux drivers using Eclipse
(1): Build C Project
(2): Establish C Source code file link
(3): Set include path
(4): Compiling Linux Drivers
After installing the CDT plug-in, Eclipse can either develop Java programs or develop common C + + programs.
Statistics of the number of wordsWord_countThe drive is the first complete bookLinuxDrive. AlthoughWord_countthe drive's functionality is not complex, but it's enough to make it ever contactLinuxdriver-driven developers understandLinuxthe complete development process of the drive. This chapter not only introduces an example, but also describes how to use different methods to testLinuxDrive. These methods are mainly differentiated by platform. For example, you can directly useUbuntulinuxTestLinuxDrive. There are a lot of drivers that only use the correspondingLinuxOnce the kernel is compiled, it can be installed directly on theAndroid,Linuxand other embedded systems. Of course, you can also directlyAndroidsimulators, boards and even mobile testsLinuxDrive.
"Android Deep Exploration" Vol. 1 sixth note 1314 Wang Ning