First Linux Driver

Source: Internet
Author: User

This chapter will be an example of learning the first Linux driver: Counting the number of words. The purpose of this example is not to explain how to count the number of words, but rather the implementation of the algorithm:Linux driver. 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. More advanced functionality is required to write the driver, which is the Linux -driven event, which is the callback function.

Learn the steps to write a linux driver. The first step: Build the Linux driver skeleton; Step two: Register and unregister the device files; step three: Specify the information related to the driver; Fourth: Specify the callback function, step Fifth: Write the business logic, and sixth: write the Makefile Seventh Step: Compiling Linux drivers; step eighth: Install and uninstall Linux drivers.

The following is a simple study of the instance, which does not have access to the hardware, but instead uses the device files as media to interact with the application. The application passes a space-delimited string to the device file, and then reads from the device file the number of words that the string contains.

Finally, there are a number of ways to test Linux drivers. For a linux driver, you can start Early development and testing on Ubuntu Linux, and when basic development is complete, you need to test on the development Board with real hardware This chapter describes testing Linux drivers on different platforms , including Ubuntu Linux,android Simulator and s3c6410 Development Board.

http://www.cnblogs.com/SJ-0325/

First Linux Driver

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.