LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-07-2006, 06:33 AM   #1
ksrinivas
LQ Newbie
 
Registered: Sep 2006
Posts: 15

Rep: Reputation: 0
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
 
Old 10-07-2006, 02:39 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
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.
 
Old 10-07-2006, 02:53 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,537

Rep: Reputation: 149Reputation: 149
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?
 
Old 10-08-2006, 06:08 AM   #4
ksrinivas
LQ Newbie
 
Registered: Sep 2006
Posts: 15

Original Poster
Rep: Reputation: 0
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
 
Old 10-08-2006, 01:08 PM   #5
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,537

Rep: Reputation: 149Reputation: 149
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'?
 
Old 10-11-2006, 07:29 AM   #6
ksrinivas
LQ Newbie
 
Registered: Sep 2006
Posts: 15

Original Poster
Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
insmod: error inserting 'new.ko': -1 Invalid module format hemk76 Programming 2 01-26-2005 10:52 AM
insmod invalid module format csfalcon Linux - Hardware 6 01-24-2005 11:03 AM
insmod: error inserting 'new.ko': -1 Invalid module format hemk76 Programming 2 01-24-2005 10:42 AM
'Invalid module format' loading simple module on Suse Linux Professional 9.1 rocketdude Linux - Distributions 3 07-27-2004 11:40 PM
invalid module format powadha Slackware 5 12-25-2003 04:19 PM


All times are GMT -5. The time now is 09:39 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration