⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bring_up.html

📁 Android Porting Guide
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>Android - Porting Guide</title><script src="http://www.google.com/uds/api?file=uds.js&amp;v=1.0&amp;key=internal-codesite" type="text/javascript"></script><script src="http://code.google.com/js/jquery.js" type="text/javascript"></script><script type="text/javascript">var _tocPath_ = 'http://code.google.com/android/_toc.ezt';</script><script src="http://code.google.com/js/codesite.pack.01312008.js" type="text/javascript"></script><script language="JavaScript">function resizeHeight() {	if(document.getElementById && !(document.all)) {		height= document.getElementById('doxygen').contentDocument.body.scrollHeight + 20;		document.getElementById('doxygen').style.height = height;	}	else if(document.all) {		height= document.frames('doxygen').document.body.scrollHeight + 20;		document.all.doxygen.style.height = height;	}}</script><link href="http://code.google.com/css/codesite.pack.01312008.css" type="text/css" rel="stylesheet"></link><!--[if IE]><link rel="stylesheet" type="text/css" href="/css/iehacks.css" /><![endif]--><script src="http://code.google.com/android/assets/search_autocomplete.js"></script><link rel="stylesheet" type="text/css" href="http://code.google.com/css/semantic_headers.css" /><link rel="stylesheet" type="text/css" href="http://code.google.com/android/assets/style.css" /><script>    jQuery(document).ready(function() {            jQuery("pre").addClass("prettyprint");        });    </script><style type="text/css"><!--h1,h2,h3 {	color: #000000;}--></style></head><body class="gc-documentation"><div id="gc-container"><a name="top"></a><div id="skipto"> </div><div id="langpref">  <!--<a class="dropdown" href="/">English</a> <span>|</span> <a href="/more/">Site Directory</a> --></div><div id="gc-header">  <div id="logo"><a href="http://code.google.com/android/index.html"><img src="http://code.google.com/android/images/logo_android.gif" alt="Android"/></a></div>  <div id="search" style="inline">    <div id="searchForm" class="searchForm" style="height: 44px;">      <!--previously form was here-->    </div>    <!-- end searchForm -->    <noscript>    <style type="text/css">      .searchForm {        display : none !important;      }      .searchForm2 {        display : inline !important;      }      </style>    </noscript>    <div id="searchForm2" class="searchForm2" style="display:none">      <form id="searchbox_001456098540849067467:6whlsytkdqg" action="http://www.google.com/cse">        <input type="hidden" name="cx" value="001456098540849067467:6whlsytkdqg" />        <input type="hidden" name="cof" value="FORID:0" />        <input type="text" name="q" maxlength="2048" size="41" autocomplete="off" title="Google Code Search"/>        <input type="submit" name="sa" value="Search" title="Search"/>        <br/>        <div class="greytext">e.g. "ajax apis" or "open source"</div>      </form>    </div>    <!-- end searchForm2 -->  </div>  <!-- end search --></div><!-- end gc-header --><div id="searchControl" class="search-control"></div><!--[if IE]><iframe id="backiFrame" name="backiFrame" src='/dummy.html' style="display:none"></iframe><![endif]--><div id="codesiteContent"><a name="gc-topnav-anchor"></a><div id="gc-topnav">  <h1>Android Platform Development Kit</h1>  <ul class="gc-topnav-tabs">    <li id="sdk_link"> <a href="http://code.google.com/android/index.html" title="Android Software Development Kit">SDK</a> </li>    <li id="docs_link"> <a href="index.html" title="Official Android documentation">Docs</a> </li>    <li id="faq_link"> <a href="http://code.google.com/android/kb/index.html" title="Answers to frequently asked questions about Android">FAQ</a> </li>    <li> <a href="http://android-developers.blogspot.com/" title="Official Android blog">Blog</a> </li>    <li> <a href="http://code.google.com/android/groups.html" title="Android developer forum">Group</a> </li>    <li> <a href="http://code.google.com/android/terms.html" title="Android terms of service">Terms</a> </li>    <li> <a href="mailto:android-pdk-feedback@google.com?subject=PDK%20Feedback&body=(filed%20from:%20bring_up.html%20v0.6%20-%2025%20November%202008)%0D%0A%0D%0ASUMMARY:%0D%0A%0D%0A%0D%0A%0D%0ASTEPS%20TO%20REPRODUCE:%0D%0A%0D%0A%0D%0A%0D%0AADDITIONAL%20NOTES:">Report a Problem</a> </li>  </ul></div><!-- end gc-topnav --><div class="g-section g-tpl-180"><a name="gc-toc"></a><div class="g-unit g-first" id="gc-toc">  <ul>    <li>      <h1><a href="index.html">Documentation</a></h1>      <ul>        <li> <strong>Introduction</strong>          <ul>            <li><a href="system_requirements.html">Device Requirements</a></li>                      </ul>        </li>        <li> <strong>Dev Environment Setup</strong>          <ul>            <li><a href="build_system.html">Build System</a></li>          </ul>        </li>        <li> <strong>Basic Bring up</strong>          <ul>            <li><a href="build_new_device.html">Building New Device</a></li>            <li><a href="bring_up.html">Bring up</a></li>            <li><a href="keymaps_keyboard_input.html">Keymaps and Keyboard</a></li>            <li><a href="display_drivers.html">Display Drivers</a></li>          </ul>        </li>        <li> <strong>Multimedia</strong>          <ul>            <li><a href="audio_sub_system.html">Audio</a></li>            <li><a href="camera.html">Camera</a></li>			          </ul>        </li>        <li> <strong>Power Management</strong>          <ul>            <li><a href="power_management.html">Power Management</a></li>          </ul>        </li>        <li> <strong>Networking</strong>          <ul>            <li><a href="wifi.html">Wi-Fi</a></li>            <li><a href="gps.html">GPS</a></li>            <li><a href="bluetooth.html">Bluetooth</a></li>          </ul>        </li>        <li> <strong>Telephony</strong>          <ul>            <li><a href="telephony.html">Radio Interface Layer</a></li>          </ul>        </li>        <li> <strong>Testing</strong>          <ul>            <li><a href="instrumentation_testing.html">Instrumentation Testing</a></li>          </ul>        </li>      </ul>    </li>  </ul></div><a name="gc-pagecontent"></a><div class="g-unit" id="gc-pagecontent"><div id="jd-content"><div class="jd-descr"><a name="androidOHDPortingDeviceBringup"></a><h1>Bring Up</h1><p>Once your code is built and you have verified that all necessary directories exist, power on and test your device with basic bring up, as described below. Bring up tests are typically designed to stress certain aspects of your system and allow you to characterize the device's behavior. </p><p>&nbsp;</p><h3>1. Confirm a Clean Installation of a Basic Linux Kernel </h3><p>Before considering Android-specific modifications to the Linux kernel, verify that you can build, deploy, and boot a core Linux kernel on your target hardware. </p><p>&nbsp;</p><h3>2. Modify Your Kernel Configuration to Accommodate Android Drivers</h3><p>Your kernel configuration file should include the following:</p><pre class="prettyprint">## Android## CONFIG_ANDROID_GADGET is not set# CONFIG_ANDROID_RAM_CONSOLE is not setCONFIG_ANDROID_POWER=yCONFIG_ANDROID_POWER_STAT=yCONFIG_ANDROID_LOGGER=y# CONFIG_ANDROID_TIMED_GPIO is not setCONFIG_ANDROID_BINDER_IPC=y</pre><h3>3. Write Drivers</h3><p>Android ships with default drivers for all basic functionality but you'll likely want to write your own drivers (or at least customize the default drivers) for your own device depending on your hardware configuration. See the following topics for examples of how to write your own drivers. </p><ul>  <li><a href="audio_subsystem.html">Audio</a></li>  <li><a href="keymaps_keyboard_input.html">Keymaps and Keyboard</a></li>  <li><a href="display_drivers.html">Display</a></li></ul><p>&nbsp;</p><h3>4. Burn Images to Flash</h3><p>An image represents the state of a system or part of a system  stored in non-volatile memory. The build process should produce the following system images:</p><ul>  <li><strong>bootloader</strong>: The bootloader is a small program responsible for initiating loading of the operating system. </li>  <li><strong>boot</strong>: </li>  <li><strong>recovery</strong>: </li>  <li><strong>system</strong>: The system image stores a snapshot of the Android operating system.</li>  <li><strong>data</strong>: The data image stores user data. Anything not saved to the <code>device/data</code> directory will be lost on reboot.</li></ul><ul>  <li><strong>kernel</strong>: The kernel represents the most basic element of an operating system. Android's Linux kernel is responsible for managing the system's resources and acts as an abstraction layer between hardware and a system's applications. </li>  <li><strong>ramdisk</strong>: RAMdisk defines a portion of Random Access Memory (RAM) that gets used as if it were a hard drive. </li></ul><p>&nbsp;</p><p>Configure the bootloader to load the kernel 	and RAMdisk into RAM and pass the RAMdisk address to the kernel on 	startup. </p><p>&nbsp;</p><h3>5. Boot the kernel and mount the RAMdisk.</h3><p>&nbsp;</p><h3>6. Debug Android-specific init programs on RAMdisk</h3><p>Android-specific init programs are found in <code>device/system/init</code>. Add LOG messages to help you debug potential problems with the LOG macro defined in <code>device/system/init/init.c</code>.</p><p> The init program directly mounts all filesystems and devices using either hard-coded file names or device names generated by probing the sysfs filesystem (thereby eliminating the need for a <code>/etc/fstab</code> file in Android).  After <code>device/system</code> files are mounted, init  reads <code>/etc/init.rc</code> and invokes the programs listed there (one of the first of which is the 	console shell).</p><p>&nbsp;</p><h3>7. Verify that applications have started </h3><p>Once the shell becomes available, execute <code>% ps</code> to confirm that the following applications are running:</p><ul>    <li><code>/system/bin/logd</code></li>    <li><code>/sbin/adbd</code></li>    <li><code>/system/bin/usbd</code></li>    <li><code>/system/bin/debuggerd</code></li>    <li><code>/system/bin/rild</code></li>    <li><code>/system/bin/app_process</code></li>    <li><code>/system/bin/runtime</code></li>    <li><code>/system/bin/dbus-daemon</code></li>    <li><code>system_server</code></li></ul><p>Each of these applications is embedded Linux C/C++ and you can use any standard Linux debugging tool to troubleshoot applications that aren't running. Execute <code>% make showcommands</code> to determine precise build commands. <code>gdbserver</code> (the GNU debugger) is available in the <code>bin</code> directory of the system partition (please see <a href="http://sourceware.org/gdb/">http://sourceware.org/gdb/</a> for more information).  </p><p>&nbsp;</p><h3>8. Pulling it all together </h3><p>If bring up was successful, you should see the following Java applications (with icons) visible on the LCD panel:</p><ul>    <li>com.google.android.phone: The Android contact application. </li>    <li>com.google.android.home</li>    <li>android.process.google.content</li></ul><p>If they are not visible or unresponsive to keypad control, run the <code>framebuffer/keypad</code> tests.</p><a name="androidInitLanguage"></a><h1>Android Init Language</h1><p>The Android Init Language consists of four broad classes of statements:</p><ul>  <li>Actionn</li>  <li>Commands</li>  <li>Services</li>  <li>Options</li></ul><p>The language syntax includes the following conventions: </p><ul>  <li>All classes are line-oriented and consist of tokens separated by whitespace. c-style backslash escapes may be used to insert whitespace into a token. &nbsp;Double quotes may also be used to prevent whitespace from breaking text into multiple tokens. A backslash <br />  appearing as the last character on a line is used for line-folding.</li>  <li> Lines that start with a # (leading whitespace allowed) are comments.</li>  <li>Actions and Services implicitly declare new sections. All commands    or options belong to the section most recently declared. &nbsp;Commands    or options before the first section are ignored.  </li>  <li>Actions and Services have unique names. &nbsp;If a second Action or Service is declared with the same name as an existing one, it is ignored as an error.</li></ul><p>  Actions</p><p> Actions are named sequences of commands. Actions have a trigger used to determine when the action should occur. When an event  occurs which matches an action's trigger, that action is added to  the tail of a to-be-executed queue (unless it is already on the  queue).<br />  <br />  Each action in the queue is dequeued in sequence. Each command in  an action is executed in sequence.&nbsp;Init handles other activities  (such as, device creation/destruction, property setting, process restarting) &quot;between&quot; the execution of the commands in activities.<p>Actions take the form of:</p><pre class="prettify">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -