Module Programming: module version vs. kernel version

Module Programming: module version vs. kernel version

Post by Crystal Lu » Wed, 21 Feb 2001 13:16:11



Dear all,

I've just started learning kernel programming on Linux. I just tried an
example "hello, world" module program. The program looks like:
#define MODULE
#include <linux/module.h>
int init_module(void)
{ print out a hello message}
void cleanup_module(void)
{print out a goodbye message}

It can be compiled into .o but when I tried to insmod, I got this error
message:
module compiled for kernel version 2.4.0-xxx
kernel version is 2.2.16-xxx

I have no clue how to fix it. Please help. Thank you very much.

Crystal

 
 
 

Module Programming: module version vs. kernel version

Post by Aminudin Khali » Thu, 22 Feb 2001 00:16:17


#define __NO_VERSION__


> Dear all,

> I've just started learning kernel programming on Linux. I just tried an
> example "hello, world" module program. The program looks like:
> #define MODULE
> #include <linux/module.h>
> int init_module(void)
> { print out a hello message}
> void cleanup_module(void)
> {print out a goodbye message}

> It can be compiled into .o but when I tried to insmod, I got this error
> message:
> module compiled for kernel version 2.4.0-xxx
> kernel version is 2.2.16-xxx

> I have no clue how to fix it. Please help. Thank you very much.

> Crystal

--
Mohd. Aminudin bin Mohd. Khalid
System Software Development
MIMOS

 
 
 

Module Programming: module version vs. kernel version

Post by Igor Lauta » Thu, 22 Feb 2001 02:42:14


give your comiler additional flag, -I/usr/src/linux/include/
where that dir is the source of your kernel.


Quote:> Dear all,

> I've just started learning kernel programming on Linux. I just tried an
> example "hello, world" module program. The program looks like:
> #define MODULE
> #include <linux/module.h>
> int init_module(void)
> { print out a hello message}
> void cleanup_module(void)
> {print out a goodbye message}

> It can be compiled into .o but when I tried to insmod, I got this error
> message:
> module compiled for kernel version 2.4.0-xxx
> kernel version is 2.2.16-xxx

> I have no clue how to fix it. Please help. Thank you very much.

> Crystal

 
 
 

1. loading version nonsensitive module into version sensitive kernel?

Hi!

We have a driver which (unfortunately) is not open source.
We deliver this driver in binary format (as an rpm) to customers.
Customers sometimes add patches or use newer kernels than what
we compiled with. With versioning (which is default on and *mostly* a
good thing in my opinion) symbol names change and our driver module does
not load. We do not wish to tell our customers to disable versioning.
Is there any way of getting around this?

Our only option at this time seems to be demangling the ksyms
and our module symbols, match them and replace the module symbol
references with the new ones in ksyms (using libbfd or some such).
Not an ideal solution...

What is the "correct" way of doing it? Even with open source kernel
external modules one would like to be able to avoid recompiling them
after doing a minor change in the kernel configuration??

Enlighten me, but please be gentle ;-)

Sincerely
--
 Rolf Welde Skeie              Senior Design Engineer
_____________________________________________________________________

 Tlf   : (+47) 6384 6705       Hvamstubben 17                  oo
 Fax   : (+47) 6384 4005       2013 Skjetten      __________ m/V\> _
 Home  : (+47) 2214 8987       NORWAY               . . :: . 077-0
 Mob   : (+47) 9248 4511                      ----------------------

2. Newbie question - problems booting

3. beginner module question: kernel-module version mismatch

4. Avoid ather tasks running.

5. load module error--kernel-module version mismatch

6. Word Processing Shareware

7. LINUX LAN using a IPX protcol

8. xfree86 update fails (module ABI minor Version is newer than the server's version)

9. How does module version / kernnel version system work?

10. Module rewrite 13/20: Module versions

11. conf.modules vs. modules.conf & modules.dep??

12. Kernel Module != Kernel Version ???