Results 1 to 6 of 6
Hi,
I m new for this forum. wrote a hello.c kernel program while insmod hello.o, i am getting the message like "couldn't find the kernel version the module was compiled ...
- 06-29-2007 #1Just Joined!
- Join Date
- Jun 2007
- Posts
- 4
couldn't find the kernel version the module was compiled for!
Hi,
I m new for this forum. wrote a hello.c kernel program while insmod hello.o, i am getting the message like "couldn't find the kernel version the module was compiled for".
i didn't compile the kernel(2.4.20-
, using already present with red hat linux.
Please help me regarding this issue.
- 06-29-2007 #2Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
Linux introduces with version 2.6 a new file naming convention, kernel modules now have a .ko extension instead of the old .o extension.
Try:
RegardsCode:insmod hello.ko
- 06-30-2007 #3Just Joined!
- Join Date
- Jun 2007
- Posts
- 4
Thanks for reply. but my kernel version is 2.4 and how to make .ko any option with gcc command or mv .o to .ko??
- 06-30-2007 #4Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
I apologize, I didn't read the question well, you have to insmod the .o module in version 2.4.
Did you compile the module with the source/headers that match your kernel version?
Check the version number in /usr/src and compare it with the output of the command:RegardsCode:uname -r
- 07-03-2007 #5Just Joined!
- Join Date
- Jun 2007
- Posts
- 4
I compile with below option, but i checked /lib/modules/2.4.20.8/build/include/ doesn't exist. 2.4.20.8 is the ouput of uname -r.
in /usr/src nothing is there like 2.4.20.8, its the output ofCode:INCLUDE = -isystem /lib/modules/`uname -r`/build/include/ CFLAGS = -O3 -DMODULE -D__KERNEL__ $(INCLUDE)
i didn't compile the kernel, using already existing.Code:uname -r
- 07-06-2007 #6Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
Do you have the kernel-headers/source installed? If not, try to Google for how to install the proper version for your distro.
Regards


Reply With Quote
