15 October 2009

linux module initialisation

1. “module_init” and “__initcall” will be added into a new section called “.initcall6.init”

2. The macro “__initcall” and “module_init” (include/linux/init.h) will group all such functions into a single section called “.initcall6.init” and all these functions get executed on system bootup by the function “do_initcalls” (init/main.c)

3. init() -> do_basic_setup() -> do_initcalls()

4. The functions will be collected between the symbols “__early_initcall_end” and “__initcall_end” in the file (arch/x86/kernel/vmlinux.lds.S -> arch/x86/kernel/vmlinux.lds)

5. All the __initcalls are arranged in kernel the range from 0 to 7. Hence kernel does the initialization in order

No comments:

Post a Comment