Android Deep Exploration (Vol. 1) HAL and Driver Development Sixth Chapter summary

Source: Internet
Author: User

This chapter is mainly about Linux drivers. The first steps to writing a Linux driver are:

First step: Build Linux driver skeleton (load and unload Linux drivers)

Step two: Register and unregister the device file

Step three: Develop driver-related information

Fourth step: Specify the back-off function

Fifth step: Writing business logic

Sixth step: Writing the makefile file

Seventh step: Compiling Linux Drivers

Eighth Step: Install and Uninstall Linux Drivers

We then learned the first example of a Linux driver, that is, counting the number of words. A complete Linux driver specifies these driver-related information. It is generally necessary to Develop the following information for Linux drivers:

The module uses the module_author macro to specify

Module Description: Using the module_description macro to specify

Module aliases: Using the doudle_altas macro to specify

Open Source protocol: Use the moudle_license macro to specify

the configuration file for the Linux kernel core is as follows:

Config: linux The top-level directory of the kernel source code for hidden files. This file is used to configure the linux modules in the kernel. config linux driver is hosipital in three ways: compiling the driver module, writing the near-core, and from the linux kernel removal.

Fconig: This file is available for each module directory that you want to connect to the Linux kernel. This file is primarily used to define the menu displayed by the Makemenuconfig command, and in addition totheKconfig file, you can import Kconfig in other directories file.

Makeconfig: General and kconfig files appear at the same time. there must be a makeconfig file for each konfig file . The file is used to specify how to compile The source code for the directory where the makefile file is located.

To test the Linux driver steps:

First step: Import the test-word-count.c file

Step two: Set the include path

Step three: Establish taget

Fourth step:Build Project

Fifth step: Run the test program

http://home.cnblogs.com/u/zivjeli/

Android Deep Exploration (Vol. 1) HAL and Driver Development Sixth Chapter summary

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.