ANDROID Porting系列六、Bring Up
一旦你的程式碼是建立和您確認所有必要的目錄存在,如下所述實現上電測試您的裝置。Bring up tests通常強調你的系統某個方面,讓你來描述裝置的測試行為。
1。確認了一個基本的Linux核心全新安裝, 然後才考慮Android-specific修改Linux核心,驗證您可以構建,部署和目標硬體上啟動Linux kernel。
2。修改你的核心配置,以適應Android的驅動程式, 你的核心配置檔案應包括以下內容:
#
# Android
#
# CONFIG_ANDROID_GADGET is not set
# CONFIG_ANDROID_RAM_CONSOLE is not set
CONFIG_ANDROID_POWER=y
CONFIG_ANDROID_POWER_STAT=y
CONFIG_ANDROID_LOGGER=y
# CONFIG_ANDROID_TIMED_GPIO is not set
CONFIG_ANDROID_BINDER_IPC=y
3。寫驅動程式
Android附帶所有基本功能預設驅動程式,但你可能會希望編寫您自己的裝置取決於您的硬體配置您自己的驅動程式(或至少定製的預設驅動程式)。見下面的例子主題如何編寫自己的驅動程式。
·•音訊
·•鍵盤和鍵盤
·•顯示
4。燒Image到Flash
一個 image 代表了一個系統狀態或在non-volatile memory
•bootloader:引導載入程式是一個小程式的啟動作業系統的載入負責。
•boot:
•recovery:
•system:該系統圖像儲存的機器人作業系統的快照。
•data:影象資料儲存使用者資料。凡是不儲存到/資料目錄將在重新啟動時丟失的裝置。
•kernel:核心代表了一個作業系統最基本的要素。 Android的Linux核心負責管理本系統的資源,作為硬體和系統之間的應用軟體抽象層的行為負責。
•ramdisk:RAMDisk的定義了一組隨機存取儲存器(RAM的部分)的被使用,就好像它是一個硬碟驅動器。
在啟動時, 配置
5. 啟動核心並安裝RAMDisk.
6. 除錯Android-specific的RAMDisk的初始方案
Android-specific初始化方案可以在device/system/init。新增日誌資訊,以幫助您除錯定義device/system/init/init.c.的LOG巨集潛在的問題。
init程式直接安裝所有檔案系統和裝置的使用或硬編碼的檔名稱或探測的sysfs檔案系統(從而消除了一個/ etc / fstab檔案中的機器人需要生成的裝置名稱)。經過裝置/系統檔案被安裝後,init讀取的/ etc / init.rc並呼叫那裡的listed方案(其中第一個是console shell)。
7 驗證應用程式已開始
一旦殼可用時,執行%ps 確認下列正在執行的應用程式:
·/system/bin/logd
·/sbin/adbd
·/system/bin/usbd
·/system/bin/debuggerd
·/system/bin/rild
·/system/bin/app_process
·/system/bin/runtime
·/system/bin/dbus-daemon
·
system_server
這些應用程式的每一個嵌入式Linux的C / C + +,你可以使用任何標準的Linux除錯工具來解決應用程式沒有執行。% make的情況,以確定確切showcommands build命令。 gdbserver的(GNU偵錯程式),可在該系統分割槽(請seehttp bin目錄:/ / sourceware.org / / GDB中獲取更多資訊)。
8。pulling it all together
如果bring up成功,你應該看到下面的Java應用程式的圖示()上看到的液晶面板:
•com.google.android.phone:與Android應用相關。
•com.google.android.home
•android.process.google.content
如果他們不可見或不響應鍵盤控制,執行framebuffer/keypad測試。
And Android Language初始化
在Android的Init語言包括四個報表廣泛的類:
•Actionn
•Commands
•Services
•Options
該語言的語法包括以下公約:
•所有的類都行的,並用空格分隔標記組成。 C風格的反斜槓轉義可用於插入空白把一個記號。雙引號也可以用於防止分裂成多個標記文字的空白。一個反斜槓作為一個行的最後一個字元出現的用於分行。
•#表示行註釋,(允許空格)。
•隱式宣告的Actions and Services的新sections。所有的命令或選項屬於最近宣告部分。命令或之前第一部分將被忽略。
•Actions and Services 有唯一的名稱。如果第二個操作或服務是與作為一個現有的同名宣告,它將作為被忽略的一個錯誤。
Actions
Actions被命名的命令序列。用Actions來決定何時行動應該發生一個觸發器。當一個事件發生,以配合行動的觸發,該操作被新增到一個要被執行的佇列尾部(除非它已在佇列)。
佇列中的每個Action作出佇列順序。Actions中的每個命令按順序執行。Init 處理其他activities(device creation/destruction, property setting, process restarting)“與”在activities中的命令執行。
Actions採取下列形式:
on <trigger>
<command>
<command>
<command>
Services
Services 在init中啟動並(可配置)退出時重新啟動。
Services採取下列形式:
service <name> <pathname> [ <argument> ]*
<option>
<option>
...
Options
Options會影響執行時初始化service。
引數的說明如下表:
Option |
Description |
|
This service will not automatically start with its class. It must be explicitly started by name. |
|
Create a
unix domain socket named |
|
Change to username before exec'ing this service. Currently defaults to root. |
|
Change to
groupname before exec'ing this service. Additional groupnames
beyond the first, which is required, are used to set additional groups of the
process (with |
|
Set linux capability before exec'ing this service |
|
Do not restart the service when it exits. |
|
Specify a class name for the service. All services in a named class must start and stop together. A service is considered of class "default" if one is not specified via the class option. |
Triggers
Triggers是用於匹配的事件字串,促發某種action發生。
Trigger |
Description |
|
This is
the first trigger that occurs when init starts (after |
|
Triggers
of this form occur when the property |
|
Triggers of these forms occur when a device node is added or removed. |
|
Triggers of this form occur when the specified service exits. |
Commands
Command |
Description |
|
Fork and execute
a program ( |
|
Set the
environment variable |
|
Bring the
network interface |
|
Parse an init config file, extending the current configuration. |
|
Set the host name. |
|
Start all services of the specified class if they are not already running. |
|
Stop all services of the specified class if they are currently running. |
|
Set the domain name. |
|
Install
the module at |
|
Make a
directory at |
|
Attempt
to mount the named device at the directory |
|
- currenlty undefined - |
|
Set
system property |
|
Set the rlimit for a resource. |
|
Start a service running if it is not already running. |
|
Stop a service from running if it is currently running. |
|
Create a
symbolic link at |
|
Open the
file at |
Properties
Init更新一些系統屬性,以提供一些系統活動資訊::
Property |
Description |
|
Equal to the name of the action currently being executed or "" if none. |
|
Equal to the command being executed or "" if none. |
|
State of a named service ("stopped", "running", or "restarting"). |
例如init.conf
下面的程式碼段是一個不完整的init.conf檔案的例子,便是為了讓您瞭解什麼是正確的配置類似的想法.
on boot
export PATH /sbin:/system/sbin:/system/bin
export LD_LIBRARY_PATH /system/lib
mkdir /dev
mkdir /proc
mkdir /sys
mount tmpfs tmpfs /dev
mkdir /dev/pts
mkdir /dev/socket
mount devpts devpts /dev/pts
mount proc proc /proc
mount sysfs sysfs /sys
write /proc/cpu/alignment 4
ifup lo
hostname localhost
domainname localhost
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /data
import /system/etc/init.conf
class_start default
service adbd /sbin/adbd
user adb
group adb
service usbd /system/bin/usbd -r
user usbd
group usbd
socket usbd 666
service zygote /system/bin/app_process -Xzygote /system/bin --zygote
socket zygote 666
service runtime /system/bin/runtime
user system
group system
on device-added-/dev/compass
start akmd
on device-removed-/dev/compass
stop akmd
service akmd /sbin/akmd
disabled
user akmd
group akmd
相關推薦
ANDROID Porting系列六、Bring Up
一旦你的程式碼是建立和您確認所有必要的目錄存在,如下所述實現上電測試您的裝置。Bring up tests通常強調你的系統某個方面,讓你來描述裝置的測試行為。 1。確認了一個基本的Linux核心全新安裝, 然後才考慮Android-specific修改Lin
dubbo系列六、SPI擴展Filter隱式傳參
address style 分享圖片 github efi over tps com invoke 一、實現Filter接口 1、消費者過濾器:ConsumerTraceFilter.java package com.dubbo.demo.Filter; im
spring系列六、springboot配置錯誤頁面及全域性異常
一、spring1.x中處理方式 @Bean public EmbeddedServletContainerCustomizer containerCustomizer() { return new EmbeddedServletContainerCustomize
Android車載camera的除錯-Bring up(1)
來到新公司,各種不適應。跟老大和hr溝通後,最終決定留下。裡邊各中原因就不說了,留下後就得開始幹活啦:拿到的第一個case是車載環視camera的點亮,算是入門後的第一個小考驗吧: 我們認識實物的一個過程通常是從現象到本質,那第一個問題來了: 什麼是車載環視
Redis系列六、redis的五種資料結構和相關指令之Sorted Set
本節中將介紹Redis支援的主要資料結構,以及相關的常用Redis命令。redis是一種基於鍵值對(key-value)的記憶體資料庫,redis資料結構可以分為string、hash、list、set、sorted set。 redis的五種資料結構和相關指令
【Android Studio安裝部署系列】三十六、從Android Studio3.1.4升級到Android studio3.2【以及創建android p模擬器(未成功)】
tps min 比較 安裝 bsp mda 下載 initial uil 版權聲明:本文為HaiyuKing原創文章,轉載請註明出處! 概述 因為想要使用Android P模擬器,所以需要將Android Studio升級到3.2版本以上。 按照官網的說法:參考《ht
ANDROID STUDIO系列教程六--GRADLE多渠道打包
tor 等待 time() utf 腳本 manifest file resource 一個 由於國內Android市場眾多渠道,為了統計每個渠道的下載及其它數據統計,就需要我們針對每個渠道單獨打包,如果讓你打幾十個市場的包豈不煩死了,不過有了Gradle,這再也不是事了。
Silverlight & Blend動畫設計系列六:動畫技巧(Animation Techniques)之對象與路徑轉化、波感特效
繪制 name sof 圖形 基本 默認 nbsp getprop 都在 當我們在進行Silverlight & Blend進行動畫設計的過程中,可能需要設計出很多效果不一的圖形圖像出來作為動畫的基本組成元素。然而在設計過程中可能會出現許多的問題,比如當前繪制了一個
java內功系列六(泛型、異常、註解)
泛型: 1.泛型的出現主要解決了容器中元素放進去後直接變成了object型別。在編譯的時候如果傳入錯誤的元素將會出錯。 2.每次傳給泛型類、介面的型別引數不一樣相當於建立了一個新的類。list<string>和list以及list<int>是不一樣的型別。(邏輯上存在物理
[Android Framework] 8.1 Battery系列(六) 上次充滿電計算
Settings中獲取”上次充滿電”時間的程式碼如下: packages/apps/Settings/src/com/android/settings/fuelgauge/BatteryUtils.java public long calculateLastFullCha
C#遊戲程式設計:《控制檯小遊戲系列》之《六、貪吃蛇例項》
[csharp] view plaincopyprint? using System; using CEngine; using CGraphics; namespace Snake { /// <summary>
六、Android安全機制之NDK實現防鉤子簽名校驗
//對公鑰MD5後進行比對驗證 void MD5_Check(char *src) { char buff[3] = {'\0'}; char hex[33] = {'\0'}; unsigned char digest[MD5_DIGEST_LENGTH]; MD5_CTX ctx; MD5_Ini
[Android Studio系列(三)]Android Studio 編譯、同步慢的解決方法
1 問題 (1) 當專案中引用的第三方模組太多,開啟Android Studio的時候就會非常慢,提示一直在解決模組依賴,點選sync按鈕同步第三方程式碼的時候也是巨慢,慢的原因是: 在gradle中引用第三方模組時採用maven方式依賴,每次開啟An
Android開發系列(十一):對手機通訊錄的讀取、新增、刪除、查詢
一、通訊錄介紹 通訊錄是Android手機自帶的一個應用,它是一個ContentProvider應用,其它應用可以對通訊錄進行訪問,進行對聯絡人的CRUD操作。 二、通訊錄資料庫結構的介紹 首先,我們可以在File Explorer檢視下找到contacts2.db檔案,
經典演算法研究系列:六、教你初步瞭解KMP演算法、updated
教你初步瞭解KMP演算法作者: July 、saturnma、上善若水。 時間; 二零一一年一月一日-----------------------本文參考:資料結構(c語言版) 李雲清等編著、演算法導論引言:在文字編輯中,我們經常要在一段文字中某個特定的位置找出 某個
走近Flex元件系列(六):使用Form、FormHeading、FormItem佈局表單
轉自http://www.csharpwin.com/dotnetspace/3166.shtml 本篇主要介紹使用Form、FormHeading、FormItem這三個元件進行佈局表單介面,這三個元件使用非常簡單。本篇以佈局一個使用者登入介面為示例,如下程式碼片段:
六、 Android常見錯誤 (持續更新中……)
1、Unable to resolve target 'android-2' 安裝低版本的api,再default.properties這個檔案中把target=android-2改成 target=android-7終於就沒有問題了。 2、Invalid start tag LinearLayout
elasticsearch系列六:聚合分析(聚合分析簡介、指標聚合、桶聚合)
{ "took": 2059, "timed_out": false, "_shards": { "total": 58, "successful": 58, "skipped": 0, "failed": 0 }, "hits": { "total": 1015,
Android進階:六、在子線程中直接使用 Toast 及其原理
我的文章 public str toast 技術交流群 ui控件 及其 handle android進階 一般我們都把Toast當做一個UI控件在主線程顯示。但是有時候非想在子線程中顯示Toast,就會使用Handler切換到主線程顯示。 但是子線程中真的不能直接顯示Toa
六、regularized logisitic regssion練習(轉載)
method open lose hold on update import 等高線 algo 2個 轉載鏈接:http://www.cnblogs.com/tornadomeet/archive/2013/03/17/2964858.html 在上一講Deep learn