Re: A confusion in kernel module concepts and a problem case

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

 





On Sun, Jun 20, 2010 at 9:10 AM, Joel Fernandes <agnel.joel@xxxxxxxxx> wrote:
> If a kernel code requires an external loadable module then will it get
> loaded automatically?

Yes it will be, after you install a module, depmod is run which
generates a file called modules.dep . modules.dep lists all
dependencies for every module. These dependencies are then
automatically  loaded by modprobe when you try to load the actual
module.


Actually the kernel code that I am replacing with my module initializes earlier at kernel load and starts functioning and if my module is not available at that time than it will crash or do something which I don't want it to do.
 
> If the code requires the kernel module much earlier
> than the filesystem is loaded and the module is made available than I should
> provide it earlier. This should require to make the external module be part
> of the kernel. So how might I do this?

First of all, is the code going to be used again after it is used
once? If not, then it is probably a better idea to include the kernel
module in an initial ram disk (initrd). This solves both the problems
- of loading a kernel module before the FS module on which it resides
is loaded, and at the same time not being forced to include the module
within the kernel itself.


So will the initrd based solution be effective because initrd is loaded by boot-loader and then the kernel uses it. Is there some way to keep on hold the kernel code till my module is loaded if this is not effective?

Else I need to make my module part of the kernel. Do I need to change the Makefiles for this apart from adding and connecting the Kconfigs? Noth external and internal modules use kbuild so the Makefile should not be a problem theoretically. But I am trying it since last night and it seems the Makefile needs to be changed. The recursive nature might be giving problem but the code does not get compiled at all!


--
Shaz


[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