Android Deep Explore (Volume 1) HAL with Driver development (total)

Source: Internet
Author: User
Tags version control system

Chapter One overview of Android system porting and driver development main talk about Android system architecture, The main work of Android system porting, view Linux kernel version,linux kernel version number definition rules, how to learn Linux driver development,Linux Typical examples of device drivers and Linux drivers:LEDs.

First Android is a very good embedded operating system, after several years of rapid development, has formed a linux c/c++ code library, Android  SDK api Android system porting the main work, mainly divided into application porting and system porting two parts. Of course, the transplant work says not much, say less also a lot, if want to transplant Android system to mention = linux2.6 is the most widely used version of the present, This version is used by Android.

So, how to learn linux driver development, because linux driving changes, so learn linux Span style= "font-family: the song Body;" > Driver development requires a real operating system to build linux Driven development environment, and under the system test linux drive. There are also gun C also learn linux A must-have technology to drive.

Knowing the above, I realized that learning Linux driver programming is important to understand that Linux drivers are only related to the Linux kernel, which is used by users Linux System-Independent. The only way to determine If the Linux kernel is the same is the linux kernel version number.

Chapter II set up the Android development environment mainly describes how to build the environment of Android bottom development, mainly including the Android application development environment, Android ndk Android Low-level development requires a lot of tools, such as Android sdk,android ndk and so on, build The Android application development environment is written and tested under linux android ndk cannot run as a Android application, so use Android ndk before developing the program, you must first install the android sdk

Then there is the installation of the cross-compilation environment, where the CPU of theX86 architecture uses a complex instruction set computer, and the ARM architecture CPU You are using a thin instruction set computer. Usually the cross compiler and related tools contain many executables and resources such as a large number of shared libraries and header files, which are called cross-compilation environments.

The Android development environment is configured primarily for the Ubuntu Linux environment. In a well-configured cross-compilation environment, you can write a simple C program to test this cross-compilation environment

First.c

#include <stdio.h>

Int Main ()

{

Printf ("First arm program\n");

Return 0;

}

Enter #arm-none-linux-qnueabi-gcc-static-o first first.c compile first.c file

Enter #adb push first/data/local to upload The first file to any Android device /data/lacal In the catalog

Using the adb shell command to enter the console of the Android device and into the /data/lacal directory, execution #./first will output " First armprogram "information. First Program in X86 schemas that run on the Ubuntu Linux cannot be run in the.

Chapter III Getting started with Git

At first you don't know what git is, read the introduction earlier in this chapter, and probably understand that git is a free, open source distributed version control system for agile and efficient processing of any or small or large project. Git is an open source distributed version control system for efficient, high-speed processing of project versioning from very small to very large. Git is an open source version control software developed by Linux Torvalds to help manage The development of the Linux kernel.

GitThe functional characteristicsThe main points are as follows: From the general developer's point of view,gitThe following features are available:1: Clones the database from the server onto a single machine. 2: Create a branch on your own machine and modify the code. 3: Commits the code on a branch that you create on a single machine. 4: Merge Branches on a single machine.5: Create a new branch to put the latest version of the code on the serverFetchdown, and then merge with your main branch. 6: GeneratePatch and send the patch to the main developer.7: Looking at the feedback from the main developer, if the main developer discovers that there is a conflict between the two general developers, they will be asked to resolve the conflict before being submitted by one of them. If the main developer can resolve it himself, or if there is no conflict, pass. 8: A method of resolving conflicts between the general developers, which can be used by developers Pullthe command resolves the conflict and then submits the patch to the main developer after the conflict is resolved.

The first thing to do is to install git, and you can use these commands like #apt-get intstall git to install directly, and then view the git documentation Next is the source code to commit and obtain, is to create the repository:git init and submit the file to the local repository:git commit, create a local branch: Git branch, switch local branch:git checkout and create an Open Source project on GitHub and more.

I think the editor said a sentence is very reasonable, the best way to learn new technology is not to read technical books, nor to view the articles written by others online, but directly read the code of interest. I will work hard in this area in the future.

Fourth chapter source code download and compile

This chapter android android The source code of the application in the system and Span style= "font-family:arial;" >android SDK The source code of the various tools and so on, of course, before we know these sources, the first thing we should do is configure android 4g android android The directory structure of the source code, you can download any part we want.

Next, is to compile our source code, because android Every project directory in the source code will have Span style= "font-family:arial;" >android.mk file, so compile the entire android android.mk file to compile the current project. The first step is to initialize the compilation environment, and the second step uses the lunch command to set the compilation target , the third step compiles android source code.

In fact, Android transplant is mainly the Linux kernel porting,linux kernel porting is mainly Linux -Driven porting. So in order to develop and drive, it is to build two sets of development environment:Android Application development environment and Linux kernel development environment.

Android Deep Explore (Volume 1) HAL with Driver development (total)

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.