文件:init/main.c
start_kernel
==> setup_arch(&command_line);
文件:arch/arm/kernel/setup.c
setup_arch
/*
* Set up various architecture-specific pointers
*/
init_arch_irq = mdesc->init_irq;
system_timer = mdesc->timer;
init_machine = mdesc->init_machine;
文件:arch/arm/kernel/setup.c
static int __init customize_machine(void)
{
/* customizes platform devices, or adds new ones */
if (init_machine)
init_machine();
return 0;
}
arch_initcall(customize_machine);
定义在了initcall里,所以他将和驱动程序一样在内核线程kernel_init中完成
start_kernel
==> rest_init
==*> kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND); 创建内核线程
kernel_init
==> do_basic_setup
==*> do_initcalls
static void __init do_initcalls(void)
{
initcall_t *call;
for (call = __early_initcall_end; call < __initcall_end; call++)
do_one_initcall(*call); // 将按照排序规则在相应的存储位置执行函数customize_machine()
/* Make sure there is no pending stuff from the initcall sequence */
flush_scheduled_work();
}
MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
/* Maintainer: Toufeeq Hussain */
.phys_io = EP93XX_APB_PHYS_BASE,
.io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
.boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.timer = &ep93xx_timer,
.init_machine = edb9312_init_machine,[luther.gliethttp]
MACHINE_END
阅读(2334) | 评论(0) | 转发(0) |