LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   insmod: error inserting in 2.6 (https://www.linuxquestions.org/questions/linux-newbie-8/insmod-error-inserting-in-2-6-a-537394/)

masg 03-14-2007 08:53 AM

insmod: error inserting in 2.6
 
Hi,
I have compiled the code on 2.6 kernel. Compilation doesn't through any error. But, when i try to insert the module i get this error,
insmod ./hello.o
insmod: error inserting './hello.o': -1 Invalid module format
I read some of threads, the compilation in 2.6 kernel is different.
Can anyone let me know the difference in 2.4 and 2.6. or please let me know you to compile for 2.6.
If i compile same code in 2.4 it works fine.

Regards,
masg

Tinkster 03-15-2007 03:09 AM

Kernel 2.6 uses .ko not .o ... did you compile a 2.4 module
by accident?



Cheers,
Tink

fr33z 03-15-2007 08:16 PM

One more thing to say - it's much better to use modprobe instead of insmod

masonm 03-15-2007 08:45 PM

Typically you just use modprobe module_name without the .ko.

example: modprobe hello


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