Dear friends, I want to know the basics xx_initcall ( ) in linux kernel. How this function works ? Observed in kernel code, many places late_initcall ( ), early_initcall ( ), arch_initcall ( ), core_initcall ( ) gets called. When did all these functions gets call during kernel initialization ? I am more interested in what is the sequence of these functions gets called one after another. Thank you. Regards, Sumeet
Hi Sumeet, On Wednesday 13 July 2011 04:12 PM, sumeet linux wrote:
Dear friends,
I want to know the basics xx_initcall ( ) in linux kernel. How this function works ? Observed in kernel code, many places late_initcall ( ), early_initcall ( ), arch_initcall ( ), core_initcall ( ) gets called. When did all these functions gets call during kernel initialization ? I am more interested in what is the sequence of these functions gets called one after another. I could get a nice link explaining about *_initcall(). Refer: http://book.opensourceproject.org.cn/embedded/embeddedprime/opensource/01361...
*_initcall() are macros which set the function pointers for subsystem initialization (typedef int (*initcall_t)(void) : typedef of all such function pointers). Also if we look at the source code, the functions are called in below sequence: http://lxr.linux.no/#linux+v2.6.39/init/main.c#L695 do_basic_setup(void) -> do_initcalls(void) -> do_one_initcall(*fn); do_one_initcall(*fn) - calls each function. And do_basic_setup() is called inside the initialization sequence (kernel_init()).
Thank you.
Regards, Sumeet
-- Thanks, Nilesh
On Wed, Jul 13, 2011 at 4:09 AM, nilesh <nilesh.tayade@netscout.com> wrote:
Hi Sumeet,
On Wednesday 13 July 2011 04:12 PM, sumeet linux wrote:
Dear friends,
I want to know the basics xx_initcall ( ) in linux kernel. How this function works ? Observed in kernel code, many places late_initcall ( ), early_initcall ( ), arch_initcall ( ), core_initcall ( ) gets called. When did all these functions gets call during kernel initialization ? I am more interested in what is the sequence of these functions gets called one after another. I could get a nice link explaining about *_initcall(). Refer:
http://book.opensourceproject.org.cn/embedded/embeddedprime/opensource/01361...
*_initcall() are macros which set the function pointers for subsystem initialization (typedef int (*initcall_t)(void) : typedef of all such function pointers). Also if we look at the source code, the functions are called in below sequence: http://lxr.linux.no/#linux+v2.6.39/init/main.c#L695
do_basic_setup(void) -> do_initcalls(void) -> do_one_initcall(*fn); do_one_initcall(*fn) - calls each function. And do_basic_setup() is called inside the initialization sequence (kernel_init()).
Thank you.
Regards, Sumeet
-- Thanks, Nilesh
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Hi, I hope this will help you to get a basic understanding of init call. http://www.embedded-bits.co.uk/2008/init-call-mechanism/ -- With Regards Subin Gangadharan Everything should be made as simple as possible,but not simpler.
participants (3)
-
nilesh -
subin gangadharan -
sumeet linux