『壹』 android kernel和標准linux kernel的區別
android kernel和標准linux kernel的區別
總的區別可以歸納如下:
ARCH -- 這是Android修改了arch/arm下面的一些文件:
arch/arm:
Chg: arch/arm/kernel/entry-armv.S
Chg: arch/arm/kernel/mole.c
Chg: arch/arm/kernel/process.c
Chg: arch/arm/kernel/ptrace.c
Chg: arch/arm/kernel/setup.c
Chg: arch/arm/kernel/signal.c
Chg: arch/arm/kernel/traps.c
Chg: arch/arm/mm/cache-v6.S
Chg: arch/arm/vfp/entry.S
Chg: arch/arm/vfp/vfp.h
Chg: arch/arm/vfp/vfphw.S
Chg: arch/arm/vfp/vfpmole.c
Goldfish -- 這是Android為了模擬器所開發的一個虛擬硬體平台。Goldfish執行arm926T指令(在2.6.29中,goldfish也支持ATMv7指令),但是在實際的設備中,該虛擬平台的文件不會被編譯。
arch/arm/mach-goldfish:
New: arch/arm/mach-goldfish/audio.c
New: arch/arm/mach-goldfish/board-goldfish.c
New: arch/arm/mach-goldfish/pdev_bus.c
New: arch/arm/mach-goldfish/pm.c
New: arch/arm/mach-goldfish/switch.c
New: arch/arm/mach-goldfish/timer.c
YAFFS2 -- 和PC把文件存儲在硬碟上不一樣, 移動設備一般把Flash作為存儲設備。尤其是NAND flash應用非常廣泛(絕大多數手機用的都是NAND flash,三星的一些手機使用的是OneNAND)。NAND flash具有低成本和高密度的優點。
YAFFS2 是「Yet Another Flash File System, 2nd edition" 的簡稱。 它提供在Linux內核和NAND flash設備 之前高效率的介面。 YAFFS2並沒有包含在標準的Linux內核中, Google把它添加到了Android的kernel
fs/yaffs2:
New: fs/yaffs2/devextras.h
New: fs/yaffs2/Kconfig
New: fs/yaffs2/Makefile
New: fs/yaffs2/moleconfig.h
New: fs/yaffs2/yaffs_checkptrw.c
New: fs/yaffs2/yaffs_checkptrw.h
New: fs/yaffs2/yaffs_ecc.c
New: fs/yaffs2/yaffs_ecc.h
New: fs/yaffs2/yaffs_fs.c
New: fs/yaffs2/yaffs_getblockinfo.h
New: fs/yaffs2/yaffs_guts.c
New: fs/yaffs2/yaffs_guts.h
New: fs/yaffs2/yaffsinterface.h
New: fs/yaffs2/yaffs_mtdif1.c
New: fs/yaffs2/yaffs_mtdif1.h
New: fs/yaffs2/yaffs_mtdif2.c
New: fs/yaffs2/yaffs_mtdif2.h
New: fs/yaffs2/yaffs_mtdif.c
New: fs/yaffs2/yaffs_mtdif.h
New: fs/yaffs2/yaffs_nand.c
New: fs/yaffs2/yaffs_nandemul2k.h
New: fs/yaffs2/yaffs_nand.h
New: fs/yaffs2/yaffs_packedtags1.c
New: fs/yaffs2/yaffs_packedtags1.h
New: fs/yaffs2/yaffs_packedtags2.c
New: fs/yaffs2/yaffs_packedtags2.h
New: fs/yaffs2/yaffs_qsort.c
New: fs/yaffs2/yaffs_qsort.h
New: fs/yaffs2/yaffs_tagscompat.c
New: fs/yaffs2/yaffs_tagscompat.h
New: fs/yaffs2/yaffs_tagsvalidity.c
New: fs/yaffs2/yaffs_tagsvalidity.h
New: fs/yaffs2/yportenv.h
Bluetooth -- Google為Bluetooth打上了patch,fix了一些Bluetooth的bug
drivers/bluetooth:
Chg: drivers/bluetooth/bfusb.c
Chg: drivers/bluetooth/bt3c_cs.c
Chg: drivers/bluetooth/btusb.c
Chg: drivers/bluetooth/hci_h4.c
Chg: drivers/bluetooth/hci_ll.c
Scheler -- 對於Scheler的改變非常小,我對它並沒有去研究。
Chg: kernel/sched.c
New Android Functionality -- 除了fix一些bug以及其他一些小的更改,Android增加了一些新的功能,介紹如下:
IPC Binder -- The IPC Binder is an Inter-Process Communication (IPC) mechanism. It allows processes to provide services to other processes via a set of higher-level APIs than are available in standard Linux. An Internet search indicated that the Binder concept originated at Be, Inc., and then made its way into Palm's software, before Google wrote a new Binder for Android.
New: drivers/staging/android/binder.c
Low Memory Killer -- Android adds a low-memory killer that, each time it's called, scans the list of running Linux processes, and kills one. It was not clear in our cursory examination why Android adds a low-memory killer on top of the already existing one in the standard Linux kernel.
New: drivers/staging/android/lowmemorykiller.c
Ashmem -- Ashmem is an Anonymous SHared MEMory system that adds interfaces so processes can share named blocks of memory. As an example, the system could use Ashmem to store icons, which multiple processes could then access when drawing their UI. The advantage of Ashmem over traditional Linux shared memory is that it provides a means for the kernel to reclaim these shared memory blocks if they are not currently in use. If a process then tries to access a shared memory block the kernel has freed, it will receive an error, and will then need to reallocate the block and reload the data.
New: mm/ashmem.c
RAM Console and Log Device -- To aid in debugging, Android adds the ability to store kernel log messages to a RAM buffer. Additionally, Android adds a separate logging mole so that user processes can read and write user log messages.
New: drivers/staging/android/ram_console.c
Android Debug Bridge -- Debugging embedded devices can best be described as challenging. To make debugging easier, Google created the Android Debug Bridge (ADB), which is a protocol that runs over a USB link between a hardware device running Android and a developer writing applications on a desktop PC.
drivers/usb/gadget:
New: drivers/usb/gadget/android.c
Chg: drivers/usb/gadget/composite.c
Chg: drivers/usb/gadget/f_acm.c
New: drivers/usb/gadget/f_acm.h
New: drivers/usb/gadget/f_adb.c
New: drivers/usb/gadget/f_adb.h
New: drivers/usb/gadget/f_mass_storage.c
New: drivers/usb/gadget/f_mass_storage.h
Android also adds a new real-time clock, switch support, and timed GPIO support. We list the impacted files for these new moles at the end of this document.
Power Management -- Power management is one of the most difficult pieces to get right in mobile devices, so we split it out into a group separate from the other pieces. It's interesting to note that Google added a new power management system to Linux, rather than reuse what already existed. We list the impacted files at the end of this document.
kernel/power:
New: kernel/power/consoleearlysuspend.c
New: kernel/power/earlysuspend.c
New: kernel/power/fbearlysuspend.c
Chg: kernel/power/main.c
Chg: kernel/power/power.h
Chg: kernel/power/process.c
New: kernel/power/userwakelock.c
New: kernel/power/wakelock.c
Miscellaneous Changes -- In addition to the above, we found a number of changes that could best be described as, 'Miscellaneous.' Among other things, these changes include additional debugging support, keypad light controls, and management of TCP networking.
(freedom_asic)
『貳』 如何提高android串口kernel log等級
主要看是高通還是MTK了。不過大致相當,只是log文件名稱不一樣而已手機的androidlog(包含main_log、events_log、kernel_log),mainlog記錄手機android上層app以及framework相關活動的log,比如你寫的app列印的log,就在這裡面;eventslog則主要是ActivityManager、powerManager等相關的log;Kernellog則主要是驅動相關的log。Modemlog,主要是通話相關的,比如信號強弱、連接那個網路等等還有網路相關的netlog,看網路鏈接情況,抓取網路包等等主要是以上這三個,其它還有data/anr目錄下的traces/tombstones等等,分析死機、重啟還是很重要的。看應用申請什麼許可權,就看mainlog就行,但是不一定有,因為一般手機log不會放開。你可以在終端里鍵入命令查看其申請了什麼許可權:adbshellmpsyspackage,或者反編譯其apk,查看其AndroidManifest.xml文件。
『叄』 android kernel modem哪個先起來
經本人聯想a789經常出現modemlog的狀態提示,翻閱網路尋找答案未果,無賴一番亂整,找到個方法:打開【系統設置】-【應用程序】-打開 正在運行,找到modemlog這個選項,直接關掉,經過多次使用,不影響系統穩定,不失為一個方法,是否好用還得你們說了算。
『肆』 android 應用怎麼讀取內核日誌
本來以為就沒有辦法在應用程序這一層改系統時間了,後來在網上搜了好久,知道這個目的還是可以達到的。 第一個方法簡單點,不過需要在Android系統源碼的環境下用make來編譯: 1. 在應用程序的AndroidManifest.xml中的manifest節點中加入 android:sharedUserId="android.uid.system"這個屬性。 2. 修改Android.mk文件,加入LOCAL_CERTIFICATE := platform這一行 3. 使用mm命令來編譯,生成的apk就有修改系統時間的許可權了。 第二個辦法麻煩點,不過不用開虛擬機跑到源碼環境下用make來編譯: 1. 同上,加入android:sharedUserId="android.uid.system"這個屬性。 2. 使用eclipse編譯出apk文件,但是這個apk文件是不能用的。 3. 用壓縮軟體打開apk文件,刪掉META-INF目錄下的CERT.SF和CERT.RSA兩個文件。 4. 使用目標系統的platform密鑰來重新給apk文件簽名。這步比較麻煩, 首先找到密鑰文件,在我的Android源碼目錄中的位置 是"build argetproctsecurity",下面的platform.pk8和platform.x509.pem 兩個文件。 然後用Android提供的Signapk工具來簽名,signapk的源代碼是 在"build oolssignapk"下, 用法為"signapk platform.x509.pem platform.pk8 input.apk output.apk", 文件名最好使用絕對路徑防止找不到,也可以修改源代碼直接使用。 這樣最後得到的apk和第一個方法是一樣的。 最後解釋一下原理,首先加入android:sharedUserId="android.uid.system"這個屬性。通過Shared User id,擁有同一個User id的多個APK可以配置成運行在同一個進程中。那麼把程序的UID配成android.uid.system,也就是要讓程序運行在系統進程中,這樣就有許可權來修改系統時間了。 只是加入UID還不夠,如果這時候安裝APK的話發現無法安裝,提示簽名不符,原因是程序想要運行在系統進程中還要有目標系統的platform key,就是上面第二個方法提到的platform.pk8和platform.x509.pem兩個文件。用這兩個key簽名後apk才真正可以放入系統進程中。第一個方法中加入LOCAL_CERTIFICATE := platform其實就是用這兩個key來簽名。這也有一個問題,就是這樣生成的程序只有在原始的Android系統或者是自己編譯的系統中才可以用,因為這樣的系統才可以拿到 platform.pk8和platform.x509.pem兩個文件。要是別家公司做的Android上連安裝都安裝不了。試試原始的Android 中的key來簽名,程序在模擬器上運行OK,不過放到G3上安裝直接提示"Package ... has no signatures that match those in shared user android.uid.system",這樣也是保護了系統的安全。
『伍』 Android系統的系統日誌有哪幾個文件,這些文件中包含什麼內容
手機的android log(main_log、events_log、kernel_log),mainlog記錄手機android上層app以及framework相關活動的log,比如app列印的log。
eventslog主要是ActivityManager、powerManager等相關的log;Kernellog則主要是驅動相關的log。
Modem log,主要是通話相關的,比如信號強弱、連接網路等。netlog,查看網路鏈接情況,抓取網路包等。其它有data/anr 目錄下的traces/tombstones等,分析死機、重啟。
mainlog,查看應用申請什麼許可權,一般不會開放。
(5)androidkernellog擴展閱讀:
系統日誌的價值
系統日誌策略可以在故障剛剛發生時就向你發送警告信息,系統日誌幫助你在最短的時間內發現問題。
系統日誌是一種非常關鍵的組件,因為系統日誌可以讓你充分了解自己的環境。這種系統日誌信息對於決定故障的根本原因或者縮小系統攻擊范圍來說是非常關鍵的,因為系統日誌可以讓你了解故障或者襲擊發生之前的所有事件。
為虛擬化環境制定一套良好的系統日誌策略也是至關重要的,因為系統日誌需要和許多不同的外部組件進行關聯。良好的系統日誌可以防止你從錯誤的角度分析問題,避免浪費寶貴的排錯時間。
另外一種原因是藉助於系統日誌,管理員很有可能會發現一些之前從未意識到的問題,在幾乎所有剛剛部署系統日誌的環境當中。
使用系統日誌產品當中包含的其他特性,包括向監控團隊自動發送報警通知等功能。系統日誌基於警報類型或者准確的警報消息,系統日誌可以通過觸發特定操作來完成。
系統日誌通過簡單地設定這些警報,你將會在自己的環境中處於更加主動的位置,因為你可以在事故變得更加嚴重之前得到通知。
『陸』 如何抓取kernel,mobile,modem的log-Android驅動開發
主要看是高通還是MTK了。不過大致相當,只是log文件名稱不一樣而已
手機的android log(包含 main_log、events_log、kernel_log),mainlog記錄手機android上層app以及framework相關活動的log,比如你寫的app列印的log,就在這裡面;eventslog則主要是ActivityManager、powerManager等相關的log;Kernellog則主要是驅動相關的log。
Modem log,主要是通話相關的,比如信號強弱、連接那個網路等等
還有網路相關的netlog,看網路鏈接情況,抓取網路包等等
主要是以上這三個,其它還有data/anr 目錄下的traces/tombstones等等,分析死機、重啟還是很重要的。
看應用申請什麼許可權,就看mainlog就行,但是不一定有,因為一般手機log不會放開。
你可以在終端里鍵入命令查看其申請了什麼許可權: adb shell mpsys package <包名>,或者反編譯其apk,查看其AndroidManifest.xml文件。