LinuxQuestions.org
Visit Jeremy's Blog.
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 07-10-2008, 03:16 PM   #1
linlax
LQ Newbie
 
Registered: Jul 2008
Posts: 2

Rep: Reputation: 0
device driver help


hi I am new to linux. i am getting problem whil compiling driver modules.i have tried with fedora6, 8.but i dont have linux/init.h, linux/module.h even after installing kernel devl rpm.

but i found them in fedora3. but compilation failed due to linkerror.that iincluded the code here

#include <linux/init.h>
#include <linux/module.h>
#inclulde <linuk/kernel.h>

MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
printk("<1> Hello world\n");
retrun 0;
}
static void hello_exit(void)
{
printk("<1>cruel world\n");
}

module_init(hello_init);
module_exit(hello_exit);


the above is simple one..
help me, where i have to start and what is wrong with me

thanks
 
Old 07-11-2008, 05:25 AM   #2
a_m0d
Member
 
Registered: Apr 2007
Location: Perth, WA, Australia
Distribution: Fedora 8, Fedora 10
Posts: 49

Rep: Reputation: 15
Have you got the right development files for your system?
Try
Code:
sudo yum install kernel-devel
or
Code:
sudo yum update kernel-devel
if you already have it, then try again.
 
Old 07-11-2008, 05:30 AM   #3
Anttim
LQ Newbie
 
Registered: Jul 2008
Location: Finland
Distribution: Debian (Sid)
Posts: 8

Rep: Reputation: 0
Hi,

Most device drivers are built into the kernel itself. Most likely you should be looking for a package with kernel sources for the kernel you are running. Generally it is not good idea to mix kernel header files from one version to another. You can check the exact version you are running with command 'uname -r'. Then try to locate either the kernel headers package or entire kernel sources for that version.

BR,
Antti
 
  


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
Multiple Device driver from single device driver???? rickhg12hs Linux - Kernel 3 05-25-2008 01:11 AM
how to use a device driver guptarai Programming 2 10-15-2007 10:56 PM
Device Driver.? amit_linux Linux - Software 3 05-31-2007 11:47 AM
device driver jful99 Programming 6 10-09-2005 01:34 AM
device driver yanw Linux - Hardware 1 01-23-2003 10:00 AM


All times are GMT -5. The time now is 12:53 PM.

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