Re: changes required for making modular driver -> a buitl-in one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 05 October 2004 10:30, Mandeep Sandhu wrote:

> just a small Q. what are the changes required for making a modular
> driver a built-in one??? Are the entry/exit points of a module
> ([init/cleanup]_module) called for a built-in one too? I think the
> answer wud be no....but i'm not too sure. What fxn.s are called

  The init / cleanup functions are called even in built-in case. Have a look 
at include/linux/init.h. The __init macro is what handles the job. In case a 
component is built as a module, these reduce to nothing. In case it is built 
in to the main kernel, the __init macro effectively puts that function into 
the text init portion

#define __init          __attribute__ ((__section__ (".init.text")))

  Now, when the kernel boots up, there is a call to do_initcalls() from 
do_basic_setup(). This function calls each of the functions in the .init.text 
section (the for loop) and thus initializes the components.

  The above is my understanding.. do correct me if anything is wrong.

-- 
Regards,
Kiran Kumar Immidi

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux