Android Deep Explore (Volume one) HAL and Driver Development chapter Sixth

Source: Internet
Author: User

By learning Android Deep Exploration (Volume one) HAL and Driver Development Chapter Sixth let me understand the complete process of developing and testing Linux drivers for counting the number of words.

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. Since most Linux drivers have their corresponding device files, exchanging data with the Linux driver becomes the exchange of data with the device files.

To write a Linux driver: The first step is to build the Linux driver skeleton (load and unload Linux drivers); second, register and unregister the device files; The third step, specify the information related to the driver; fourth, specify the callback function, fifth step, write the business logic, sixth step, Write the makefile file, seventh step, compile the Linux driver, step eighth, install and uninstall the Linux driver.

. config: This file is located in the top-level directory of the Linux kernel source code and is a hidden file that is used to configure modules in the Linux kernel.

Kconfig: This file is primarily used to define the menu that the make Menuconfig command displays, and in addition to importing Kconfig files located in other directories.

Makefile: Typically appears with the Kconfig file, which specifies how to compile the source code where the Makefile file resides.

To compile the driver into the Linux kernel for testing: The first step is to put the. c file into the Linux kernel source code; The second step is to modify the Kconfig file; The third step is to modify the makefile file; Fourth step, set the. config file, and fifth step, compile the Linux kernel.

To develop a Linux driver using eclipse: The first step is to build C project; The second step is to establish a C source code file link; The third step is to set the include path; fourth step, compile the Linux driver. Steps to test: The first step is to import. c files; The second step is to set the include path; the third step is to set the target; Fourth step, build project, fifth step, run the test program.

Android Deep Explore (Volume one) HAL and Driver Development chapter Sixth

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.