-   Linux - Software (
-   -   Can't load module :error kernel version mismatch (

garv 04-05-2004 04:24 AM

Can't load module :error kernel version mismatch
I am a newbie device writer thus from ' Linux Device Writers' I took the first code

#define MODULE
#include <linux/module.h>

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

compiled it with gcc(storing this as test.c) and then ran the command: insmod ./test.o

but instead of Hello,world I got the following message:

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

System:AMD Athlon 1800+,128MB ,etc

i don't want to use -f option. Rubini suggests to compile own kernel without version support,
but how do i do it.

thank you

AutOPSY 04-05-2004 12:47 PM

cd to /usr/src/linux-2.4.20-8

type make menuconfig

in the kernel options it will say
loadable module support blah blah.

enable module informnation on all modules. set this to no.

Otherwise get the right kernel sources and when compiling specify those sources.

All times are GMT -5. The time now is 11:27 PM.