diff options
author | Ruslan Piasetskyi <ruslan.piasetskyi@gmail.com> | 2017-07-11 09:49:32 -0700 |
---|---|---|
committer | Clay Murphy <claym@google.com> | 2017-07-11 14:09:17 -0700 |
commit | 7b7ac1c38b6987cc7a1f9f307bc6d099a470e76f (patch) | |
tree | b16206b32b153c3edb1744b655b1a3bfdeb7af91 /en/devices/architecture | |
parent | 4a5bcd6fa800faafbe7272d39266e21dc26edf39 (diff) | |
download | source.android.com-7b7ac1c38b6987cc7a1f9f307bc6d099a470e76f.tar.gz |
Docs: Changes to source.android.com
- 161541119 Updates to 7.1 CDD by gdimino <gdimino@google.com>
- 161436702 Update CTS downloads for 7.1 R7, 7.0 R11, 6.0 R20, 5.1 R21 by claym <claym@google.com>
- 161410924 Cloned from CL 160326297 by 'g4 patch'. by claym <claym@google.com>
- 161246895 Fix typo KM_TAG_USER_SECURE_ID by blamb <blamb@google.com>
- 161235192 Clarify guide is for platform, add note for app developers by claym <claym@google.com>
- 161217654 Fix typos in "bootloader" references by claym <claym@google.com>
- 161131051 SAC FB: Make verified boot flash lock and unlock commands... by daroberts <daroberts@google.com>
- 161106942 Remove Jack recommendation by claym <claym@google.com>
- 161102887 Correct typo in July 2017 bulletin by daroberts <daroberts@google.com>
- 161098528 Update build numbers for Jul security releases by Android Partner Docs <noreply@android.com>
- 161094346 Update July 2017 security bulletin with AOSP links by daroberts <daroberts@google.com>
- 161017723 Add warnings about incompatibility of FBE and adoptable s... by claym <claym@google.com>
- 160996093 Docs: Nav changes to prep for O + new framework image by hvm <hvm@google.com>
- 160984727 Devsite localized content from translation request 76cba1... by Android Partner Docs <noreply@android.com>
- 160984408 Add instructions to check for device security update by daroberts <daroberts@google.com>
- 160971202 July 2017 Security bulletin updates by daroberts <daroberts@google.com>
- 160958735 Update audit2allow commands by daroberts <daroberts@google.com>
- 160567793 Redirect old Dumpsys pages to DAC by claym <claym@google.com>
- 160553240 Devsite localized content from translation request 29dc8d... by Android Partner Docs <noreply@android.com>
- 160550105 Use a SHA-256 checksum, not a SHA-1 checksum, for the lat... by Android Partner Docs <noreply@android.com>
- 160448356 Add researcher attribution for CVE-2017-0574 by daroberts <daroberts@google.com>
- 160342125 Publish localized June security bulletin by daroberts <daroberts@google.com>
- 160293585 Devsite localized content from translation request 3cdce1... by Android Partner Docs <noreply@android.com>
- 160292361 Adds link to go/sac-guide at top of README for Googlers. by blamb <blamb@google.com>
- 160281439 Include a mention of --cbr in the using-repo docs. by Android Partner Docs <noreply@android.com>
PiperOrigin-RevId: 161541119
Change-Id: I24270f922ca979327303fd1776d90657095c57a4
Diffstat (limited to 'en/devices/architecture')
-rw-r--r-- | en/devices/architecture/hal.html | 140 | ||||
-rw-r--r-- | en/devices/architecture/images/ape_fwk_hal.png | bin | 0 -> 27793 bytes | |||
-rw-r--r-- | en/devices/architecture/images/treble_blog_after.png | bin | 0 -> 17812 bytes | |||
-rw-r--r-- | en/devices/architecture/images/treble_blog_before.png | bin | 0 -> 21476 bytes | |||
-rw-r--r-- | en/devices/architecture/index.html | 79 | ||||
-rw-r--r-- | en/devices/architecture/treble.html | 73 |
6 files changed, 292 insertions, 0 deletions
diff --git a/en/devices/architecture/hal.html b/en/devices/architecture/hal.html new file mode 100644 index 00000000..17ccea71 --- /dev/null +++ b/en/devices/architecture/hal.html @@ -0,0 +1,140 @@ +<html devsite> + <head> + <title>Hardware Abstraction Layer (HAL)</title> + <meta name="project_path" value="/_project.yaml" /> + <meta name="book_path" value="/_book.yaml" /> + </head> + <body> + <!-- + Copyright 2017 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + + + +<p>A HAL defines a standard interface for hardware vendors to implement, +which enables Android to be agnostic about lower-level driver implementations. +Using a HAL allows you to implement functionality without affecting or modifying +the higher level system. HAL implementations are packaged into modules and +loaded by the Android system at the appropriate time.</p> + +<img src="../images/ape_fwk_hal.png"> + +<p class="img-caption"><strong>Figure 1.</strong> HAL components</p> + +<p>You must implement the corresponding HAL (and driver) for the specific +hardware your product provides. HAL implementations are typically built into +shared library modules (<code>.so</code> files), but as Android does not mandate +a standard interaction between a HAL implementation and device drivers, you can +do what is best for your situation. However, to enable the Android system to +correctly interact with your hardware, you <strong>must</strong> abide by the +contract defined in each hardware-specific HAL interface.</p> + +<p>To guarantee that HALs have a predictable structure, each hardware-specific +HAL interface has properties defined in +<code>hardware/libhardware/include/hardware/hardware.h</code>. This interface +allows the Android system to load correct versions of your HAL modules in a +consistent way. A HAL interface consists of two components: modules and devices. +</p> + +<h2 id="hal-module">HAL modules</h2> +<p>A module represents your packaged HAL implementation, which is stored as a +shared library (<code>.so file</code>). The +<code>hardware/libhardware/include/hardware/hardware.h</code> header file +defines a struct (<code>hw_module_t</code>) that represents a module and +contains metadata such as the version, name, and author of the module. Android +uses this metadata to find and load the HAL module correctly.</p> + +<p>In addition, the <code>hw_module_t</code> struct contains a pointer to +another struct, <code>hw_module_methods_t</code>, that contains a pointer to +an open function for the module. This open function is used to initiate +communication with the hardware for which the HAL is serving as an abstraction. +Each hardware-specific HAL usually extends the generic <code>hw_module_t</code> +struct with additional information for that specific piece of hardware. For +example, in the camera HAL, the <code>camera_module_t</code> struct contains a +<code>hw_module_t</code> struct along with other camera-specific function +pointers:</p> + +<pre class="devsite-click-to-copy"> +typedef struct camera_module { + hw_module_t common; + int (*get_number_of_cameras)(void); + int (*get_camera_info)(int camera_id, struct camera_info *info); +} camera_module_t; +</pre> + +<p>When you implement a HAL and create the module struct, you must name it +<code>HAL_MODULE_INFO_SYM</code>. Example from the Nexus 9 audio HAL:</p> + +<pre class="devsite-click-to-copy"> +struct audio_module HAL_MODULE_INFO_SYM = { + .common = { + .tag = HARDWARE_MODULE_TAG, + .module_api_version = AUDIO_MODULE_API_VERSION_0_1, + .hal_api_version = HARDWARE_HAL_API_VERSION, + .id = AUDIO_HARDWARE_MODULE_ID, + .name = "NVIDIA Tegra Audio HAL", + .author = "The Android Open Source Project", + .methods = &hal_module_methods, + }, +}; +</pre> + +<h2 id="hal-device">HAL devices</h2> +<p>A device abstracts the hardware of your product. For example, an audio +module can contain a primary audio device, a USB audio device, or a Bluetooth +A2DP audio device.</p> + +<p>A device is represented by the <code>hw_device_t</code> struct. Similar to a +module, each type of device defines a detailed version of the generic +<code>hw_device_t</code> that contains function pointers for specific features +of the hardware. For example, the <code>audio_hw_device_t</code> struct type +contains function pointers to audio device operations:</p> + +<pre class="devsite-click-to-copy"> +struct audio_hw_device { + struct hw_device_t common; + + /** + * used by audio flinger to enumerate what devices are supported by + * each audio_hw_device implementation. + * + * Return value is a bitmask of 1 or more values of audio_devices_t + */ + uint32_t (*get_supported_devices)(const struct audio_hw_device *dev); + ... +}; +typedef struct audio_hw_device audio_hw_device_t; +</pre> + +<p>In addition to these standard properties, each hardware-specific HAL +interface can define more of its own features and requirements. For details, +see the <a href="/reference/hal/">HAL reference documentation</a> as well as +the individual instructions for each HAL.</p> + +<h2 id="hal-building">Building HAL modules</h2> +<p>HAL implementations are built into modules (<code>.so</code>) files and are +dynamically linked by Android when appropriate. You can build your modules by +creating <code>Android.mk</code> files for each of your HAL implementations +and pointing to your source files. In general, your shared libraries must be +named in a specific format so they can be found and loaded properly. The naming +scheme varies slightly from module to module, but follows the general pattern +of: <code><module_type>.<device_name></code>. +</p> + +<p>For details on setting up the build for each HAL, see the HAL-specific +documentation through the Porting section of this website.</p> + + </body> +</html> diff --git a/en/devices/architecture/images/ape_fwk_hal.png b/en/devices/architecture/images/ape_fwk_hal.png Binary files differnew file mode 100644 index 00000000..0b931194 --- /dev/null +++ b/en/devices/architecture/images/ape_fwk_hal.png diff --git a/en/devices/architecture/images/treble_blog_after.png b/en/devices/architecture/images/treble_blog_after.png Binary files differnew file mode 100644 index 00000000..c82bc0a5 --- /dev/null +++ b/en/devices/architecture/images/treble_blog_after.png diff --git a/en/devices/architecture/images/treble_blog_before.png b/en/devices/architecture/images/treble_blog_before.png Binary files differnew file mode 100644 index 00000000..47affe2e --- /dev/null +++ b/en/devices/architecture/images/treble_blog_before.png diff --git a/en/devices/architecture/index.html b/en/devices/architecture/index.html new file mode 100644 index 00000000..a4a415e3 --- /dev/null +++ b/en/devices/architecture/index.html @@ -0,0 +1,79 @@ +<html devsite> + <head> + <title>Architecture</title> + <meta name="project_path" value="/_project.yaml" /> + <meta name="book_path" value="/_book.yaml" /> + </head> + <body> + <!-- + Copyright 2017 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + + + +<p> +Android system architecture contains the following components: +</p> + +<img src="../images/ape_fwk_all.png"> + +<p class="img-caption"><strong>Figure 1.</strong> Android system architecture</p> + +<h2 id="application-framework">Application framework</h2> + +<p>The application framework is used most often by application developers. As a +hardware developer, you should be aware of developer APIs as many map directly +to the underlying HAL interfaces and can provide helpful information about +implementing drivers.</p> + +<h2 id="binder-ipc">Binder IPC</h2> +<p>The Binder Inter-Process Communication (IPC) mechanism allows the application +framework to cross process boundaries and call into the Android system services +code. This enables high level framework APIs to interact with Android system +services. At the application framework level, this communication is hidden from +the developer and things appear to "just work".</p> + +<h2 id="system-services">System services</h2> +<p>System services are modular, focused components such as Window Manager, +Search Service, or Notification Manager. Functionality exposed by application +framework APIs communicates with system services to access the underlying +hardware. Android includes two groups of services: <em>system</em> (such as +Window Manager and Notification Manager) and <em>media</em> (services involved +in playing and recording media).</p> + +<h2 id="hal">Hardware abstraction layer (HAL)</h2> +<p>A HAL defines a standard interface for hardware vendors to implement, +which enables Android to be agnostic about lower-level driver implementations. +Using a HAL allows you to implement functionality without affecting or modifying +the higher level system. HAL implementations are packaged into modules and +loaded by the Android system at the appropriate time. For details, see +<a href="/devices/architecture/hal.html">Hardware Abstraction Layer (HAL)</a>. +</p> + +<h2 id="Linux-kernel">Linux kernel</h2> +<p>Developing your device drivers is similar to developing a typical Linux +device driver. Android uses a version of the Linux kernel with a few special +additions such as wake locks (a memory management system that is more aggressive +in preserving memory), the Binder IPC driver, and other features important for a +mobile embedded platform. These additions are primarily for system functionality +and do not affect driver development.</p> + +<p>You can use any version of the kernel as long as it supports the required +features (such as the binder driver). However, we recommend using the latest +version of the Android kernel. For details, see +<a href="/source/building-kernels.html">Building Kernels</a>.</p> + + </body> +</html> diff --git a/en/devices/architecture/treble.html b/en/devices/architecture/treble.html new file mode 100644 index 00000000..343858df --- /dev/null +++ b/en/devices/architecture/treble.html @@ -0,0 +1,73 @@ +<html devsite> + <head> + <title>Treble</title> + <meta name="project_path" value="/_project.yaml" /> + <meta name="book_path" value="/_book.yaml" /> + </head> + <body> + <!-- + Copyright 2017 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + + +<p>The upcoming Android O release includes Project Treble, a major re-architect +of the Android OS framework designed to make it easier, faster, and less costly +for manufacturers to update devices to a new version of Android.</p> + +<h2 id=about-treble>Android updates</h2> +<p>Project Treble separates the vendor implementation (device-specific, +lower-level software written by silicon manufacturers) from the Android OS +framework via a new vendor interface.</p> + +<p>In Android 7.x and earlier, no formal vendor interface exists so device +makers must update large portions of the Android code to move a device to a +newer version of Android:</p> + +<img src="images/treble_blog_before.png"> + +<p class="img-caption"><strong>Figure 1.</strong> Pre-Treble Android update +environment</p> + +<p>With Treble, a new stable vendor interface provides access to the +hardware-specific parts of Android, enabling device makers to deliver new +Android releases simply by updating the Android OS framework—without any +additional work required from the silicon manufacturers:</p> + +<img src="images/treble_blog_after.png"> + +<p class="img-caption"><strong>Figure 2.</strong> Treble Android update +environment</p> + +<h2 id=testing-treble>Testing Treble</h2> +<p>To ensure forward compatibility of the vendor implementation, the new vendor +interface will be validated by the Vendor Test Suite (VTS), which is analogous +to the <a href="/compatibility/cts/">Compatibility Test Suite (CTS)</a>. VTS is +already launched and can be used to automate HAL and OS kernel testing even in +pre-Treble environments; for details, see +<a href="/devices/tech/test_infra/tradefed/fundamentals/vts">Systems Testing +With VTS</a>.</p> + +<h2 id=launching-treble>Coming soon</h2> +<p>Project Treble is coming to all new devices launching with Android O and +beyond, and the new architecture is already running on the Developer Preview of +O for Pixel phones. When Android O launches, we'll have full details here (on +<a href="https://source.android.com/">source.android.com</a>). In the interim, +you can find more details on Treble over at the +<a href="https://android-developers.googleblog.com/2017/05/here-comes-treble-modular-base-for.html">Android +Developers Blog</a>.</p> + + + </body> +</html> |