LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   insmod: error inserting 'module.o': -1 Invalid module format (https://www.linuxquestions.org/questions/linux-newbie-8/insmod-error-inserting-module-o-1-invalid-module-format-490296/)

ksrinivas 10-07-2006 06:33 AM

insmod: error inserting 'module.o': -1 Invalid module format
 
Hi,

I am novice to Linux.I have compiled a hello world module and inserted into Linux kernel (version 2.6.9-22.EL). But when i insert
*.o or *.ko it is giving error message as "insmod: error inserting 'module.o': -1 Invalid module format"

dmesg:
module: disagrees about version of symbol struct_module

Can anybody guide me about how to resolve this?

Thanks & Regards,
Srinivas

stress_junkie 10-07-2006 02:39 PM

Try using modprobe instead of insmod.

I don't believe that you can use a wildcard in the module name.

The module may have to be listed in /lib/modules/*/modules.dep. I don't know.

Mara 10-07-2006 02:53 PM

Quote:

dmesg:
module: disagrees about version of symbol struct_module
It gives a hint. Are you really sure you're compiling your module using the kernel you're currently using?

ksrinivas 10-08-2006 06:08 AM

Hi Mara,

Your hint helped to compile but when i am tyring to insert the module, i am getting error and dmesg is giving the following info.

tempmodule: Unknown symbol EnableDigit
tempmodule: Unknown symbol DisableDigit
tempmodule: Unknown symbol DevWrite
tempmodule: Unknown symbol DevRead
tempmodule: Unknown symbol puts

Can you please let me know what could be the reason ?

Thanks
Srinivas

Mara 10-08-2006 01:08 PM

They do not look like kernel functions/structures ('puts' is another story). My guess is that you use your own functions (cusom library?) that's not linked with the module. It seems that the functions are simple, so just add source file with them to your module.

But, where and why do you use 'puts'?

ksrinivas 10-11-2006 07:29 AM

You are right. I have defined the functions locally. But i am not sure from where 'puts' has come. Now i could able to compile and insert.

Thanks for the support.


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