Android Deep Explore--hal and driver development----The sixth chapter reading notes

Source: Internet
Author: User

Linux drivers have their own rules like other types of Linux programs, and here's a general procedure for writing basic Linux drivers:

(1) Build Linux- powered skeleton (load and unload Linux drivers);

(2) Registration and cancellation of equipment documents;

(3) Specify the information related to the drive;

(4) Specify the callback function;

(5) Writing business logic;

(6) Preparation of Makefile documents;

(7) Compiling Linux drivers;

(8) Install and uninstall Linux drivers.

For a Linux driver, you can start early development and testing on Ubuntu Linux. The hardware can also be simulated with software on Ubuntu Linux. When the basic development is complete, it is necessary to test the actual hardware on the Development Board or the engineering prototype. It will eventually need to be tested on the final sale of the phone.

To Add the Word_count directory to the Linux kernel source tree, follow these steps:

(1) Create a new Kconfig file, Create a Kconfig file in the Word_count directory , and enter the following:

Config Word_count

TriState "Word_count Driver"

Default Y

Help

This is a word count driver. It can get a word count from/dev/wordcount

(2) Modify the Makefile file

(3) Modify the Kconfig of the upper directory

SOURCE "Drivers/char/word_count/kconfig"

(4) Modify the Makefile file of the upper directory

obj-$ (conpig_word_count) + = word_count/

After modifying the Linux kernel settings and recompiling the kernel, Linux drivers that were previously compiled with the linux kernel may not be installed due to a malformed format, so after recompiling the Linux kernel, The Linux driver module needs to be recompiled . http://www.cnblogs.com/caoyutao/

Android Deep Explore--hal and driver development----The sixth chapter reading notes

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.