Two steps to porting the Android system

Source: Internet
Author: User

The main purpose of porting the Android system is to run the Android system on specific hardware. In the process of transplantation, an important aspect is to grasp the key points and reduce the workload. From the perspective of work, you must first be familiar with the interface of the hardware abstraction layer, and then integrate and reuse existing drivers. The main workload is in the implementation of the hardware abstraction layer. In order to better understand and debug the system, you should also properly understand the upper-layer calls to the hardware abstraction layer.

There are two main steps for porting:

Linux driver

Android hardware abstraction layer

The drivers in Linux work in the kernel space, and the hardware abstraction layer of Android systems work in the user space. With the combination of these two parts, this allows a large Android system to run on a specific hardware platform.

As shown in figure 1.

  

Figure 1 main tasks of Android porting

After a specific hardware system is available, it is usually necessary to implement its drivers in Linux. These drivers are usually standard drivers in Linux, the Android platform and other Linux platforms are basically the same. The main implementation is the hardware abstraction layer (hardwareabstract layer) in the Android system. The hardware abstraction layer calls the driver program in Linux and provides interfaces to the hardware abstraction layer, for other parts of the Android system (usually the android local framework layer) to call.

Tip: the Android hardware abstraction layer interface is a local port layer interface. It is not a standard API and does not have forward or backward compatibility.

The content to be transplanted in the Android system mainly includes the following parts:

Display)

Including framebuffer driver + gralloc module (optional)

User input)

Including event driver + eventhub (android standard content)

Multimedia Codec)

Including hardware codec driver + codec plug-in (such as openmax)

3D accelerator)

Including hardware OpenGL driver + OpenGL plug-in

Audio part (audio)

Including the audio driver + audio Hardware Abstraction Layer

Video out)

Including video display driver + overlay Hardware Abstraction Layer

Camera (CAMERA)

Including the camera driver (usually v4l2) + camera Hardware Abstraction Layer

Phone)

Modem driver + RIL Library

GPS)

Including GPS Driver (usually serial port) + GPS Hardware Abstraction Layer

Wireless LAN (WiFi)

Including WLAN driver and Protocol + WiFi adaptation layer (android standard content)

Bluetooth part (blue tooth)

Including BT driver and Protocol + bt adaptation layer (android standard content)

Sensor)

Includes the sensor driver and sensor hardware abstraction layer.

Vibrator part (vibrator)

Including vibrator driver + vibrator Hardware Abstraction Layer (android standard content)

Backlight (light)

Including light driver + light Hardware Abstraction Layer

Warning Device (alarm)

Including alarm driver and RTC system + user space call (android standard content)

Battery)

Hardware Abstraction Layer including battery driver and battery (android standard content)

Android has many components, but not every component needs to be transplanted. For some pure soft components, there is no need to transplant them. Some components, such as browser engines, require support from lower-Layer Networks, but do not directly port network interfaces for them. Instead, they use wireless LAN or telephone system data connection to complete standard network interfaces.

  Android porting can be divided into several main types: Basic graphical user interface (GUI), including the display part and user input part; and hardware-related acceleration part, including media codec and OpenGL; audio/Video Input/output, including audio, video output, and camera; connection, including wireless LAN, Bluetooth, GPS, telephone, and ancillary components, including sensors, backlights, and vibrator.

In addition to the above transplantation, power management is also a very important aspect, which has a relationship with various Android subsystems.

The Android system mainly needs to port part 2.

  

Figure 2 main components to be transplanted to the Android system

  For most subsystems, the hardware abstraction layer and driver must be implemented according to the actual system conditions, such as sensor, audio, video, camera, and telephone. There are also some subsystems. The hardware abstraction layer is standard. You only need to implement the drivers in the Linux kernel, such as the input, vibrator, wireless LAN, and Bluetooth. For systems with standard hardware abstraction layers, some configuration work is usually required.

Today, with the development of the Android system, it is not just a mobile device platform, it can also be used for consumer electronics and Smart appliances, such: netbooks, e-books, digital TVs, set-top boxes, and landlines. On these platforms, fewer components are usually required than mobile devices. In general, the basic user interface (including display and user input) needs to be transplanted, and other parts are optional. For example, telephone systems, vibrators, backlights, sensors, and other systems generally do not need to be implemented in non-mobile device systems. For some fixed-position devices, GPS systems are usually not required.

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.