原创 LK源碼解析 2 main.c

kmain()。 /* called from crt0.S */ void kmain(void) __NO_RETURN __EXTERNALLY_VISIBLE; void kmain(void) {     // get us

原创 LK源碼解析 6 aboot.c

聽聞高通將棄用lk轉用uefi,在想還有繼續分析lk源碼的必要嗎?後來一想分析lk源碼的目的與lk亦或是uefi無關,於是決定繼續進行。 boot_linux_from_mmc()。 struct boot_img_hdr {  

原创 LK源碼解析 8 exceptions.S

arm異常模式。 #define FUNCTION(x) .global x; x: FUNCTION(arm_undefined) // 未定義指令異常     stmfd     sp!, { r0-r12, r14 } //

原创 LK源碼解析 5 aboot.c

現在開始分析關鍵函數aboot_init(),岔開一句lk在分區表的名稱即爲aboot。 aboot_init()。 void aboot_init(const struct app_descriptor *app) {     uns

原创 LK源碼解析 1 crt0.s

lk/arch/crt0.s中的_start函數爲入口函數,crt0.s主要初始化CPU,然後長跳轉(bl)到lk/kernel/main.c中kmain函數。 lk的代碼起始位置在crt0.S中。 #define DSB .byt

原创 LK源碼解析 3 thread.c

從thread_resume(thread_create("bootstrap2", &bootstrap2, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE));展開對lk中thread的分析。

原创 LK源碼解析 4 main.c

bootstrap2()。 static int bootstrap2(void *arg) {     dprintf(SPEW, "top of bootstrap2()\n");     arch_init(); // 目前爲空函

原创 LK源碼解析 7 aboot.c

boot_linux()。 typedef void entry_func_ptr(unsigned, unsigned, unsigned*); void boot_linux(void *kernel, unsigned *tags

原创 QEMU模擬運行Zircon(原Magenta)

一 、下載源碼:    $ git clone https://github.com/fuchsia-mirror/zircon.gitor $ git clone https://fuchsia.googlesource.com/zir

原创 Android System Server進程源碼分析 上

一 System Server System Server是Zygote啓動的第一個進程,它的核心功能是啓動和管理Android系統的各類服務。 1.0 startSystemServer private static

原创 Kernel啓動流程源碼解析 4 start_kernel 上

一 start_kernel start_kernel函數是kernel啓動過程執行的第一個c語言函數,其通過調用一系列初始化函數完成的內核的初始化工作,上篇分析local_irq_enable之前的代碼。 1.0 sta

原创 Android debuggerd

轉自http://source.android.com/devices/tech/debug/index.html debuggerd When a dynamically-linked executable starts, sev

原创 Kernel啓動流程源碼解析 8 mm_init

一 mm_init 1.0 mm_init 定義在init/main.c中 static void __init mm_init(void) {     /*      * page_cgroup requires contig

原创 Kernel啓動流程源碼解析 10 init_IRQ

一 init_IRQ 本文以arm,gic-v3兼容的中斷控制器爲例,介紹中斷控制器的初始化過程。 1.0 init_IRQ 定義在arch/arm64/kernel/irq.c中 void __init init_IRQ(void

原创 Kernel啓動流程源碼解析 9 sched_init

一 sched_init 這裏只是簡單過了一下sched_init,收集一些疑問,以後看書或閱讀代碼的時候再來尋找答案。 1.0 sched_init 定義在kernel/sched/core.c中 void __init sc