Re: Regarding module init function

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

 



Ok. in init/main.c we call do_basic_setup(). Where do_initcalls call each of init functions from __early_initcall_end to __initcall_end. But I don't know from where these values gets initialized.

On Tue, Jan 8, 2013 at 2:10 PM, Rahul Bedarkar <rpal143@xxxxxxxxx> wrote:
I have gone through LDD3 page 31. But it didn't answer my question. It is describing module init and exit when manually loading driver and removing it. 
I want to know when one of auxdriver (selected in from menuconfig) is built as built-in module. When and Who calls it's init function ?

Thanks,
Rahul  

On Fri, Jan 4, 2013 at 6:52 PM, Tobias Boege <tobias@xxxxxxxxxxxxxx> wrote:
On Fri, 04 Jan 2013, Rahul Bedarkar wrote:
> Hi,
>
> This may be stupid question.
>
> When we compile external module and insert it, it's init function is called
> and when we remove it, it's exit function gets called.
>
> What happens in case of built-in modules? When it's init and exit is
> called? May be take example of one of auxdriver.
>

You can find relevant information in LDD3, pp. 31 ff.. Basically, there is
no difference in the use of the init function (it's called at kernel
startup, I suppose) but exit is simply discarded in this case, because if
your module is built-in, it could never be removed.

Regards,
Tobi


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[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