Linux-driven work and access is one of the highlights of Linux, and has been widely praised by the industry. The Linux system maps each driver into a single file. These files are called device files or drive files.
To write a Linux driver:
First step: Build Linux driver skeleton (load and unload Linux drivers)
Step two: Register and unregister the device files
Step three: Specify driver-related information
Fourth step: Specify the callback function
Fifth step: Writing business logic
Sixth step: Writing the Makefile file
Seventh step: Compiling Linux drivers
Eighth Step: Install and uninstall Linux drivers
For a Linux driver, you can start early development and testing on Ubuntu Linux. The hardware can also be simulated with software on Ubuntu Linux.
To test the Linux driver steps using the s3c6410 Development Board:
First step: Test Linux drivers with executable programs on the S3C6410 board
Step two: Test Linux drivers on the s3c6410 Development Board using the Android NDK
Step three: Compile the driver into the Linux kernel for testing
In Ubuntu Linux, it is common to use VI or gedit to edit C + + source files. Other distributions in Linux are generally present in the vi text editor, and of course, you can also use any of your own favorite editor/C + + source code files.
This chapter not only introduces an example, but also describes how to test Linux drivers using different methods. These methods are mainly differentiated by platform.
Sixth chapter writing Linux drivers