"Android Deep Exploration" Vol. 1 sixth note 1314 Wang Ning

Source: Internet
Author: User

Chapter 6 :

1. How to write Linux drivers:

(1): Build linux driver skeleton (load and unload Linux drivers)

(2): Registering and unregistering device files

(3): Specify driver-related information

(4): Specify callback function

(5): Writing business logic

(6): Write Makefile file

(7): Compiling Linux Drivers

(8): Install and uninstall Linux Drivers

2.Linux Drive test method:

(1). Use Ubuntu Linux Test Linux Drive

(2). test Linux drivers with the original (Native) C Program

(3). Use Android NDK Test Linux Drive

(4). Use Java code to directly manipulate device files to test Linux Drive

(5). using the DEV Board test Linux Drive:

using the executable program test on the Development Board Linux Drive

use on the Development Board . Android NDK test Linux driver

use on the Development Board Java Code Testing Linux Drive

(6). compile the driver into the Linux Kernel for testing

Section 1 step: Put the source file file into Linux Kernel source code

Section 2 Step: Modify Kconfig file

Section 3 Step: Modify Makefile file

Section 4 Step: Set . config file

Section 5 Step: Compile Linux Kernel

3. developing and testing Linux drivers using Eclipse

(1): Build C Project

(2): Establish C Source code file link

(3): Set include path

(4): Compiling Linux Drivers

After installing the CDT plug-in, Eclipse can either develop Java programs or develop common C + + programs.

Statistics of the number of wordsWord_countThe drive is the first complete bookLinuxDrive. AlthoughWord_countthe drive's functionality is not complex, but it's enough to make it ever contactLinuxdriver-driven developers understandLinuxthe complete development process of the drive. This chapter not only introduces an example, but also describes how to use different methods to testLinuxDrive. These methods are mainly differentiated by platform. For example, you can directly useUbuntulinuxTestLinuxDrive. There are a lot of drivers that only use the correspondingLinuxOnce the kernel is compiled, it can be installed directly on theAndroid,Linuxand other embedded systems. Of course, you can also directlyAndroidsimulators, boards and even mobile testsLinuxDrive.

"Android Deep Exploration" Vol. 1 sixth note 1314 Wang Ning

Related Article

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.