adr r4, __secondary_data
ldmia r4,{r5, r7, r13} @ address to jump to after
sub r4, r4, r5 @ mmu has been enabled
ldr r4,[r7, r4] @ get secondary_data.pgdir
adr lr, __enable_mmu @ return address
add pc, r10, #PROCINFO_INITFUNC @ initialise processor
@ (return control reg)
跳转到start kernel(内核的第一个C函数,处理启动参数)
b start_kernel
main.c(init)
/*启动流程
start_kernel
setup_arch 解析UBOOT传入的启动参数
setup_command_line 解析UBOOT传入的启动参数
parse_early_param
do_early_para
从_setup_start到_setup_end,调用early函数
unknown_bootoption
obsolete_checksetup
从_setup_start到_setup_end,调用early函数
rest_init
kernel_init
prepare_namespace
mount_root 挂载根文件系统
init_post 执行应用程序
*/char* command_line;externstruct kernel_param __start___param[], __stop___param[];smp_setup_processor_id();/*
* Need to run as early as possible, to initialize the
* lockdep hash:
*/unwind_init();lockdep_init();local_irq_disable();early_boot_irqs_off();early_init_irq_lock_class();/*
* Interrupts are still disabled. Do necessary setups, then
* enable them
*/lock_kernel();tick_init();boot_cpu_init();page_address_init();printk(KERN_NOTICE);printk(linux_banner);setup_arch(&command_line);setup_command_line(command_line);unwind_setup();setup_per_cpu_areas();smp_prepare_boot_cpu();/* arch-specific boot-cpu hooks *//*
* Set up the scheduler prior starting any interrupts (such as the
* timer interrupt). Full topology setup happens at smp_init()
* time - but meanwhile we still have a functioning scheduler.
*/sched_init();/*
* Disable preemption - early bootup scheduling is extremely
* fragile until we cpu_idle() for the first time.
*/preempt_disable();build_all_zonelists();page_alloc_init();printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line);parse_early_param();parse_args("Booting kernel", static_command_line, __start___param,
__stop___param - __start___param,&unknown_bootoption);if(!irqs_disabled()){printk(KERN_WARNING "start_kernel(): bug: interrupts were ""enabled *very* early, fixing it\n");local_irq_disable();}sort_main_extable();trap_init();rcu_init();init_IRQ();pidhash_init();init_timers();hrtimers_init();softirq_init();timekeeping_init();time_init();profile_init();if(!irqs_disabled())printk("start_kernel(): bug: interrupts were enabled early\n");early_boot_irqs_on();local_irq_enable();