The first Linux driver query: Count the numbers of words

Source: Internet
Author: User

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

    1. The Linux driver is compiled into the kernel, and as long as Linux is used by the kernel, the driver will automatically mount
    2. 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.
    3. View log information for driver output: DMESG | grep Module Name | Tail-n 2

Open Source Agreement

    1. GPL Protocol 2.LGPL Protocol 3.BSD protocol 4.Apache Licence2.0 Protocol 5.MIT Protocol 6.MIT Protocol

Count the number of words

    1. Preparation before writing Linux drivers
    2. Writing the skeleton of a Linux driver
    3. Specify driver-related information
    4. Registering and unregistering device files
    5. Specifying a callback function
    6. An algorithm for implementing statistical word numbers
    7. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.