Linux start-kernel

linux2.6.30

  • init文件夹
n-ubuntu05@nubuntu05:linux-2.6.30.4$ tree init/
init/
├── calibrate.c
├── do_mounts.c
├── do_mounts.h
├── do_mounts_initrd.c
├── do_mounts_md.c
├── do_mounts_rd.c
├── initramfs.c
├── Kconfig
├── main.c
├── Makefile
├── noinitramfs.c
└── version.c
  • main.c:start_kernel()
asmlinkage void __init start_kernel(void) 
{
    smp_setup_processor_id();
    lockdep_init(); 
    debug_objects_early_init();
...
}

asmlinkage告诉编译器,函数参数不是用寄存器来传递的,而是用堆栈来传递。why?可以参考:http://bbs.chinaunix.net/thread-4152033-2-1.html

lockdep_init()在打开了CONFIG_LOCKDEP会调用,否则不执行任何操作;
debug_objects_early_init()在打开CONFIG_DEBUG_OBJECTS会调用,否则不执行任何操作。

posted @ 2019-07-12 15:15  SlamDunk_1016  阅读(130)  评论(0编辑  收藏  举报