LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 05-14-2011, 01:29 PM   #1
dipanmodi
LQ Newbie
 
Registered: May 2011
Posts: 2

Rep: Reputation: 0
insmod: error inserting './hello.ko': -1 Invalid module format


Hello sir,

I have latest kernel 2.6.38.6 and working on mandriva. Now i am trying with example hello world as available in book (linux device driver by Rubini, corbet)
But I am surprised here "insmod" is not supporting ".ko " file format. previously i was working by this method only.
so please give me solution with explanation( if possible)
Exact error is mentioned here for reference

Quote:
root@localhost ldd]# make
make -C /home/dipan/linux/linux-2.6.38.6 SUBDIRS=/home/dipan/ldd modules
make[1]: Entering directory `/home/dipan/linux/linux-2.6.38.6'
Building modules, stage 2.
MODPOST 1 modules
make[1]: Leaving directory `/home/dipan/linux/linux-2.6.38.6'

[root@localhost ldd]# insmod ./hello.ko
insmod: error inserting './hello.ko': -1 Invalid module format
Thank you
[EMAIL="modipan@gmail.com"]
 
Old 05-14-2011, 01:47 PM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
...the only thing I can come up with is that the module you made does not have the expected format, hence is not accepted as a kernel module...

I flipped tru the book, are you at page 15? The output is hello.o and not hello.ko, maybe a compile setting error?

Device drivers/kernel modules. The latter has KO as extention...read up on an other page...

Luck!

Thor
 
Old 05-14-2011, 02:42 PM   #3
dipanmodi
LQ Newbie
 
Registered: May 2011
Posts: 2

Original Poster
Rep: Reputation: 0
thanks for replying sir,

i got hint from another thread same like this.

dmesg:
module: disagrees about version of symbol struct_module

it was different kernel version.

now i am able to insert the module.
 
Old 05-14-2011, 02:44 PM   #4
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Great!

Good luck with the studies!

Thor
 
  


Reply



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
[SOLVED] insmod: error inserting 'vntwusb.ko' : -1 Invalid module format NightHorse Slackware 4 06-23-2009 11:33 AM
insmod: error inserting 'usbip.ko': -1 Invalid module format barunparichha Linux - Software 1 01-13-2007 08:51 PM
insmod: error inserting 'module.o': -1 Invalid module format ksrinivas Linux - Newbie 5 10-11-2006 07:29 AM
insmod: error inserting 'new.ko': -1 Invalid module format hemk76 Programming 2 01-26-2005 10:52 AM
insmod: error inserting 'new.ko': -1 Invalid module format hemk76 Programming 2 01-24-2005 10:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 05:14 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration