Android Deep Exploration (Vol. 1) HAL and Driver Development Chapter 5-7

Source: Internet
Author: User

The 5th chapter: Build the test environment of s3c6.410 Development Board

The Development Board is the main hardware device for developing and learning embedded technologies, although Linux drivers can be developed on a PC and then recompiled into an ARM-architected Linux driver module. But in the end it's going to be tested on the Development Board. This is mainly because the ARM architecture of the board can be based on the X86 architecture of the PC in CPU instruction and binary format are different. And if the Linux driver needs to access hardware (such as LCD, wi-, Bluetooth, etc.) and these hardware is difficult to simulate on the PC, then it is necessary to debug and test on the Development Board with these hardware.

This chapter also mainly describes how to install the Serial debugging tool, burn the Android system, configure the limited network steps.

This chapter only describes how to install the droid on the Ok6410-a Development Board. Of course, we can choose a different board, or we can test the Linux driver directly on the phone. Different development boards and mobile phones to install the Andro ID method has a certain difference, all the meta-method introduced to all things e if the reader uses the hardware test book introduced in this book, you need to carefully read the appropriate official documentation to learn how to use these devices.

6th: The first Linux driver: Count the number of words

In this chapter, we mainly introduce a Linux driver, and give us an example of a Linux driver in a practical way.

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.

To write a Linux driver: 1. Build the Linu x drive skeleton (load and unload Linu x drive). 2.: Register and unregister the device files. 3. Specify driver-related information. 4. Specify the callback function. 5. Write the business logic. 6. Write the makefile file. 7. Compile the Linux driver. 8. Install and uninstall Linux drivers.

This chapter 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. To develop Linux drivers faster, you can also consider the ECLIPSE integrated development environment described in section 6.5.

7th: LED will blink for me: Control light-emitting secondary tube

This chapter completes a real Linux drive. The Linux driver is used to control 4 LED lights on the development version. That is, by sending data to the Linux driver, you can control the switch of the LED light. In order to address this driver conveniently, this book and later chapters refer to it as the LED driver.

Although the LED driver is not complicated, it only controls 4 LEDs, "but the LED driver has included all the necessary parts of the Linux drive a complete Linux drive consists mainly of internal processing and a reduced component with hardware interaction. The internal processing mainly refers to the Linux driver loading, unloading, and device file-related action processing (reading and writing device files, sending Νo commands to device files) and business logic. Interaction with hardware is mainly referred to through IOWRITE32,. The IOREAD32 function interacts with the registers in the hardware. -linux drive porting on different platforms is also handled in these two parts. If the transplant between different Lin muscle nuclei, mainly the 1th part of the transplant (Linux-driven internal processing, the general Linux kernel version of a large difference, the Linu fork ' core of the APl will be very different), if the migration on various hardware platforms, mainly transplant 2nd part.

Android Deep Exploration (Vol. 1) HAL and Driver Development Chapter 5-7

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.