LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LKM (https://www.linuxquestions.org/questions/linux-newbie-8/lkm-901057/)

gvassallo 09-04-2011 11:37 AM

LKM
 
Are LKM backwards compatible relative to the version of the kernel they had been built under? One would guess that the answer is yes within limits. Otherwise how would H/W vendors distribute their products. However, I have had some trouble loading a driver built using 2.6.40 onto a 2.6.38 kernel as well as a 3.0 kernel. It loads on to a 2.6.40 kernel and operates as expected. Any comments relative to loading LKMs are welcomed.

Thanks

jdkaye 09-04-2011 11:45 AM

Hi and Welcome to LQ!
The kernel modules are kernel specific. They are either provided directly by the kernel or built using the header files for the specific kernel you are using. If you want to run a module on a 3.0 kernel you have to build it on that kernel. Hope that's clear.
ciao,
jdk

gvassallo 09-04-2011 01:20 PM

Grazie JDK,

That is unfortunate and I guess that if I want my LKM to be distributed I'll need to submit it into the source tree. Is that a correct assumption?

Ciao
GV

jdkaye 09-04-2011 02:02 PM

Prego,
I don't think so. If the module is integrated into the kernel then its capabilities remain. The end user doesn't need to do anything. If it worked before it works which each new kernel. If you compile your own module then you'll get the new header files along with the new kernel (I do this) and again, it's no big deal. Tranquillo! :) I suppose you could compile it yourself for each new kernel that's released but that is a big deal. But what's wrong with releasing your source code? I don't see the problem.
ciao,
jdk

gvassallo 09-04-2011 04:51 PM

Hello,

Its not that I do not want to submit my source code its just that I was surprised by the (implied)requirement to do so.
Thanks again for your thoughtful and quick reply.

jdkaye 09-05-2011 12:00 AM

You're welcome again but remember Linux unlike MacOS servers a huge number of different architectures. If you want your application to be available for ALL Linux users and you require a special module for it to run you have two options:
1. Convince the kernel developers to include your module in the kernel. But the kernel source code is available and so your module's source code would be available.
2. If you wish to supply your software to all architectures then you would make the source code available or be prepared to do a huge amount of cross-compiling.
Do you see a sane way to distribute your kernel module without contributing the source code? Maybe I'm just being stupid but I don't see how you could do it. I still don't understand why distributing source code would be a problem even if it weren't necessary.
ciao,
jdk


All times are GMT -5. The time now is 02:33 AM.