Linux drivers: Count the number of words

Source: Internet
Author: User

The function of counting the number of words is encapsulated in the Linux driver. The Linux system maps each driver into a single file. These files are called device files or drive files and are stored in the/dev directory. The steps for writing a Linux driver are as follows:

1. Build Linux drive skeleton (load and unload Linux drivers);

2, registration and cancellation of equipment documents;

3, specify the information related to the drive;

4, specify the function of the back-off;

5, write business logic;

6, the preparation of makefile documents;

7, compiling Linux driver;

8, install and uninstall Linux driver;

Count the number of words this driver does not have access to the hardware and interacts with the application using the device files as media. The application passes a space-delimited string to the file device (each substring separated by a space is called a word), and then reads from the device file the number of words that the string contains.

For a Linux driver, initial development and testing can be done on ubuntulinux at the outset. The part that accesses the hardware can be simulated with software in Ubuntulinux. When the basic development is finished, it is necessary to test the actual hardware on the Development Board or the engineering prototype. We can test Linux drivers in a variety of ways, primarily with ubuntulinux testing, testing Linux drives with native (native) C programs on the Android emulator, using ANDROIDNDK to test Linux drives, Use Java source code to directly manipulate the device files to test Linux drivers, test Linux drivers using the S3C6410 board, and compile the drivers into the Linux kernel for testing.

Linux drivers: Count the number 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.