Sixth. First Linux driver: Count the number of words

Source: Internet
Author: User

Sixth. First Linux driver: Count the number of words

The sixth chapter describes how to test Linux drivers on multiple platforms using multiple methods.

This chapter is the implementation technology of the algorithm to count the number of words: Linux driver. The function of counting the number of words is encapsulated in the Linux driver. Drivers do not necessarily have to deal directly with the hardware, but also can drink the ordinary library to provide other program calls to achieve specific functions.

The first section of Linux drive what exactly is a thing

There is no intrinsic difference between Linux drivers and normal Linux APIs, except that the Linux-driven approach differs from the Linux API.

The Linux system maps each driver into a single file, which is called a device file or driver file, and is stored in the/dev directory. This design concept makes interacting with Linux drivers as easy as interacting with normal files, and easier than accessing Linux APIs.

Section II: Procedures for writing Linux drivers

    1. Build a Linux driver skeleton (load and unload Linux drivers).
    2. Registering and destroying equipment files.
    3. Specify driver-related information
    4. Specifying a callback function
    5. Writing business logic
    6. Writing makefile Files
    7. Compiling Linux Drivers
    8. Installing and uninstalling Linux drivers

The first five steps on how to write a Linux driver, the next three steps can make the Linux driver work correctly. At the same time these eight steps do not necessarily run sequentially, you can choose according to their own needs.

Section III the first Linux driver: Count the number of words

Preparation before writing a driver

Writing the skeleton of a Linux driver

Develop driver-related information

Registering and destroying equipment files

Make a callback function

An algorithm for implementing statistical word numbers

compiling, installing, and uninstalling Linux drivers

Fourth section testing Linux drivers in several ways

Testing Linux drivers with Ubuntu Linux

Test Linux drivers with native C programs on the Android emulator

Testing Linux drivers with the Android NDK

Use Java code to directly manipulate device files to test Linux drivers

Testing Linux drivers with the S3C6410 board

Compiling the driver into the Linux kernel for testing

Section fifth developing and testing Linux drivers using eclipse

Developing Linux drivers in eclipse

Testing Linux drivers in eclipse

Sixth. First Linux driver: 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: 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.