摘要:本文是参考大量网上资源在结合自己查看源代码总结出来的,让自己同时也让大家加深对Android系统启动过程有一个更加深入的了解!再次强调,本文的大多数功劳应归功于那些原创者们,同时一些必要的参考链接我会一一附上。

注:由于本人采用Exynos4412开发板学习,所以本文大部分资料都是基于此处理器的

简介:对于整个Android系统的启动总的来说分为三个阶段:

    BootLoader引导即uBoot.bin

    linux内核启动即zImage

    Android系统启动即ramdisk.img与system.img

    以上四个文件都是经过自己编译后生成的且通过烧写测试,接下来开始说这三大部分的启动过程。

目录:一、BootLoader的启动

     1.汇编部分

     2.c部分

     二、Kernel的启动

      1.zImage解压缩

      2.kernel的汇编启动阶段

      3.kernel的c启动阶段

   三、Android的启动

      1.init进程

      2.init启动的各种服务

      3.android启动图示

第一部分:BootLoader的启动流程

    uBoot的第一条指令从cpu/arm920t/start.S文件开始

      1. 设置CPU进入SVC模式(系统管理模式),cpsr[4:0]=0xd3。

  1. #include <common.h>
  2. #include <config.h>
  3.  
  4. /*
  5. *************************************************************************
  6. *
  7. * Jump vector table as in table 3.1 in [1]
  8. *
  9. *************************************************************************
  10. */
  11.  
  12. .globl _start
  13. _start: b start_code
  14. ldr pc, _undefined_instruction
  15. ldr pc, _software_interrupt
  16. ldr pc, _prefetch_abort
  17. ldr pc, _data_abort
  18. ldr pc, _not_used
  19. ldr pc, _irq
  20. ldr pc, _fiq
  21.  
  22. _undefined_instruction: .word undefined_instruction
  23. _software_interrupt: .word software_interrupt
  24. _prefetch_abort: .word prefetch_abort
  25. _data_abort: .word data_abort
  26. _not_used: .word not_used
  27. _irq: .word irq
  28. _fiq: .word fiq
  29.  
  30. .balignl ,0xdeadbeef

        接着进入Start_code中:设置CPU进入SVC模式。

  1. /*
  2. * the actual start code
  3. */
  4.  
  5. start_code:
  6. /*
  7. * set the cpu to SVC32 mode
  8. */
  9. mrs r0, cpsr
  10. bic r0, r0, #0x1f
  11. orr r0, r0, #0xd3
  12. msr cpsr, r0
  13.  
  14. bl coloured_LED_init
  15. bl red_LED_on

        2.关看门狗,WTCON=0x0,并设置寄存器地址。

  1. /* turn off the watchdog */
  2.  
  3. # if defined(CONFIG_S3C2400)
  4. # define pWTCON 0x15300000
  5. # define INTMSK 0x14400008 /* Interupt-Controller base addresses */
  6. # define CLKDIVN 0x14800014 /* clock divisor register */
  7. #else
  8. # define pWTCON 0x53000000
  9. # define INTMSK 0x4A000008 /* Interupt-Controller base addresses */
  10. # define INTSUBMSK 0x4A00001C
  11. # define CLKDIVN 0x4C000014 /* clock divisor register */
  12. # endif
  13.  
  14. ldr r0, =pWTCON
  15. mov r1, #0x0
  16. str r1, [r0]

        3.关中断,INTMSK=0xFFFFFFFF, INTSUBMSK=0x3FF。

  1. /*
  2. * mask all IRQs by setting all bits in the INTMR - default
  3. */
  4. mov r1, #0xffffffff
  5. ldr r0, =INTMSK
  6. str r1, [r0]
  7. # if defined(CONFIG_S3C2410)
  8. ldr r1, =0x3ff
  9. ldr r0, =INTSUBMSK
  10. str r1, [r0]
  11. # endif

        4.时钟设置CLKDIVN=0x3 , FCLK:HCLK:PCLK = 1:2:4

  1. /* FCLK:HCLK:PCLK = 1:2:4 */
  2. /* default FCLK is 120 MHz ! */
  3. ldr r0, =CLKDIVN
  4. mov r1, #
  5. str r1, [r0]
  6. #endif /* CONFIG_S3C24X0 */

        5.询问是否进行CPU初始化

  1. #ifndef CONFIG_SKIP_LOWLEVEL_INIT
  2. bl cpu_init_crit
  3. #endif

        6.relocate函数

  1. #ifndef CONFIG_SKIP_RELOCATE_UBOOT
  2. relocate: /* relocate U-Boot to RAM */
  3. adr r0, _start /* r0 <- current position of code */
  4. ldr r1, _TEXT_BASE /* test if we run from flash or RAM */
  5. cmp r0, r1 /* don't reloc during debug */
  6. beq stack_setup
  7.  
  8. ldr r2, _armboot_start
  9. ldr r3, _bss_start
  10. sub r2, r3, r2 /* r2 <- size of armboot */
  11. add r2, r0, r2 /* r2 <- source end address */
  12.  
  13. copy_loop:
  14. ldmia r0!, {r3-r10} /* copy from source address [r0] */
  15. stmia r1!, {r3-r10} /* copy to target address [r1] */
  16. cmp r0, r2 /* until source end addreee [r2] */
  17. ble copy_loop
  18. #endif /* CONFIG_SKIP_RELOCATE_UBOOT */

        7.初始化堆栈

  1. /* Set up the stack */
  2. stack_setup:
  3. ldr r0, _TEXT_BASE /* upper 128 KiB: relocated uboot */
  4. sub r0, r0, #CONFIG_SYS_MALLOC_LEN /* malloc area */
  5. sub r0, r0, #CONFIG_SYS_GBL_DATA_SIZE /* bdinfo */
  6. #ifdef CONFIG_USE_IRQ
  7. sub r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ)
  8. #endif
  9. sub sp, r0, # /* leave 3 words for abort-stack */
  10.  
  11. clear_bss:
  12. ldr r0, _bss_start /* find start of bss segment */
  13. ldr r1, _bss_end /* stop here */
  14. mov r2, #0x00000000 /* clear */
  15.  
  16. clbss_l:str r2, [r0] /* clear loop... */
  17. add r0, r0, #
  18. cmp r0, r1
  19. ble clbss_l

        8.CPU的初始化,即cpu_init_crit函数,完成以后回到主函数

  1. #ifndef CONFIG_SKIP_LOWLEVEL_INIT
  2. cpu_init_crit:
  3. /*
  4. * flush v4 I/D caches
  5. */
  6. mov r0, #
  7. mcr p15, , r0, c7, c7, /* flush v3/v4 cache */
  8. mcr p15, , r0, c8, c7, /* flush v4 TLB */
  9.  
  10. /*
  11. * disable MMU stuff and caches
  12. */
  13. mrc p15, , r0, c1, c0,
  14. bic r0, r0, #0x00002300 @ clear bits , : (--V- --RS)
  15. bic r0, r0, #0x00000087 @ clear bits , : (B--- -CAM)
  16. orr r0, r0, #0x00000002 @ set bit (A) Align
  17. orr r0, r0, #0x00001000 @ set bit (I) I-Cache
  18. mcr p15, , r0, c1, c0,
  19.  
  20. /*
  21. * before relocating, we have to setup RAM timing
  22. * because memory timing is board-dependend, you will
  23. * find a lowlevel_init.S in your board directory.
  24. */
  25. mov ip, lr
  26.  
  27. bl lowlevel_init
  28.  
  29. mov lr, ip
  30. mov pc, lr
  31. #endif /* CONFIG_SKIP_LOWLEVEL_INIT */

        9.从这里跳转到第二阶段C代码中去

  1. ldr pc, _start_armboot
  2.  
  3. _start_armboot: .word start_armboot

     C部分从文件/lib_arm/board.c的start_armboot()函数开始

        1.定义一个struct global_data结构体指针gd,struct global_data结构体对象gd_data,

          定义一个struct bd_info结构体对象bd_data,定义一个指向函数的二级指针init_fnc_ptr,定义的全局结构体对象都是放在堆栈中的,gd是放在寄存器中的。

        2. gd=&gd_data,gd->bd = &bd_data,并且全部空间清0。

        3.init_fnc_ptr = init_sequence(一个初始化函数指针数组)。将会在接下来的for循环中提取出每一个函数来依次执行完。

        4.配置可用的flash空间,并且打印出相关信息,flash_init()和display_flash_config()。

        5.mem_malloc_init()函数,分配堆空间.

        6.env_relocate该函数的作用是将0x33ef0000开始16K的环境参数拷贝到堆空间中去。

        7.gd->bd->bi_ip_addr = getenv_IPaddr ("ipaddr")通过这中方式获得环境变量列表中的ipaddr参数(开发板ip),获得环境变量中的MAC地址,设置到gd->bd->bi_enetaddr[reg]中。

        8.devices_init函数,创建了devlist,但是只有一个串口设备注册在内。

        9.console_init_r函数:控制台完全初始化,此后可以使用函数serial_getc和serial_putc或者putc和getc来输出log。

        10.使能中断,如果有网卡设备,设置网卡MAC和IP地址。

        11.main_loop ();定义于common/main.c。到此所有的初始化工作已经完成,main_loop在标准输入设备中接受命令,然后分析,查找和执行。

        12.在上面的main_loop函数中,通常在开发完成的阶段都会设置一个bootcmd的环境变量,然后将延时bootdelay设置成0,这样当u-boot跑到这里的时候就不会因为用户按下了任意键就进入了命令行模式,

          可以直接运行bootcmd的命令来直接加载kernel的Image然后移交控制权。如果进入了命令行模式,我们也可以手动输入命令来启动系统,输入的命令也是基本和bootcmd一样

  1. #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
  2. s = getenv ("bootdelay");
  3. bootdelay = s ? (int)simple_strtol(s, NULL, ) : CONFIG_BOOTDELAY;
  4.  
  5. debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);

    这个地方时设置bootdelay的地方,即在引导kernel时等待用户命令,进入命令行模式,进行分区,格式化等操作。

        13.uBoot 引导内核启动的最后一步是:通过一个函数指针 thekernel()带三个参数跳转到内核( zImage )入口点开始执行,此时, u-boot 的任务已经完成,控制权完全交给内核( zImage )。

          在 uBoot 的文件lib_arm\bootm.c中定义了 thekernel, 并在 do_bootm_linux 的最后执行 thekernel。

            定义thekernel函数指针,获取bootargs参数给commandline指针。

            theKernel (0, machid, bd->bi_boot_params);第一个参数必须为0,第二个参数为机器类型ID,第三个参数为传递给内核参数的起始地址0x30000100

  1. int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
  2. {
  3. bd_t *bd = gd->bd;
  4. char *s;
  5. int machid = bd->bi_arch_number;
  6. void (*theKernel)(int zero, int arch, uint params);
  7. int ret;
  8.  
  9. #ifdef CONFIG_CMDLINE_TAG
  10. char *commandline = getenv ("bootargs");
  11. #endif
  12.  
  13. if ((flag != ) && (flag != BOOTM_STATE_OS_GO))
  14. return ;
  15.  
  16. theKernel = (void (*)(int, int, uint))images->ep;
  17.  
  18. s = getenv ("machid");
  19. if (s) {
  20. machid = simple_strtoul (s, NULL, 16);
  21. printf ("Using machid 0x%x from environment\n", machid);
  22. }
  23.  
  24. ret = boot_get_ramdisk(argc, argv, images, IH_ARCH_ARM,
  25. &(images->rd_start), &(images->rd_end));
  26. if(ret)
  27. printf("[err] boot_get_ramdisk\n");
  28.  
  29. show_boot_progress ();
  30.  
  31. debug ("## Transferring control to Linux (at address %08lx) ...\n",
  32. (ulong) theKernel);
  33.  
  34. #if defined (CONFIG_SETUP_MEMORY_TAGS) || \
  35. defined (CONFIG_CMDLINE_TAG) || \
  36. defined (CONFIG_INITRD_TAG) || \
  37. defined (CONFIG_SERIAL_TAG) || \
  38. defined (CONFIG_REVISION_TAG) || \
  39. defined (CONFIG_LCD) || \
  40. defined (CONFIG_VFD)
  41. setup_start_tag (bd);
  42. #ifdef CONFIG_SERIAL_TAG
  43. setup_serial_tag (&params);
  44. #endif
  45. #ifdef CONFIG_REVISION_TAG
  46. setup_revision_tag (&params);
  47. #endif
  48. #ifdef CONFIG_SETUP_MEMORY_TAGS
  49. setup_memory_tags (bd);
  50. #endif
  51. #ifdef CONFIG_CMDLINE_TAG
  52. setup_commandline_tag (bd, commandline);
  53. #endif
  54. #ifdef CONFIG_INITRD_TAG
  55. if (images->rd_start && images->rd_end)
  56. setup_initrd_tag (bd, images->rd_start, images->rd_end);
  57. #endif
  58. #if defined (CONFIG_VFD) || defined (CONFIG_LCD)
  59. setup_videolfb_tag ((gd_t *) gd);
  60. #endif
  61. setup_end_tag (bd);
  62. #endif
  63.  
  64. /* we assume that the kernel is in place */
  65. printf ("\nStarting kernel ...\n\n");
  66.  
  67. #ifdef CONFIG_USB_DEVICE
  68. {
  69. extern void udc_disconnect (void);
  70. udc_disconnect ();
  71. }
  72. #endif
  73.  
  74. cleanup_before_linux ();
  75.  
  76. theKernel (, machid, bd->bi_boot_params);
  77. /* does not return */
  78.  
  79. return ;
  80. }

附上BootLoader启动时的调试信息

  1. OK
  2.  
  3. U-Boot 2010.03 (Jul - ::) for iTOP- Android
  4.  
  5. CPU: SMDK4412-AP1. [e4412211]
  6. APLL = 1000MHz, MPLL = 800MHz
  7. ARM_CLOCK = 1000MHz
  8. PMIC: S5M8767(VER5.)
  9. Board: iTOP--Quad
  10. POP type: POP for C220
  11. DRAM: MB
  12. MMC: Count:
  13. max_emmc_clock: MHZ
  14. Set CLK to KHz
  15. EMMC CLOCK OUTPUT:: 400KHz -[div:]
  16. response timeout error : cmd
  17. response timeout error : cmd
  18. max_emmc_clock: MHZ
  19. Input CLK [ MHz] is higher than limit [ MHZ]
  20. Set CLK to KHz
  21. EMMC clock output: KHz
  22. max_emmc_clock: MHZ
  23. Input CLK [ MHz] is higher than limit [ MHZ]
  24. Set CLK to KHz
  25. EMMC clock output: KHz
  26. MMC0: MB
  27. SD sclk_mmc is 400K HZ
  28. raise: Signal # caught
  29. raise: Signal # caught
  30. MMC1: MB
  31. MB
  32. *** Warning - using default environment
  33.  
  34. In: serial
  35. Out: serial
  36. Err: serial
  37. eMMC OPEN Success.!!
  38. !!!Notice!!!
  39. !You must close eMMC boot Partition after all image writing!
  40. !eMMC boot partition has continuity at image writing time.!
  41. !So, Do not close boot partition, Before, all images is written.!
  42.  
  43. MMC read: dev # , block # , count ... blocks read: OK
  44. eMMC CLOSE Success.!!
  45.  
  46. Checking Boot Mode ... EMMC4.
  47. SYSTEM ENTER NORMAL BOOT MODE
  48. Hit any key to stop autoboot:
  49. reading kernel.. ,
  50. MMC read: dev # , block # , count ... blocks read: OK
  51. completed
  52. reading RFS.. ,
  53. MMC read: dev # , block # , count ... blocks read: OK
  54. completed
  55. Boot with zImage
  56. ## Loading init Ramdisk from Legacy Image at 40df0000 ...
  57. Image Name: ramdisk
  58. Image Type: ARM Linux RAMDisk Image (uncompressed)
  59. Data Size: Bytes = 900.3 kB
  60. Load Address:
  61. Entry Point:
  62.  
  63. Starting kernel ...

    C部分我没有仔细去研究了,参考链接:http://blog.sina.com.cn/s/blog_533074eb0101ew0s.html

        汇编代码分析:http://blog.csdn.net/hygzxf/article/details/7477609

总结:BootLoader就是为操作系统启动之前做的准备,初始化硬件设备以及给内核传递必要的数据。

二、Linux内核的启动

  通用寄存器的作用

    r0 :在函数开始时使用
    r1 :存放堆栈指针,相当于ia32架构中的esp寄存器
    r2 :存放当前进程的描述符的地址
    r3 :存放第一个参数和返回地址
    r4-r10 :存放函数的参数
    r11 :用在指针的调用和当前一些语言的环境指针
    r12 :用于存放异常处理
    r13 :保留做为系统线程ID
    r14-r31 :作为本地变量,具有非易失性

    

    1.zImage解压缩

       内核启动引导地址由bootp.lds决定。 (arch/arm/boot/bootp)

  1. ENTRY(_start)
  2. SECTIONS
  3. {
  4. . = ;
  5. .text : {
  6. _stext = .;
  7. *(.start)
  8. *(.text)
  9. initrd_size = initrd_end - initrd_start;
  10. _etext = .;
  11. }

      .= 0可以确定解压代码运行的开始地址在0x0的位置。

      内核启动的执行的第一条的代码:arch/arm/boot/compressed /head.S文件中,Head.S文件主要功能是实现压缩内核的解压和跳转到内核vmlinux内核的入口。

      这里不做具体介绍了,可参考:http://blog.chinaunix.net/uid-25909619-id-3380535.html

    2.Kernel的汇编启动阶段

      第二阶段的代码是从\arch\arm\kernel\head.S开始的

      内核启动第二阶段主要完成的工作有,cpu ID检查,machine ID(也就是开发板ID)检查,创建初始化页表,设置C代码运行环境,跳转到内核第一个真正的C函数startkernel开始执行。

        这一阶段涉及到两个重要的结构体:

          (1) 一个是struct proc_info_list 主要描述CPU相关的信息,定义在文件arch\arm\include\asm\procinfo.h中,与其相关的函数及变量在文件arch/arm/mm/proc_arm920.S中被定义和赋值。

          (2) 另一个结构体是描述开发板或者说机器信息的结构体struct machine_desc,定义在\arch\arm\include\asm\mach\arch.h文件中。

            其函数的定义和变量的赋值在板极相关文件arch/arm/mach-s3c2410/mach-smdk2410.c中实现,这也是内核移植非常重要的一个文件。

          具体分析请参考:http://blog.chinaunix.net/uid-25909619-id-3380544.html

                  http://www.cnblogs.com/innost/archive/2011/11/08/2241653.html

                  http://blog.163.com/sxc_1985921@126/blog/static/50073349200822733247214/

    3.Kernel的C启动阶段(Linux version 3.0.15)

      经过解压缩和汇编启动两个阶段,将会进入init/Main.c中的start_kernel()函数去继续执行

  1. asmlinkage void __init start_kernel(void)
  2. {
  3. char * command_line;
  4. extern const struct kernel_param __start___param[], __stop___param[];
  5.  
  6. smp_setup_processor_id();
  7.  
  8. /*
  9. * Need to run as early as possible, to initialize the
  10. * lockdep hash:
  11. */
  12. lockdep_init();
  13. debug_objects_early_init();
  14.  
  15. /*
  16. * Set up the the initial canary ASAP:
  17. */
  18. boot_init_stack_canary();
  19.  
  20. cgroup_init_early();
  21.  
  22. local_irq_disable();
  23. early_boot_irqs_disabled = true;
  24.  
  25. /*
  26. * Interrupts are still disabled. Do necessary setups, then
  27. * enable them
  28. */
  29. tick_init();
  30. boot_cpu_init();
  31. page_address_init();
  32. printk(KERN_NOTICE "%s", linux_banner);
  33. setup_arch(&command_line);
  34. mm_init_owner(&init_mm, &init_task);
  35. mm_init_cpumask(&init_mm);
  36. setup_command_line(command_line);
  37. setup_nr_cpu_ids();
  38. setup_per_cpu_areas();
  39. smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
  40.  
  41. build_all_zonelists(NULL);
  42. page_alloc_init();
  43.  
  44. printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line);
  45. parse_early_param();
  46. parse_args("Booting kernel", static_command_line, __start___param,
  47. __stop___param - __start___param,
  48. &unknown_bootoption);
  49. /*
  50. * These use large bootmem allocations and must precede
  51. * kmem_cache_init()
  52. */
  53. setup_log_buf();
  54. pidhash_init();
  55. vfs_caches_init_early();
  56. sort_main_extable();
  57. trap_init();
  58.  
  59. //memblock_reserve((phys_addr_t)0x50000000,(phys_addr_t)0x100000);
  60.  
  61. mm_init();
  62.  
  63. /*
  64. * Set up the scheduler prior starting any interrupts (such as the
  65. * timer interrupt). Full topology setup happens at smp_init()
  66. * time - but meanwhile we still have a functioning scheduler.
  67. */
  68. sched_init();
  69. /*
  70. * Disable preemption - early bootup scheduling is extremely
  71. * fragile until we cpu_idle() for the first time.
  72. */
  73. preempt_disable();
  74. if (!irqs_disabled()) {
  75. printk(KERN_WARNING "start_kernel(): bug: interrupts were "
  76. "enabled *very* early, fixing it\n");
  77. local_irq_disable();
  78. }
  79. idr_init_cache();
  80. perf_event_init();
  81. rcu_init();
  82. radix_tree_init();
  83. /* init some links before init_ISA_irqs() */
  84. early_irq_init();
  85. init_IRQ();
  86. prio_tree_init();
  87. init_timers();
  88. hrtimers_init();
  89. softirq_init();
  90. timekeeping_init();
  91. time_init();
  92. profile_init();
  93. call_function_init();
  94. if (!irqs_disabled())
  95. printk(KERN_CRIT "start_kernel(): bug: interrupts were "
  96. "enabled early\n");
  97. early_boot_irqs_disabled = false;
  98. local_irq_enable();
  99.  
  100. /* Interrupts are enabled now so all GFP allocations are safe. */
  101. gfp_allowed_mask = __GFP_BITS_MASK;
  102.  
  103. kmem_cache_init_late();
  104.  
  105. /*
  106. * HACK ALERT! This is early. We're enabling the console before
  107. * we've done PCI setups etc, and console_init() must be aware of
  108. * this. But we do want output early, in case something goes wrong.
  109. */
  110. console_init();
  111. if (panic_later)
  112. panic(panic_later, panic_param);
  113.  
  114. lockdep_info();
  115.  
  116. /*
  117. * Need to run this when irqs are enabled, because it wants
  118. * to self-test [hard/soft]-irqs on/off lock inversion bugs
  119. * too:
  120. */
  121. locking_selftest();
  122.  
  123. #ifdef CONFIG_BLK_DEV_INITRD
  124. if (initrd_start && !initrd_below_start_ok &&
  125. page_to_pfn(virt_to_page((void *)initrd_start)) < min_low_pfn) {
  126. printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
  127. "disabling it.\n",
  128. page_to_pfn(virt_to_page((void *)initrd_start)),
  129. min_low_pfn);
  130. initrd_start = ;
  131. }
  132. #endif
  133. page_cgroup_init();
  134. enable_debug_pagealloc();
  135. debug_objects_mem_init();
  136. kmemleak_init();
  137. setup_per_cpu_pageset();
  138. numa_policy_init();
  139. if (late_time_init)
  140. late_time_init();
  141. sched_clock_init();
  142. calibrate_delay();
  143. pidmap_init();
  144. anon_vma_init();
  145. #ifdef CONFIG_X86
  146. if (efi_enabled)
  147. efi_enter_virtual_mode();
  148. #endif
  149. thread_info_cache_init();
  150. cred_init();
  151. fork_init(totalram_pages);
  152. proc_caches_init();
  153. buffer_init();
  154. key_init();
  155. security_init();
  156. dbg_late_init();
  157. vfs_caches_init(totalram_pages);
  158. signals_init();
  159. /* rootfs populating might need page-writeback */
  160. page_writeback_init();
  161. #ifdef CONFIG_PROC_FS
  162. proc_root_init();
  163. #endif
  164. cgroup_init();
  165. cpuset_init();
  166. taskstats_init_early();
  167. delayacct_init();
  168.  
  169. check_bugs();
  170.  
  171. acpi_early_init(); /* before LAPIC and SMP init */
  172. sfi_init_late();
  173.  
  174. ftrace_init();
  175.  
  176. /* Do the rest non-__init'ed, we're now alive */
  177. //printk(KERN_INFO "[mjdbg]MEM Check4:0x%x : 0x%x.\n", (int *)(phys_to_virt(0x50000000)),*(int *)(phys_to_virt(0x50000000)));
  178. rest_init();
  179. }

          1.打印版本信息,如内核、编译器、作者、日期。

          2.setup_arch()主要做一些板级初始化,cpu初始化,tag参数解析,u-boot传递的cmdline解析,建立mmu工作页表(memtable_init),初始化内存布局,

            调用mmap_io建立GPIO,IRQ,MEMCTRL,UART,及其他外设的静态映射表,对时钟,定时器,uart进行初始化,

            cpu_init():打印一些关于cpu的信息,比如cpu id,cache 大小等。另外重要的是设置了IRQ、ABT、UND三种模式的stack空间,分别都是12个字节。最后将系统切换到svc模式。

          3.build_all_zonelists():建立系统内存页区(zone)链表

          4.printk(KERN_NOTICE "Kernel command line: %s\n", saved_command_line);打印出从uboot传递过来的command_line字符串,在setup_arch函数中获得的。

          5.parse_early_param():这里分析的是系统能够辨别的一些早期参数(这个函数甚至可以去掉,__setup的形式的参数),

             而且在分析的时候并不是以setup_arch(&command_line)传出来的command_line为基础,而是以最原生态的saved_command_line为基础的。

          6.parse_args("Booting kernel", command_line, __start___param, __stop___param - __start___param,&unknown_bootoption);

            对于比较新的版本真正起作用的函数,与parse_early_param()相比,此处对解析列表的处理范围加大了,解析列表中除了包括系统以setup定义的启动参数,

              还包括模块中定义的param参数以及系统不能辨别的参数。

            __start___param是param参数的起始地址,在System.map文件中能看到

            __stop___param - __start___param是参数个数

            unknown_bootoption是对应与启动参数不是param的相应处理函数(查看parse_one()就知道怎么回事)。

           7.sched_init():初始化每个处理器的可运行队列,设置系统初始化进程即0号进程。

          8.init_IRQ():初始化系统中所有的中断描述结构数组:irq_desc[NR_IRQS]。接着执行init_arch_irq函数,

            该函数是在setup_arch函数最后初始化的一个全局函数指针,指向了smdk2410_init_irq函数(in mach-smdk2410.c),

            实际上是调用了s3c24xx_init_irq函数。在该函数中,首先清除所有的中断未决标志,之后就初始化中断的触发方式和屏蔽位,还有中断句柄初始化,

            这里不是最终用户的中断函数,而是do_level_IRQ或者do_edge_IRQ函数,在这两个函数中都使用过__do_irq函数来找到真正最终驱动程序注册在系统中的中断处理函数。

          9.softirq_init():内核的软中断机制初始化函数。

          10.console_init():初始化系统的控制台结构,该函数执行后调用printk函数将log_buf中所有符合打印级别的系统信息打印到控制台上。

          11.profile_init():

            profile是用来对系统剖析的,在系统调试的时候有用

            需要打开内核选项,并且在bootargs中有profile这一项才能开启这个功能

  1. .phys_io = S3C2410_PA_UART,
  2.  
  3. .io_pg_offst = (((u32)S3C24XX_VA_UART) >> ) & 0xfffc,
  4.  
  5. .boot_params = S3C2410_SDRAM_PA + 0x100,
  6.  
  7. .map_io = smdk2410_map_io,
  8.  
  9. .init_irq = s3c24xx_init_irq,
  10.  
  11. .init_machine = smdk2410_init,
  12.  
  13. .timer = &s3c24xx_timer,
  14.  
  15. MACHINE_END

          所有devices的注册都是在smdk2410_init()函数中调用函数:platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices));来完成,

            所以drivers的注册就放在后面了。不过这样注册是有一个坏处的,就是不能准确地控制driver代码中probe的执行先后顺序。

            现在mtk平台上的devices和drivers注册顺序想法,也就是先注册上drivers,然后再注册devices,这样的话,就可以控制probe函数的执行先后。

              include/linux/init.h文件中有这些优先级的定义。

            稍后介绍怎么修改设备初始化顺序:http://www.cnblogs.com/pngcui/p/4666707.html

          12.rest_init():

            调用kernel_thread()创建1号内核线程。

            调用kernel_thread()创建kthreadd内核线程。尚不明作用。

            init_idle_bootup_task():当前0号进程init_task最终会退化成idle进程,所以这里调用init_idle_bootup_task()函数,让init_task进程隶属到idle调度类中。即选择idle的调度相关函数。

            调用schedule()函数切换当前进程,在调用该函数之前,Linux系统中只有两个进程,即0号进程init_task和1号进程kernel_init,其中kernel_init进程也是刚刚被创建的。

              调用该函数后,1号进程kernel_init将会运行!

            调用cpu_idle(),0号线程进入idle函数的循环,在该循环中会周期性地检查。

  1. static noinline void __init_refok rest_init(void)
  2. {
  3. int pid;
  4. //printk("**********************************************************\n");
  5. //printk(" rest_init: 0x%x!!!\n",(*(int *)phys_to_virt(0x50000000)));
  6. //printk("**********************************************************\n");
  7.  
  8. #ifdef CONFIG_KERNEL_PANIC_DUMP
  9. panic_dump_test();
  10. #endif
  11.  
  12. rcu_scheduler_starting();
  13. /*
  14. * We need to spawn init first so that it obtains pid 1, however
  15. * the init task will end up wanting to create kthreads, which, if
  16. * we schedule it before we create kthreadd, will OOPS.
  17. */
  18. kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
  19. numa_default_policy();
  20. pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES);
  21. rcu_read_lock();
  22. kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns);
  23. rcu_read_unlock();
  24. complete(&kthreadd_done);
  25.  
  26. /*
  27. * The boot idle thread must execute schedule()
  28. * at least once to get things moving:
  29. */
  30. init_idle_bootup_task(current);
  31. preempt_enable_no_resched();
  32. schedule();
  33. preempt_disable();
  34.  
  35. /* Call into cpu_idle with preempt disabled */
  36. cpu_idle();
  37. }

          13. kernel_init 1号线程初始化

         最后对Linux应用程序进行初始化。

          1号kernel_init进程完成linux的各项配置(包括启动AP)后,就会在/sbin,/etc,/bin寻找init程序来运行。

          该init程序会替换kernel_init进程(注意:并不是创建一个新的进程来运行init程序,而是一次变身,使用sys_execve函数改变核心进程的正文段,将核心进程kernel_init转换成用户进程init),

          此时处于内核态的1号kernel_init进程将会转换为用户空间内的1号进程init。

          父进程init将根据/etc/inittab中提供的信息完成应用程序的初始化调用。

          然后init进程会执行/bin/sh产生shell界面提供给用户来与Linux系统进行交互。

          调用init_post()创建用户模式1号进程。

          在init_post()中最终调用下面的任何一个入口(按顺序,第一个执行成功后将不返回)

  1. static noinline int init_post(void)
  2. {
  3. /* need to finish all async __init code before freeing the memory */
  4. async_synchronize_full();
  5. free_initmem();
  6. mark_rodata_ro();
  7. system_state = SYSTEM_RUNNING;
  8. numa_default_policy();
  9.  
  10. current->signal->flags |= SIGNAL_UNKILLABLE;
  11.  
  12. if (ramdisk_execute_command) {
  13. run_init_process(ramdisk_execute_command);
  14. printk(KERN_WARNING "Failed to execute %s\n",
  15. ramdisk_execute_command);
  16. }
  17.  
  18. /*
  19. * We try each of these until one succeeds.
  20. *
  21. * The Bourne shell can be used instead of init if we are
  22. * trying to recover a really broken machine.
  23. */
  24. if (execute_command) {
  25. run_init_process(execute_command);
  26. printk(KERN_WARNING "Failed to execute %s. Attempting "
  27. "defaults...\n", execute_command);
  28. }
  29. run_init_process("/sbin/init");
  30. run_init_process("/etc/init");
  31. run_init_process("/bin/init");
  32. run_init_process("/bin/sh");
  33.  
  34. panic("No init found. Try passing init= option to kernel. "
  35. "See Linux Documentation/init.txt for guidance.");
  36. }

      关于更多函数解释可以参考:http://blog.chinaunix.net/uid-27052262-id-3404074.html

至此Linux内核初始化完成,终于开始加载Android系统了。。

Linux启动串口调试信息

  1. Starting kernel ...
  2.  
  3. Uncompressing Linux... done, booting the kernel.
  4. [ 0.000000] Initializing cgroup subsys cpu
  5. [ 0.000000] Linux version 3.0. (root@ubuntu) (gcc version 4.4. (Sourcery G++ Lite 2009q3-) ) # SMP PREEMPT Mon Jul :: PDT
  6. [ 0.000000] CPU: ARMv7 Processor [413fc090] revision (ARMv7), cr=10c5387d
  7. [ 0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
  8. [ 0.000000] Machine: SMDK4X12
  9. [ 0.000000] **************************
  10. [ 0.000000] reserve_panic_dump_area!!
  11. [ 0.000000] **************************
  12. [ 0.000000] Memory policy: ECC disabled, Data cache writealloc
  13. [ 0.000000] CPU EXYNOS4412 (id 0xe4412211)
  14. [ 0.000000] S3C24XX Clocks, Copyright Simtec Electronics
  15. [ 0.000000] s3c_register_clksrc: clock audiocdclk has no registers set
  16. [ 0.000000] audiocdclk: no parent clock specified
  17. [ 0.000000] s3c_register_clksrc: clock armclk has no registers set
  18. [ 0.000000] EXYNOS4: PLL settings, A=, M=, E= V=
  19. [ 0.000000] EXYNOS4: ARMCLK=, DMC=, ACLK200=
  20. [ 0.000000] ACLK160=, ACLK133=, ACLK100=
  21. [ 0.000000] EXYNOS4: ACLK400= ACLK266=
  22. [ 0.000000] uclk1: source is mout_mpll_user (), rate is
  23. [ 0.000000] uclk1: source is mout_mpll_user (), rate is
  24. [ 0.000000] uclk1: source is mout_mpll_user (), rate is
  25. [ 0.000000] uclk1: source is mout_mpll_user (), rate is
  26. [ 0.000000] sclk_csis: source is xusbxti (), rate is
  27. [ 0.000000] sclk_csis: source is xusbxti (), rate is
  28. [ 0.000000] sclk_cam0: source is xusbxti (), rate is
  29. [ 0.000000] sclk_cam1: source is xusbxti (), rate is
  30. [ 0.000000] sclk_fimc: source is xusbxti (), rate is
  31. [ 0.000000] sclk_fimc: source is xusbxti (), rate is
  32. [ 0.000000] sclk_fimc: source is xusbxti (), rate is
  33. [ 0.000000] sclk_fimc: source is xusbxti (), rate is
  34. [ 0.000000] sclk_fimd: source is xusbxti (), rate is
  35. [ 0.000000] sclk_fimd: source is xusbxti (), rate is
  36. [ 0.000000] sclk_mfc: source is mout_mfc0 (), rate is
  37. [ 0.000000] sclk_g3d: source is mout_g3d0 (), rate is
  38. [ 0.000000] sclk_pwi: source is xusbxti (), rate is
  39. [ 0.000000] PERCPU: Embedded pages/cpu @c0dc8000 s6752 r8192 d13728 u32768
  40. [ 0.000000] Built zonelists in Zone order, mobility grouping on. Total pages:
  41. [ 0.000000] Kernel command line: console=ttySAC2, //--------------------------------------------------------
  42. [ 0.000000] log_buf_len:
  43. [ 0.000000] early log buf free: (%)
  44. [ 0.000000] PID hash table entries: (order: , bytes)
  45. [ 0.000000] Dentry cache hash table entries: (order: , bytes)
  46. [ 0.000000] Inode-cache hash table entries: (order: , bytes)
  47. [ 0.000000] Memory: 1023MB = 1023MB total
  48. [ 0.000000] Memory: 645528k/645528k available, 402024k reserved, 293888K highmem
  49. [ 0.000000] Virtual kernel memory layout:
  50. [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( kB)
  51. [ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( kB)
  52. [ 0.000000] DMA : 0xfea00000 - 0xffe00000 ( MB)
  53. [ 0.000000] vmalloc : 0xee800000 - 0xf6000000 ( MB)
  54. [ 0.000000] lowmem : 0xc0000000 - 0xee000000 ( MB)
  55. [ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( MB)
  56. [ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( MB)
  57. [ 0.000000] .init : 0xc0008000 - 0xc003f000 ( kB)
  58. [ 0.000000] .text : 0xc003f000 - 0xc08db000 ( kB)
  59. [ 0.000000] .data : 0xc08dc000 - 0xc0981a40 ( kB)
  60. [ 0.000000] .bss : 0xc0981d30 - 0xc09beff0 ( kB)
  61. [ 0.000000] SLUB: Genslabs=, HWalign=, Order=-, MinObjects=, CPUs=, Nodes=
  62. [ 0.000000] Preemptible hierarchical RCU implementation.
  63. [ 0.000000] NR_IRQS:
  64. [ 0.000000] Calibrating delay loop... 1992.29 BogoMIPS (lpj=)
  65. [ 0.045000] pid_max: default: minimum:
  66. [ 0.045000] Mount-cache hash table entries:
  67. [ 0.045000] Initializing cgroup subsys debug
  68. [ 0.045000] Initializing cgroup subsys cpuacct
  69. [ 0.045000] Initializing cgroup subsys freezer
  70. [ 0.045000] CPU: Testing write buffer coherency: ok
  71. [ 0.045000] **********panic_dump_test****************
  72. [ 0.045000] There is no valid panic information in memory
  73. [ 0.045000] **************************
  74. [ 0.045000] L310 cache controller enabled
  75. [ 0.045000] l2x0: ways, CACHE_ID 0x4100c4c8, AUX_CTRL 0x7e470001, Cache size: B
  76. [ 0.075000] CPU1: Booted secondary processor
  77. [ 0.095000] CPU2: Booted secondary processor
  78. [ 0.115000] CPU3: Booted secondary processor
  79. [ 0.115000] Brought up CPUs
  80. [ 0.115000] SMP: Total of processors activated (7969.17 BogoMIPS).
  81. [ 0.120000] print_constraints: dummy:
  82. [ 0.120000] NET: Registered protocol family
  83. [ 0.120000] value1 = , value2 = , type = 0x1
  84. [ 0.120000] value1 = , value2 = , type = 0x1
  85. [ 0.135000] exynos4_pmu_init: PMU supports ()
  86. [ 0.135000] S3C Power Management, Copyright Simtec Electronics
  87. [ 0.135000] EXYNOS4: Initializing architecture
  88. [ 0.135000] panic_file create OK !!
  89. [ 0.135000] s3c-adc exynos4412-adc: attached adc driver
  90. [ 0.135000] samsung-pd samsung-pd.: power domain registered
  91. [ 0.135000] samsung-pd samsung-pd.: power domain registered
  92. [ 0.135000] samsung-pd samsung-pd.: power domain registered
  93. [ 0.135000] samsung-pd samsung-pd.: power domain registered
  94. [ 0.135000] samsung-pd samsung-pd.: power domain registered
  95. [ 0.135000] samsung-pd samsung-pd.: power domain registered
  96. [ 0.135000] samsung-pd samsung-pd.: power domain registered
  97. [ 0.135000] s3c24xx-pwm s3c24xx-pwm.: tin at , tdiv at , tin=divclk, base
  98. [ 0.135000] UMP: UMP device driver loaded
  99. [ 0.155000] bio: create slab <bio-> at
  100. [ 0.155000] SCSI subsystem initialized
  101. [ 0.155000] s3c64xx_spi_probe()
  102. [ 0.155000] s3c64xx_spi_probe()
  103. [ 0.155000] s3c64xx_spi_probe()
  104. [ 0.155000] usbcore: registered new interface driver usbfs
  105. [ 0.155000] usbcore: registered new interface driver hub
  106. [ 0.155000] usbcore: registered new device driver usb
  107. [ 0.155000] i2c-gpio i2c-gpio.: using pins (SDA) and (SCL)
  108. [ 0.160000] +s5m8767_pmic_probe()
  109. [ 0.160000] print_constraints: vdd_mif range: <--> mV at mV
  110. [ 0.160000] print_constraints: vdd_arm range: <--> mV at mV
  111. [ 0.160000] print_constraints: vdd_int range: <--> mV at mV
  112. [ 0.160000] print_constraints: vdd_g3d range: <--> mV at mV
  113. [ 0.165000] print_constraints: vdd_m12 range: <--> mV at mV
  114. [ 0.165000] print_constraints: vdd12_5m range: <--> mV at mV
  115. [ 0.165000] print_constraints: vddf28_emmc range: <--> mV at mV
  116. [ 0.170000] print_constraints: VDDQ_M12: mV
  117. [ 0.170000] print_constraints: VDD18_2M: mV
  118. [ 0.170000] print_constraints: VDD10_MIPI: mV
  119. [ 0.185000] print_constraints: VDD33_LCD: mV
  120. [ 0.185000] print_constraints: VDD18_MIPI: mV
  121. [ 0.195000] print_constraints: VDD33_UOTG: mV
  122. [ 0.200000] print_constraints: VDD10_USH: mV
  123. [ 0.200000] print_constraints: VDD18_HSIC: mV
  124. [ 0.200000] print_constraints: VDDIOPERI_28: mV
  125. [ 0.215000] print_constraints: DC33V_TP: mV
  126. [ 0.215000] print_constraints: VDD28_CAM: mV
  127. [ 0.215000] print_constraints: VDD28_AF: mV
  128. [ 0.215000] print_constraints: VDDA28_2M: mV
  129. [ 0.220000] print_constraints: VDD28_TF: mV
  130. [ 0.230000] print_constraints: VDD33_A31: mV
  131. [ 0.255000] print_constraints: VDD18_CAM: mV
  132. [ 0.255000] print_constraints: VDD18_A31: mV
  133. [ 0.255000] print_constraints: GPS_1V8: mV
  134. [ 0.260000] print_constraints: DVDD12: mV
  135. [ 0.260000] -s5m8767_pmic_probe()
  136. [ 0.260000] s5m87xx -: S5M87xx MFD probe done!!!
  137. [ 0.260000] s3c-i2c s3c2440-i2c.: i2c-: S3C I2C adapter
  138. [ 0.260000] s3c-i2c s3c2440-i2c.: i2c-: S3C I2C adapter
  139. [ 0.260000] s3c-i2c s3c2440-i2c.: i2c-: S3C I2C adapter
  140. [ 0.260000] s3c-i2c s3c2440-i2c.: i2c-: S3C I2C adapter
  141. [ 0.260000] s3c-i2c s3c2440-i2c.: i2c-: S3C I2C adapter
  142. [ 0.260000] Advanced Linux Sound Architecture Driver Version 1.0..
  143. [ 0.260000] Bluetooth: Core ver 2.16
  144. [ 0.260000] NET: Registered protocol family
  145. [ 0.260000] Bluetooth: HCI device and connection manager initialized
  146. [ 0.260000] Bluetooth: HCI socket layer initialized
  147. [ 0.260000] Bluetooth: L2CAP socket layer initialized
  148. [ 0.260000] Bluetooth: SCO socket layer initialized
  149. [ 0.260000] cfg80211: Calling CRDA to update world regulatory domain
  150. [ 0.260000] Switching to clocksource mct-frc
  151. [ 0.260428] Switched to NOHz mode on CPU #
  152. [ 0.260640] Switched to NOHz mode on CPU #
  153. [ 0.260646] Switched to NOHz mode on CPU #
  154. [ 0.260653] Switched to NOHz mode on CPU #
  155. [ 0.261840] NET: Registered protocol family
  156. [ 0.262015] IP route cache hash table entries: (order: , bytes)
  157. [ 0.262642] TCP established hash table entries: (order: , bytes)
  158. [ 0.264143] TCP bind hash table entries: (order: , bytes)
  159. [ 0.264947] TCP: Hash tables configured (established bind )
  160. [ 0.264963] TCP reno registered
  161. [ 0.264978] UDP hash table entries: (order: , bytes)
  162. [ 0.265039] UDP-Lite hash table entries: (order: , bytes)
  163. [ 0.265305] NET: Registered protocol family
  164. [ 0.265443] Trying to unpack rootfs image as initramfs...
  165. [ 0.316627] Freeing initrd memory: 900K
  166. [ 0.316732] PMU: registered new PMU device of type
  167. [ 0.316901] Exynos4 : ARM Clock down on idle mode is enabled
  168. [ 0.317816] regulator_consumer_probe: loading tc4-regulator-consumer
  169. [ 0.317836] Register vdd_consumer_early_suspend done
  170. [ 0.318454] Loaded driver for PL330 DMAC- s3c-pl330
  171. [ 0.318470] DBUFF-64x8bytes Num_Chans- Num_Peri- Num_Events-
  172. [ 0.318767] Loaded driver for PL330 DMAC- s3c-pl330
  173. [ 0.318782] DBUFF-32x4bytes Num_Chans- Num_Peri- Num_Events-
  174. [ 0.318879] Loaded driver for PL330 DMAC- s3c-pl330
  175. [ 0.318894] DBUFF-32x4bytes Num_Chans- Num_Peri- Num_Events-
  176. [ 0.326370] highmem bounce pool size: pages
  177. [ 0.326563] ashmem: initialized
  178. [ 0.334795] fuse init (API version 7.16)
  179. [ 0.335137] msgmni has been set to
  180. [ 0.335776] io scheduler noop registered
  181. [ 0.335789] io scheduler deadline registered
  182. [ 0.335845] io scheduler cfq registered (default)
  183. [ 0.336711] value1 = , value2 = , type = 0x1
  184. [ 0.590044] (s3cfb_cfg_gpio, ): BK_VDD_ON
  185. [ 0.695084] (s3cfb_cfg_gpio, ): LCD_PWDN ON

第三部分:Android部分启动

    Android的启动过程是从进程init开始的,所以它是后续所有进程的祖先进程。(system/core/init)

      1.重新设置子进程终止时信号SIGCHLD的处理函数。

      2. 将kernel启动过程中建立好的文件系统框架mount到相应目录。

      3.open_devnull_stdio(),将init进程的标准输入、输出、出错设备设置为新建的设备节点/dev/__null__。

      4.log_init(),创建并打开设备节点/dev/__kmsg__。

      5.读取并解析rc配置文件。

        先从文件/sys/class/BOOT/BOOT/boot/boot_mode读出启动方式:Factory Mode, '4';ATE Factory Mode, '6'。看是否是facatory模式。

        如果是的话,需要读取并解析两个文件:init.factory.rc和init.rc。

        如果是正常启动,则暂时先读取init.rc。

        这里在读取解析文件的时候,是以行为最小可执行单位在解析。关于书写init.rc文件的初始化脚本语言的规则,可以上网查找。

        解析之后并不会马上执行,而是在init进入服务循环之前统一根据其命令本身所带的条件来执行。

      6.导入kernel的cmdline,也就是u-boot传递给kernel的参数

        查看其中是否具有androidboot.xxx(androidboot.mode、androidboot.hardware等)参数,

        如果有,将其保存在同名字的xxx(mode、hardware)全局变量中。

        这里特别说明的是hardware这个参数,从kernel中导出一部分之后,又要从/proc/cpuinfo中导出一部分来组合成完整的hardware参数,因为后面接下来会读取并解析以特定平台的rc文件。

      7.读取特定平台相关的initrc文件,如:init.mt6516.rc。

        对于service,这里会给每个服务建立一个struct service的结构体,全部挂入链表service_list之中,在init最后才启动。

      8.检查解析出来的所有命令行当中是否有属于early-init的,如果有,将其提出来加入到链表action_queue之中,马上将其执行掉。

      9.device_init()函数将会打开uevent的netlink socket,遍历/sys/class、/sys/block、/sys/devices目录,

        检查各级目录的uevent文件,处理在vold服务起来之前由kernel所发出来的device add, remove等事件。

      10.property_init(), 顾名思义,是属性初始化。首先创建一个名字为system_properties的匿名共享内存区域,对并本init进程做mmap读写映射,其余共享它的进程只有读的权限。

        然后将这个prop_area结构体通过全局变量__system_property_area__传递给property services。

        接着调用函数load_properties_from_file(PROP_PATH_RAMDISK_DEFAULT)从/default.prop文件中加载编译时生成的属性。

      11.如果在root目录下有initlogo.rle文件存在,这个是两张android字样的缕空图片,将其读入fb中显示到LCD上。同时也要往串口上输出"

      12.设置相应的属性。

      13.开始执行以init为trigger的命令行。

      14.启动属性服务:property_set_fd = start_property_service();

      15.创建一对socket,用来做信号方面的处理。

      16.执行eraly-boot和boot为trigger的命令。

      17.执行init.rc中以property:开头的属性设置语句,同时使能属性触发方式。

      18.利用poll机制监听前面创建的几个fd的动态。

      19.nit中启动的各种服务

        详细请参考:http://blog.csdn.net/lizhiguo0532/article/details/7028910

Android启动图示:

Android启动时串口调试信息如下:

  1. [ 0.700601] CPU type:
  2. [ 0.700612] Exynos
  3. [ 0.700623] value1 = , value2 = , type = 0x1
  4. [ 0.710886] parent clock: , vclk: , vclk div:
  5. [ 0.960563] (s3cfb_backlight_on, ): LCD_PWM_ON
  6. [ 0.965577] (s3cfb_backlight_on, ): VGA_EN_ON
  7. [ 0.965596] s3cfb s3cfb.: registered successfully
  8. [ 0.966251] Serial: / driver, ports, IRQ sharing disabled
  9. [ 1.290258] s5pv210-uart.: ttySAC0 at MMIO 0x13800000 (irq = ) is a S3C6400/
  10. [ 1.370063] s5pv210-uart.: ttySAC1 at MMIO 0x13810000 (irq = ) is a S3C6400/
  11. [ 1.450061] s5pv210-uart.: ttySAC2 at MMIO 0x13820000 (irq = ) is a S3C6400/
  12. [ 2.465477] console [ttySAC2] enabled
  13. [ 2.510061] s5pv210-uart.: ttySAC3 at MMIO 0x13830000 (irq = ) is a S3C6400/
  14. [ 2.591003] SI GPS Initialize
  15. [ 2.592759] max485_ctl Initialize
  16. [ 2.596064] leds Initialize
  17. [ 2.598692] leds:register device success!
  18. [ 2.602577] leds_test_delay_run
  19. [ 4.203173] leds_test_delay_over
  20. [ 4.205188] buzzer_ctl initialized
  21. [ 4.208437] exynos_adc_probe,
  22. [ 4.211617] exynos_adc_probe,
  23. [ 4.215024] exynos_adc_probe,
  24. [ 4.218198] adc initialized
  25. [ 4.221242] relay_ctl initialized
  26. [ 4.230393] brd: module loaded
  27. [ 4.235021] loop: module loaded
  28. [ 4.236723] pmem: init
  29. [ 4.239498] pmem_gpu1: init
  30. [ 4.248745] CAN device driver interface
  31. [ 4.251129] PPP generic driver version 2.4.
  32. [ 4.255735] usbcore: registered new interface driver dm9601
  33. [ 4.261062] usbcore: registered new interface driver dm9620
  34. [ 4.266636] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
  35. [ 4.273105]
  36. [ 4.273108]
  37. [ 4.273111] [usb_host_phy_init]++++++++++++++
  38. [ 4.280546] s5p-ehci s5p-ehci: S5P EHCI Host Controller
  39. [ 4.285597] s5p-ehci s5p-ehci: new USB bus registered, assigned bus number
  40. [ 4.292721] s5p-ehci s5p-ehci: irq , io mem 0x12580000
  41. [ 4.305040] s5p-ehci s5p-ehci: USB 0.0 started, EHCI 1.00
  42. [ 4.309067] usb usb1: New USB device found, idVendor=1d6b, idProduct=, bcdDevice=
  43. [ 4.317143] usb usb1: New USB device strings: Mfr=, Product=, SerialNumber=
  44. [ 4.324344] usb usb1: New USB device Class: Class=, SubClass=, Protocol=
  45. [ 4.331287] usb usb1: Product: S5P EHCI Host Controller
  46. [ 4.336494] usb usb1: Manufacturer: Linux 3.0. ehci_hcd
  47. [ 4.341874] usb usb1: SerialNumber: s5p-ehci
  48. [ 4.346608] hub -:1.0: USB hub found
  49. [ 4.349858] hub -:1.0: ports detected
  50. [ 4.354415] usbcore: registered new interface driver cdc_acm
  51. [ 4.359496] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
  52. [ 4.367480] Initializing USB Mass Storage driver...
  53. [ 4.372471] usbcore: registered new interface driver usb-storage
  54. [ 4.378331] USB Mass Storage support registered.
  55. [ 4.383157] usbcore: registered new interface driver usbserial
  56. [ 4.388747] usbserial: USB Serial Driver core
  57. [ 4.393181] USB Serial support registered for GSM modem (-port)
  58. [ 4.399222] usbcore: registered new interface driver option
  59. [ 4.404632] option: v0.7.2:USB Driver for GSM modems
  60. [ 4.409779] s3c-udc : S3C HS USB OTG Device Driver,(c) - Samsung Electronics
  61. [ 4.409785] s3c-udc : version March
  62. [ 4.423369] android_usb gadget: Mass Storage Function, version: //
  63. [ 4.428783] android_usb gadget: Number of LUNs=
  64. [ 4.433381] lun0: LUN: removable file: (no medium)
  65. [ 4.438241] lun1: LUN: removable file: (no medium)
  66. [ 4.443101] lun2: LUN: removable file: (no medium)
  67. [ 4.448211] android_usb gadget: android_usb ready
  68. [ 4.452833] mousedev: could not register psaux device, error: -
  69. [ 4.458726] mousedev: PS/ mouse device common for all mice
  70. [ 4.464915] input: gpio-keys as /devices/platform/gpio-keys/input/input0
  71. [ 4.471583] input: samsung-keypad as /devices/platform/samsung-keypad/input/input1
  72. [ 4.478872] usbcore: registered new interface driver xpad
  73. [ 4.484008] usbcore: registered new interface driver usb_acecad
  74. [ 4.489800] acecad: v3.:USB Acecad Flair tablet driver
  75. [ 4.495119] usbcore: registered new interface driver aiptek
  76. [ 4.500564] aiptek: v2. (May , ):Aiptek HyperPen USB Tablet Driver (Linux 2.6.x)
  77. [ 4.508460] aiptek: Bryan W. Headley/Chris Atenasio/Cedric Brun/Rene van Paassen
  78. [ 4.515943] usbcore: registered new interface driver gtco
  79. [ 4.521238] GTCO usb driver version: 2.00.
  80. [ 4.525580] usbcore: registered new interface driver hanwang
  81. [ 4.531397] usbcore: registered new interface driver kbtab
  82. [ 4.536759] kbtab: v0.0.2:USB KB Gear JamStudio Tablet driver
  83. [ 4.542593] usbcore: registered new interface driver wacom
  84. [ 4.547960] wacom: v1.:USB Wacom tablet driver
  85. [ 4.552801] tsc2007 -: i2c io error: -
  86. [ 4.556950] tsc2007 -: i2c io error: -
  87. [ 4.561192] tsc2007 -: i2c io error: -
  88. [ 4.565445] tsc2007 -: i2c io error: -
  89. [ 4.569685] tsc2007 -: i2c io error: -
  90. [ 4.573952] tsc2007 -: i2c io error: -
  91. [ 4.578984] S3C24XX RTC, (c) , Simtec Electronics
  92. [ 4.583514] s3c-rtc s3c64xx-rtc: rtc disabled, re-enabling
  93. [ 4.588958] Begin gettime...................
  94. [ 4.593183] s3c_rtc_gettime() -- ::
  95. [ 4.598222] using rtc device, s3c, for alarms
  96. [ 4.602053] s3c-rtc s3c64xx-rtc: rtc core: registered s3c as rtc0
  97. [ 4.608466] I found You!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  98. [ 7.613770] -----time:s5m_rtc_read_time: // ::()
  99. [ 8.617588] Alrm-----------------s5m_rtc_read_alarm: // ::(-)
  100. [ 8.624267] -----time:s5m_rtc_read_time: // ::()
  101. [ 9.627158] s5m-rtc s5m-rtc: rtc core: registered s5m-rtc as rtc1
  102. [ 9.632180] s5m-rtc s5m-rtc: RTC CHIP NAME: s5m-rtc
  103. [ 9.636650] The Over-------------------------------------------------------------------------------------
  104. [ 10.644544] i2c /dev entries driver
  105. [ 10.647643] Linux media interface: v0.
  106. [ 10.650947] lirc_dev: IR Remote Control driver registered, major
  107. [ 10.657063] IR NEC protocol handler initialized
  108. [ 10.661573] IR RC5(x) protocol handler initialized
  109. [ 10.666347] IR RC6 protocol handler initialized
  110. [ 10.670860] IR JVC protocol handler initialized
  111. [ 10.675373] IR Sony protocol handler initialized
  112. [ 10.679964] IR RC5 (streamzap) protocol handler initialized
  113. [ 10.685531] IR LIRC bridge handler initialized
  114. [ 10.689946] Linux video capture interface: v2.
  115. [ 10.694645] ov5640_module_init
  116. [ 10.698359] s3c-csis: Samsung MIPI-CSIS0 driver probed successfully
  117. [ 10.703872] s3c-csis: Samsung MIPI-CSIS1 driver probed successfully
  118. [ 10.710206] Initialize JPEG driver
  119. [ 10.713717] s5p-jpeg s5p-jpeg: JPEG driver is registered to /dev/video12
  120. [ 10.720302] s5p-jpeg s5p-jpeg: JPEG driver is registered to /dev/video11
  121. [ 10.727039] i2c i2c-: attached s5p_ddc into i2c adapter successfully
  122. [ 10.733369] i2c-core: driver [s5p_ddc] using legacy suspend method
  123. [ 10.739435] i2c-core: driver [s5p_ddc] using legacy resume method
  124. [ 10.745514] S5P HPD Driver, (c) Samsung Electronics
  125. [ 10.751176] S5P CEC Driver, (c) Samsung Electronics
  126. [ 10.756939] MFC(Multi Function Codec - FIMV v5.x) registered successfully
  127. [ 10.763337] Samsung Graphics 2D driver, (c) Samsung Electronics
  128. [ 10.769689] Mali: init_mali_clock mali_clock c08f6cc4
  129. [ 10.777020] Mali: failed to get cpufreq level for 1200MHzMali: Mali device driver loaded
  130. [ 10.794227] usbcore: registered new interface driver uvcvideo
  131. [ 10.799744] USB Video Class driver (v1.1.0)
  132. [ 10.804024] S3C2410 Watchdog Timer, (c) Simtec Electronics
  133. [ 10.810135] s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
  134. [ 10.818121] device-mapper: uevent: version 1.0.
  135. [ 10.822360] device-mapper: ioctl: 4.20.-ioctl (--) initialised: dm-devel@redhat.com
  136. [ 10.830495] Bluetooth: HCI UART driver ver 2.2
  137. [ 10.834886] Bluetooth: HCI H4 protocol initialized
  138. [ 10.839672] Bluetooth: HCI BCSP protocol initialized
  139. [ 10.844618] Bluetooth: HCILL protocol initialized
  140. [ 10.849305] Bluetooth: HCIATH3K protocol initialized
  141. [ 10.854881] cpuidle: using governor ladder
  142. [ 10.859233] cpuidle: using governor menu
  143. [ 10.862337] mshci: Mobile Storage Host Controller Interface driver
  144. [ 10.868402] mshci: Copyright (c) Samsung Electronics Co., Ltd
  145. [ 10.874644] clock source : sclk_dwmci ( Hz)
  146. [ 10.879605] dw_mmc dw_mmc: clock source : sclk_dwmci ( Hz)
  147. [ 10.886164] mmc0: Version ID 0x5342240a.
  148. [ 10.889830] mjdbg: cmu_max_clcok:
  149. [ 10.893921] mjdbg: host->max_clk:
  150. [ 10.898303] mmc0: FIFO WMARK FOR RX 0x11 WX 0x1. ###########
  151. [ 10.906124] mmc0: MSHCI controller on samsung-mshci [dw_mmc] using IDMA
  152. [ 10.911462] sdhci: Secure Digital Host Controller Interface driver
  153. [ 10.917435] sdhci: Copyright(c) Pierre Ossman
  154. [ 10.922782] mmc0:mshci_set_clock, @ration:,[mjdbg] cmu_set_clock:
  155. [ 10.929332] s3c-sdhci s3c-sdhci.: clock source : sclk_mmc ( Hz)
  156. [ 10.936047] mmc1: no vmmc regulator found
  157. [ 10.940037] *******mmc0: inserted!!!!!******
  158. [ 10.940190] mmc1: SDHCI controller on samsung-hsmmc [s3c-sdhci.] using ADMA
  159. [ 10.940203] wake enabled for irq
  160. [ 10.940446] s3c-sdhci s3c-sdhci.: clock source : sclk_mmc ( Hz)
  161. [ 10.940471] sdhci_s3c_probe: set MMC_PM_IGNORE_PM_NOTIFY for mmc2 pm_flags
  162. [ 10.940478] sdhci_s3c_probe: set MMC_PM_KEEP_POWER | MMC_PM_WAKE_SDIO_IRQ for mmc2 pm_caps
  163. [ 10.940498] mmc2: no vmmc regulator found
  164. [ 10.940689] mmc2: SDHCI controller on samsung-hsmmc [s3c-sdhci.] using ADMA
  165. [ 10.946509] usbcore: registered new interface driver usbhid
  166. [ 10.946516] usbhid: USB HID core driver
  167. [ 10.947321] logger: created 256K log 'log_main'
  168. [ 10.947461] logger: created 256K log 'log_events'
  169. [ 10.947606] logger: created 256K log 'log_radio'
  170. [ 10.947753] logger: created 256K log 'log_system'
  171. [ 10.948354] GPS: mt3326_gps_power: Switching GPS device on
  172. [ 10.948362] GPS: mt3326_gps_power: ignore power control:
  173. [ 10.948369] GPS: mt3326_gps_probe: Registering chardev
  174. [ 10.948376] GPS: mt3326_gps_probe: major: , minor:
  175. [ 10.948631] GPS: mt3326_gps_probe: Done
  176. [ 10.949893] Samsung Audio Subsystem Driver, (c) Samsung Electronics
  177. [ 10.949953] audss_init: RCLK SRC[busclk]
  178. [ 11.053233] mmc0: cmd response timeout error
  179. [ 11.059167] mmc0: cmd response timeout error
  180. [ 11.074324] mmc0: cmd response timeout error
  181. [ 11.079400] asoc: wm8960-hifi <-> samsung-i2s. mapping ok
  182. [ 11.083424] mmc0: cmd response timeout error
  183. [ 11.089454] Samsung SRP driver, (c) Samsung Electronics
  184. [ 11.093650] mmc0: cmd response timeout error
  185. [ 11.099873] mmc0: cmd response timeout error
  186. [ 11.104647] mmc0: cmd response timeout error
  187. [ 11.109435] mmc0: cmd response timeout error
  188. [ 11.114312] mmc0: cmd response timeout error
  189. [ 11.119184] mmc0: cmd response timeout error
  190. [ 11.124052] mmc0: cmd response timeout error
  191. [ 11.132033] SRP: Driver successfully probed
  192. [ 11.134928] ALSA device list:
  193. [ 11.137710] #: TOPEET-WM8960
  194. [ 11.140947] GACT probability NOT on
  195. [ 11.144297] Mirror/redirect action on
  196. [ 11.147953] u32 classifier
  197. [ 11.150639] Actions configured
  198. [ 11.154016] Netfilter messages via NETLINK v0..
  199. [ 11.158777] nf_conntrack version 0.5. ( buckets, max)
  200. [ 11.165613] ctnetlink v0.: registering with nfnetlink.
  201. [ 11.170138] NF_TPROXY: Transparent proxy support initialized, version 4.1.
  202. [ 11.177066] NF_TPROXY: Copyright (c) - BalaBit IT Ltd.
  203. [ 11.183099] xt_time: kernel timezone is -
  204. [ 11.188633] ip_tables: (C) - Netfilter Core Team
  205. [ 11.192655] arp_tables: (C) David S. Miller
  206. [ 11.197162] TCP cubic registered
  207. [ 11.201199] NET: Registered protocol family
  208. [ 11.203347] mmc0:mshci_set_clock, @ration:,[mjdbg] cmu_set_clock:
  209. [ 11.215858] Mobile IPv6
  210. [ 11.216850] ip6_tables: (C) - Netfilter Core Team
  211. [ 11.222463] IPv6 over IPv4 tunneling driver
  212. [ 11.230913] NET: Registered protocol family
  213. [ 11.231511] mmc0: new high speed DDR MMC card at address
  214. [ 11.239693] NET: Registered protocol family
  215. [ 11.244078] can: controller area network core (rev abi )
  216. [ 11.244112] mmcblk0: mmc0: 4YMD3R 3.64 GiB
  217. [ 11.254848] NET: Registered protocol family
  218. [ 11.259204] can: raw protocol (rev )
  219. [ 11.259226] mmcblk0: p1 p2 p3 p4
  220. [ 11.266785] Bluetooth: RFCOMM TTY layer initialized
  221. [ 11.271605] Bluetooth: RFCOMM socket layer initialized
  222. [ 11.276685] Bluetooth: RFCOMM ver 1.11
  223. [ 11.280417] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
  224. [ 11.285710] Bluetooth: BNEP filters: protocol multicast
  225. [ 11.290944] NET: Registered protocol family
  226. [ 11.295062] *******mmc2: inserted!!!!!******
  227. [ 11.300641] EXYNOS4X12: Adaptive Support Voltage init
  228. [ 11.304623] EXYNOS4X12: IDS : HPM : RESULT :
  229. [ 11.309501] ************ exynos4x12_set_abb:0x0, 0x0, 0x0, 0x0, 0x80000088
  230. [ 11.316355] VFP support v0.: implementor architecture part variant rev
  231. [ 11.323999] Registering SWP/SWPB emulation handler
  232. [ 11.328769] DVFS : VDD_ARM Voltage table set with Group
  233. [ 11.334145] exynos4x12_cpufreq_init:topeet pop
  234. [ 11.338949] DVFS : VDD_INT Voltage table set with Group
  235. [ 11.340080] *******mmc2: inserted!!!!!******
  236. [ 11.385093] *******mmc2: inserted!!!!!******
  237. [ 11.410199] exynos4_integrated_dvfs_hotplug_init, max(),min()
  238. [ 11.419158] regulator_init_complete: VDD18_MIPI: incomplete constraints, leaving on
  239. [ 11.427135] regulator_init_complete: VDD10_MIPI: incomplete constraints, leaving on
  240. [ 11.433795] regulator_init_complete: VDD18_2M: incomplete constraints, leaving on
  241. [ 11.435150] *******mmc2: inserted!!!!!******
  242. [ 11.451794] regulator_init_complete: vdd_int range: incomplete constraints, leaving on
  243. [ 11.458720] regulator_init_complete: vdd_arm range: incomplete constraints, leaving on
  244. [ 11.466619] regulator_init_complete: vdd_mif range: incomplete constraints, leaving on
  245. [ 11.474585] USB_DEVICE_ATTACHED
  246. [ 11.478484] exynos_usb_Device: Exynos USB Device Driver
  247. [ 11.482408] value1 = , value2 = , type = 0x1
  248. [ 11.491830] ==ft5x0x_ts_init: reset==
  249. [ 11.820044] usb -: new high speed USB device number using s5p-ehci
  250. [ 11.955411] usb -: New USB device found, idVendor=, idProduct=, bcdDevice=a1a0
  251. [ 11.962042] usb -: New USB device strings: Mfr=, Product=, SerialNumber=
  252. [ 11.969160] usb -: New USB device Class: Class=, SubClass=, Protocol=
  253. [ 11.976587] hub -:1.0: USB hub found
  254. [ 11.979889] hub -:1.0: ports detected
  255. [ 12.025303] input: ft5x0x_ts as /devices/virtual/input/input2
  256. [ 12.035634] ft5x0x_ts -: Firmware version 0x06
  257. [ 12.039038] ft5x0x_ts -: FocalTech ft5x0x TouchScreen initialized
  258. [ 12.046790] -----time:s5m_rtc_read_time: // ::()
  259. [ 12.265183] usb -3.2: new high speed USB device number using s5p-ehci
  260. [ 12.375383] usb -3.2: config interface altsetting endpoint 0x83 has an invalid bInterval , changing to
  261. [ 12.467776] usb -3.2: New USB device found, idVendor=0a46, idProduct=, bcdDevice=
  262. [ 12.474586] usb -3.2: New USB device strings: Mfr=, Product=, SerialNumber=
  263. [ 12.495019] usb -3.2: New USB device Class: Class=, SubClass=, Protocol=
  264. [ 12.505883] dm962x: dm_read_reg() 0x29 0x0a
  265. [ 12.508757] dm962x: dm_read_reg() 0x28 0x46
  266. [ 12.512884] dm962x: dm_read_reg() 0x2b 0x96
  267. [ 12.517008] dm962x: dm_read_reg() 0x2a 0x21
  268. [ 12.521260] dm962x: dm_read_reg() 0xF2 0x00
  269. [ 12.525266] dm962x: [Analysis.] 0xF2, D[] OK
  270. [ 12.529941] dm962x: [Analysis.] 0xF2, D[] OK
  271. [ 12.534639] dm962x: [Analysis.] 0xF2, D[] EP1: Empty
  272. [ 12.540022] dm962x: [Analysis.] 0xF2, D[] OK
  273. [ 12.544697] dm962x: [Analysis.] 0xF2, D[] OK
  274. [ 12.549395] dm962x: [Analysis.] 0xF2, D[] OK
  275. [ 12.554082] dm962x: [Analysis.] 0xF2, D[] Status: TX buffer pkts
  276. [ 12.566384] dm962x: ethernet MAC address ::ff:ff:: (chip)
  277. [ 12.571383] dm962x: Mode =
  278. [ 12.588122] dm9620 -3.2:1.0: eth0: register 'dm9620' at usb-s5p-ehci-3.2, Davicom DM9620 USB Ethernet, ::ff:ff::
  279. [ 13.087605] Begin settime.......................................................................
  280. [ 13.094937] s3c_rtc_settime() -- ::
  281. [ 13.099450] writeb is Over.................
  282. [ 13.103447] settime---------s5m_rtc_set_time: // ::()
  283. [ 13.135058] s5m-rtc s5m-rtc: setting system clock to -- :: UTC ()
  284. [ 13.142183] FIMC0 registered successfully
  285. [ 13.146186] FIMC1 registered successfully
  286. [ 13.150028] FIMC2 registered successfully
  287. [ 13.154005] FIMC3 registered successfully
  288. [ 13.157928] S5P TVOUT Driver v3. (c) Samsung Electronics
  289. [ 13.189955] Freeing init memory: 220K
  290. [ 13.201285] init: init.wireless.rc: : invalid option 'chmod'
  291. [ 13.205801] init: init.wireless.rc: : ignored duplicate definition of service 'hfag'
  292. [ 13.213739] init: init.wireless.rc: : ignored duplicate definition of service 'hsag'
  293. [ 13.221725] init: init.wireless.rc: : ignored duplicate definition of service 'opush'
  294. [ 13.229797] init: init.wireless.rc: : ignored duplicate definition of service 'pbap'
  295. [ 13.237890] init: /init.smdk4x12.rc: : ignored duplicate definition of service 'console'
  296. [ 13.246148] init (): /proc//oom_adj is deprecated, please use /proc//oom_score_adj instead.
  297. [ 13.264185] MFC F/W loaded successfully (size: )
  298. [ 13.411506] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
  299. [ 13.591579] EXT4-fs (mmcblk0p3): warning: checktime reached, running e2fsck is recommended
  300. [ 13.600903] EXT4-fs (mmcblk0p3): recovery complete
  301. [ 13.606571] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: discard,noauto_da_alloc,nodelalloc
  302. [ 13.645873] EXT4-fs (mmcblk0p4): warning: checktime reached, running e2fsck is recommended
  303. [ 13.655171] EXT4-fs (mmcblk0p4): recovery complete
  304. [ 13.660863] EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Opts: nomblk_io_submit
  305. [ 13.698460] [HIF-SDIO][I]hif_sdio_init:start!
  306. [ 13.701609] [HIF-SDIO][I]hif_sdio_init:sdio_register_driver() ret=
  307. [ 13.738137] mtk_stp_wmt: module license 'Proprietary' taints kernel.
  308. [ 13.743099] Disabling lock debugging due to kernel taint
  309. [ 13.766663] [WMT-DEV][I]WMT_init:WMT Version= Combo WMT Driver - v4. DATE=//
  310. [ 13.773093] [PSM][I]stp_psm_init: psm init (0xbf0330e4, )
  311. [ 13.778931] [PSM][I]_stp_psm_init_monitor: init monitor
  312. [ 13.784188] [STPDbg]stp_dbg_init: stp-dbg init
  313. [ 13.788474] [STP-C][I]mtk_wcn_stp_dbg_enable:STP dbg mode is turned on
  314. [ 13.794958] [WMT-DEV][I]WMT_init:driver(major ) installed
  315. [ 13.800682] [WMT-DEV][I]wmt_dev_read_file:open (/system/etc/firmware/WMT.cfg) O_RDONLY,
  316. [ 13.814102] [WMT-CONF][I]wmt_conf_read_file:get full file name(/system/etc/firmware/WMT.cfg) buf(0xefec3000) size()
  317. [ 13.823821] [WMT-CONF][I]wmt_conf_read_file:&gDevWmt.rWmtGenConf=bf02f9bc
  318. [ 13.830275] [WMT-LIB][I]wmt_lib_init:set pwr on seq par to hw conf
  319. [ 13.836332] [WMT-LIB][I]wmt_lib_init:ldo()rst()on()off()rtc()
  320. [ 13.842506] [WMT-CMB-HW][I]mtk_wcn_cmb_hw_init:use default hw init sequence parameters
  321. [ 13.850382] [WMT-CMB-HW][I]mtk_wcn_cmb_hw_dmp_seq:combo chip power on sequence time, RTC (), LDO (), RST(), OFF(), ON()
  322. [ 13.862180] [WMT-PLAT][I]wmt_plat_init:set g_bgf_irq()
  323. [ 13.867554] [WMT-LIB][I]wmtd_thread:wmtd thread starts
  324. [ 13.872695] [WMT-DEV][I]WMT_init:success
  325. [ 13.882238] [STP-U][I]mtk_wcn_stp_uart_init:MTK STP UART driver
  326. [ 13.891842] mtk_stp_GPS_chrdev driver(major ) installed.
  327. [ 13.905334] [HCI-STP][I]hci_stp_init:HCI STP driver ver 2.0, hdev(0xd485c800), init done
  328. [ 13.930665] [D_INIT]mt_fm_probe()
  329. [ 13.932515] [D_MAIN]alloc fm::
  330. [ 13.936064] [D_INIT]create_proc_entry success
  331. [ 13.940255] [D_INIT]create_config_entry success
  332. [ 13.944747] [D_INIT]******fm config info******
  333. [ 13.949188] [D_INIT]***chip: MT6620
  334. [ 13.952747] [D_INIT]***band:
  335. [ 13.955871] [D_INIT]***freq_min:
  336. [ 13.959503] [D_INIT]***freq_max:
  337. [ 13.963248] [D_INIT]***scan_tbl:
  338. [ 13.966806] [D_INIT]***space:
  339. [ 13.970022] [D_INIT]***rssi_long: 0x0301
  340. [ 13.973999] [D_INIT]***rssi_short: 0x02e0
  341. [ 13.978091] [D_INIT]***CQI: 0x00e9
  342. [ 13.981562] [D_INIT]******fm config end******
  343. [ 13.990254] [D_INIT]mtk_fm_probe, FM probe ...
  344. [ 13.993229] [D_INIT]fm_priv_register(), [pri=0xd6041ed8][op=0xbf0afd84]
  345. [ 13.999852] [D_INIT]init, FM init ok
  346. [ 14.003396] [D_INIT]mtk_fm_probe, FM probe ok
  347. [ 14.012069] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major ) installed.
  348. [ 14.239239] [HIF-SDIO][I]mtk_wcn_hif_sdio_client_reg:start!
  349. [ 14.258310] init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
  350. [ 14.267461] adb_bind_config
  351. [ 14.270339] adb_open
  352. [ 14.271089] ADB open:/system/bin/sh: No controlling tty (open /dev/tty: No such device or
  353. [ 14.396445] [WMT-DEV][I]WMT_open:major minor (pid )
  354. [ 14.402289] [WMT-DEV][I]WMT_open:1st call ()
  355. [ 14.407010] [mtk_wcn_stp_set_if_tx_type] set STP_IF_TX to UART.
  356. address)
  357. /syst[ 14.413789] [WMT-LIB][I]wmt_lib_set_hif:new hifType:, fcCtrl:, baud:, fm:
  358. [ 14.422109] [WMT-C][I]opfunc_hif_conf:WMT HIF info added
  359. em/bin/sh: warning: won't have full job control
  360. [ 14.516143] warning: `rild' uses 32-bit capabilities (legacy support in use)
  361. root@android:/ # [ 15.041107] s3c-fimc3: FIMC3 opened.
  362. [ 15.673835] s3cfb s3cfb.: [fb0] dma: 0x690c4000, cpu: 0xf0cff000, size: 0x007d0000
  363. [ 15.686073] s3cfb s3cfb.: [fb1] dma: 0x69894000, cpu: 0xf14d0000, size: 0x007d0000
  364. [ 15.699196] s3c-fimc3: FIMC3 opened.
  365. [ 16.775048] Mali: :::exynos_result_of_asv :
  366. [ 16.777929] Mali: mali_dvfs[].vol =
  367. [ 16.782265] Mali: :::exynos_result_of_asv :
  368. [ 16.787742] Mali: mali_dvfs[].vol =
  369. [ 16.790639] Mali: :::exynos_result_of_asv :
  370. [ 16.794945] Mali: mali_dvfs[].vol =
  371. [ 16.794954] Mali: :::exynos_result_of_asv :
  372. [ 16.794960] Mali: mali_dvfs[].vol =
  373. [ 23.461949] request_suspend_state: wakeup (->) at (-- ::58.817585256 UTC)
  374. [ 23.723250] acc_open
  375. [ 23.723969] acc_release
  376. [ 28.460143] CPU1: shutdown
  377. [ 28.958936] CPU2: shutdown
  378. [ 31.157062] CPU3: shutdown

至此Android已成功启动,可以说Android系统是跑在Linux内核上的巨大的一个应用程序!

Android系统启动过程-uBoot+Kernel+Android的更多相关文章

  1. Android 系统启动过程简单记录

    本文记录Android系统启动过程,包含从linux kernerl到luancher启动完成的过程: 1.linux内核完成系统设置后,会在系统文件中寻找‘init’文件,然后启动root进程或者说 ...

  2. Android 深入浅出 - Android系统启动过程

    Activity的类继承关系及跟踪Activity的启动 Android系统启动过程 https://study.163.com/course/courseLearn.htm?courseId=213 ...

  3. Android系统启动过程[典☆☆☆]

    Android系统启动过程 首先Android框架架构图:(来自网上,我觉得这张图看起来很清晰) Linux内核启动之后就到Android Init进程,进而启动Android相关的服务和应用. 启动 ...

  4. Android系统启动过程【转】

    转自:http://www.cnblogs.com/bastard/archive/2012/08/28/2660389.html Android系统启动过程 首先Android框架架构图:(来自网上 ...

  5. Android 系统启动过程详解

    android 使用 linux 内核,一般运行在 ARM 体系架构上,android 设备启动的过程,应用层之下基本等同于linux, 从应用层第一个程序init开始有所区别,下面开始介绍. ste ...

  6. Android系统启动过程

    首先Android框架架构图: Linux内核启动之后就到Android Init进程,进而启动Android相关的服务和应用. 启动的过程如下图所示:(图片来自网上,后面有地址)   下面将从And ...

  7. Android系统启动过程全解析

    Android系统是一款基于Linux的移动操作系统,那么Android是如何启动起来的呢?本文就详细阐述Android系统的启动过程. 从内核之上,我们首先应该从文件系统的init开始,因为 ini ...

  8. 基于AR9331(MIPS架构)分析系统启动过程(uboot)

    前提: 1.AR9331是基于MIPS 24K CPU的一款WIFI1X1芯片,其SDK采用uboot作为引导.AR9331中定义的基地址是:0x9f00,0000 2.MIPS24K芯片,将固定的起 ...

  9. 你真的了解Android系统启动流程吗?Android高级工程师必看系列,已开源

    前言 从毕业到现在面试也就那么几家公司,单前几次都比较顺利,在面到第三家时都给到了我offer!前面两次找工作,没考虑到以后需要什么,自己的对未来的规划是什么,只要有份工作,工资符合自己的要求就行!所 ...

随机推荐

  1. c#启动EXE文件(简单的)

    在程序执行中会遇到启动本软件的exe问,或者启用其它的exe文件,已达到执行某些操作的作用.下面是两种最常见的启动exe文件. 1.调用系统dll使用其提供的方法. 引用的dll, [DllImpor ...

  2. .Net六大验证及使用方法

    C#包含有六种验证方式,分别为: 一.非空验证  RequiredFieldValidator. 二.对比验证 CompareValidator. 三.范围验证 RangeValidator. 四.正 ...

  3. C#获取硬件信息

    //硬件信息 public class GF_Hardware { /// <summary> /// cpu序列号 /// </summary> /// <return ...

  4. qt 1 qt开发中的窗口设计

    一个简单的qt界面 相应代码如下: setWindowTitle(tr("Sotware"));//设置窗体标题 ui->tabWidget->removeTab(); ...

  5. 【leetcode❤python】107. Binary Tree Level Order Traversal II

    #-*- coding: UTF-8 -*- # Definition for a binary tree node.# class TreeNode(object):#     def __init ...

  6. Problem W UVA 662 二十三 Fast Food

    Fast Food Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status P ...

  7. javascript 中函数eval()

    eval()函数可以把一个字符串当作一个JavaScript表达式一样去执行它. 我们常常在Javascript中间到Eval这个函数, 有些人觉得这个函数很奇怪,可以把一些字符串变的功能很强大 在我 ...

  8. 百度翻译word-wrap,页面错乱原因查找过程(已修复)

    今天群里有人发问, 进入百度翻译http://fanyi.baidu.com/#auto/zh/, 输入word-wrap,发现页面错乱. 寻找错乱原因. 上图 开始查找原因: 1.从请求入手 从ch ...

  9. [转] Java内部类详解

    作者:海子 出处:http://www.cnblogs.com/dolphin0520/ 本博客中未标明转载的文章归作者海子和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置 ...

  10. Redis基础知识之————使用技巧(持续更新中.....)

    一.key 设计技巧 把表名转换为key前缀 如, tag: 第2段放置用于区分区key的字段--对应mysql中的主键的列名,如userid 第3段放置主键值,如2,3,4...., a , b , ...