LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trying to understand kernel modules (https://www.linuxquestions.org/questions/linux-newbie-8/trying-to-understand-kernel-modules-662784/)

glenn69 08-14-2008 11:26 AM

Trying to understand kernel modules
 
Whenever I get an updated kernel, or compile a new one, I have to recompile various modules (ex..nvidia, wireless, etc..)

I think I understand the why..because the module no longer "fits" with new kernel.

But what exactly is produced when I recompile the module?

Does the recompiling (make && make install) overwrite the old module or does it create a new module in addition to the original?
If I recompile my nvidia, for example, will I have one fit for the previous kernel and one for the new kernel in my system?

Where are modules stored? I haven't had luck finding a directory full of modules.

Thanks

danboland 08-14-2008 11:34 AM

Was produced the the module binary file that can be loaded by the kernel.

Storage depends (i think) i distribution.

The modules are usually loaded from:
/lib/modules/<version>/
where version is your kernel version

glenn69 08-14-2008 01:26 PM

Not sure I understand your answer
Quote:

Was produced the the module binary file that can be loaded by the kernel
I believe you are stating that modules are binaries. But, if I recompile will it overwrite the original or is a new module created in addition to the original?

I ask because I want to know if I will cause problems with multiple modules that do the same things for different kernels

Thanks

H_TeXMeX_H 08-14-2008 02:54 PM

Modules are just parts of the kernel that are not built in, they are inserted into the kernel as needed or by you. Every time you change kernel versions or even reconfigure some major part of your current kernel (such as changing architecture) you must recompile the modules. So with the nvidia kernel modules, every time you change kernels you will have to compile and install a whole new module, the old one has no way of working and will be overwritten. As danboland said modules are stored in '/lib/modules/$(uname -r)/kernel'. If you'll notice a new kernel version will make it's own separate directory in '/lib/modules' for its modules. I usually delete old modules anyway.

glenn69 08-14-2008 06:18 PM

Thanks, that clears it up


All times are GMT -5. The time now is 03:35 AM.