The first Linux driver query: Count the numbers of words
Steps to write a Linux driver
First step: Build Linux driver skeleton (load and unload Linux drivers)
Step two: Register and unregister the device files
You can create and remove device files using the Misc_register and Misc_deregister functions, respectively.
Step three: Specify driver-related information
Fourth Step: Refer to 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
- The Linux driver is compiled into the kernel, and as long as Linux is used by the kernel, the driver will automatically mount
- If the Linux driver exists separately in the module, you need to load the Linux driver module with the Ismod or Modprobe command, and use the Rmmod command to uninstall the Linux driver module.
- View log information for driver output: DMESG | grep Module Name | Tail-n 2
Open Source Agreement
- GPL Protocol 2.LGPL Protocol 3.BSD protocol 4.Apache Licence2.0 Protocol 5.MIT Protocol 6.MIT Protocol
Count the number of words
- Preparation before writing Linux drivers
- Writing the skeleton of a Linux driver
- Specify driver-related information
- Registering and unregistering device files
- Specifying a callback function
- An algorithm for implementing statistical word numbers
- compiling, installing, and uninstalling Linux drivers
Test Linux drivers in a variety of ways
1. Testing Linux drivers with Ubuntu Linux
2. Test the Linux driver with the native (Native) C program on the Android emulator
3. Testing Linux drivers with the Android NDK
4. Use Java code to directly manipulate device files to test Linux drivers
5. Testing Linux drivers with the SCS6410 board
The first Linux driver query: Count the numbers of words