LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-16-2003, 07:59 AM   #1
pessanimahi
LQ Newbie
 
Registered: Sep 2003
Posts: 18

Rep: Reputation: 0
creating a simple module(device driver)


Iam getting an error while linking the following module to my kernel......

//module.c

#define MODULE
#include<linux/module.h>
#include<linux/kernel.h>

int init_module()
{
printk("<1> HEllo my boss\n");
return 0;
}

void cleanup_module()
{

printk("<1> good bye my boss");
}

i can able to compile success fully...

# gcc -c module.c

but when iam trying to insert this module....
# insmod ./module.o

Iam getting this erro..
your kernel is mismatched..
your kernel version is 2.4.0-20.this is compiled for
2.4.0 on linux 9.0...

even i tried on linux 7.0 here also iam getting same error..
your kernel is mismatched..
your kernel version is 2.....this is compiled for
2.4.0 on linux 7.0...


can any one help for this experts..
-------------
mahi
 
Old 09-16-2003, 11:34 AM   #2
louisbyrne
LQ Newbie
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian, Slackware, RedHat
Posts: 7

Rep: Reputation: 0
Why don't trying the force switch
insmod -f module.o
 
  


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
C++ or pure C for Linux kernel module, Linux device driver development. What to use? Igor007 Programming 91 07-19-2014 11:55 AM
Problem in inserting a device driver module rajesh_b Programming 5 05-10-2007 12:20 AM
problems creating a simple bootable cd to perform a simple task czarherr Linux - Software 1 11-11-2004 05:22 AM
simple hello.c device driver for 2.6 kernel blavo Programming 29 06-30-2004 05:42 AM
Installing a device driver as a Module lehumphr Linux - Newbie 1 04-27-2004 11:31 PM


All times are GMT -5. The time now is 11:36 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration