Page 1 of 1

module is part of kernel not as ld-able module, where is it

Posted: Wed Oct 02, 2019 6:14 pm
by ggodw000
i have a new kernel version where when I was using its previous version, I had load the module driver using modprobe <module_name> as well as used with other associated commands i.e. modinfo <modulename>.

Now newer version of kernel has no longer ship the <module_name> module as a loadable module and instead they made it the part of the kernel. Now with this new kernel version, I see modprobe does not work apparently as it complains that it does not exist in /lib/modules/<kernel_ver>/.

Now the question is that if it remains as part of the kernel, where does to module reside? Thanks.,

Re: module is part of kernel not as ld-able module, where is

Posted: Wed Oct 02, 2019 6:42 pm
by klange
I'm going to assume you're talking about Linux. You never actually said anywhere in your post that you were, but it seems like a logical inference.

Linux kernel modules are object files, effectively the same as any .o file your compiler would normally produce and later link together to form an executable.

When a kernel module is compiled into the kernel, it's linked into the kernel binary like any other object file. When it's compiled as a loadable module, the kernel links it at run time.

Where does it end up in the former case? Who knows! It's up to the linker.

Re: module is part of kernel not as ld-able module, where is

Posted: Thu Oct 03, 2019 1:15 am
by iansjack
The module doesn't reside anywhere - it doesn't exist.

The code that performs the function that the module performed resides in the kernel executable - normally vmlinuz, although it may have different names on different systems.

Re: module is part of kernel not as ld-able module, where is

Posted: Fri Oct 04, 2019 1:07 am
by linguofreak
ggodw000 wrote:i have a new kernel version where when I was using its previous version, I had load the module driver using modprobe <module_name> as well as used with other associated commands i.e. modinfo <modulename>.

Now newer version of kernel has no longer ship the <module_name> module as a loadable module and instead they made it the part of the kernel. Now with this new kernel version, I see modprobe does not work apparently as it complains that it does not exist in /lib/modules/<kernel_ver>/.

Now the question is that if it remains as part of the kernel, where does to module reside? Thanks.,
A kernel module is a piece of kernel functionality that has been compiled so as to be in a separate file from the kernel itself. If the code in question has been compiled into the kernel, it is, by definition, not a module, and resides in the kernel executable with all the rest of the non-module code.