LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   insmod problem (https://www.linuxquestions.org/questions/programming-9/insmod-problem-339685/)

hetzme 07-03-2005 04:49 PM

insmod problem
 
I am using redhat 9.

I copiled a module "test.o". When tried to insert it by calling

"insmod test.o"

it is complaining. Below is the error message:

test.o: kerner-module version mismatch
test.o was compiled for kerner version 2.4.20
while this kerner is version 2.4.20-8.



Could anyone help me with this issue and guide me so that I can test these module.

Tahnks.

exvor 07-03-2005 04:52 PM

you can force the module to load with the -f option

hetzme 07-12-2005 11:44 PM

I tried it. I did not get expected result. When I ran "insmod" I expected to see "Hello, World" and when I ran "rmmod" I expected to see "Goodbye cruel world". I did not see these messages. Could you please tell me whats happening there.


Below is my program:
==================
#define MODULE
#include <linux/module.h>

int init_module(void) {printk("<1>Hello, World\n"); return 0; }
void cleanup_module(void) {printk ("<1>Goodbye cruel world\n"); }



Below is what I tried:
=================

[root@localhost devicedrivers]# ls
test1.c test1.o
[root@localhost devicedrivers]# insmod test1.o
test1.o: kernel-module version mismatch
test1.o was compiled for kernel version 2.4.20
while this kernel is version 2.4.20-8.
[root@localhost devicedrivers]# insmod -f test1.o
Warning: kernel-module version mismatch
test1.o was compiled for kernel version 2.4.20
while this kernel is version 2.4.20-8
Warning: loading test1.o will taint the kernel: no license
See http://www.tux.org/lkml/#export-tainted for information about tainted modules
Warning: loading test1.o will taint the kernel: forced load
Module test1 loaded, with warnings
[root@localhost devicedrivers]#
[root@localhost devicedrivers]# rmmod test1
[root@localhost devicedrivers]#


All times are GMT -5. The time now is 07:29 AM.