Android Deep Exploration and Driver development (VI)

Source: Internet
Author: User

Linux-driven work and access is one of the highlights of Linux, and has been widely praised by the industry. The Linux system maps each driver into a single file. These files are called device files or drive files and are saved in the/dev directory. This design concept makes interacting with Linux drivers as easy as interacting with ordinary files. Of course, it's easier than visiting Linuxapi. Since most Linux drivers have their corresponding device files, exchanging data with the Linux driver becomes the exchange of data with the device files. For example, to send a print command to a Linux printer driver, you can open the device file directly using the C function open, and then make the hepatic C function ioctl send the Print command to the drive's device file.

The Word_count driver for counting the number of words is the implementation of a full Linux drive. Although the functionality of the Word_count driver is not complex, it is enough to allow the Linux driver to understand the full development process of Linux drives before it has ever been exposed. This chapter not only introduces an example, but also describes how to test Linux drivers using different methods. These methods are mainly differentiated by platform. For example, you can test Linux drivers directly using Ubuntu Linux. There are many drivers that can be installed directly on Android, Linux and other embedded systems as long as they are compiled with the corresponding Linux kernel. Of course, you can also test Linux drivers directly on the Android emulator, the Development Board, or even your phone.

Android Deep Exploration and Driver development (VI)

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.