LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 05-12-2008, 07:53 AM   #1
siddhi817
LQ Newbie
 
Registered: May 2008
Posts: 4

Rep: Reputation: 0
Unhappy bug me out


I m a rookie in linux fc7..trying to compile a c code for building a dummy network device driver. . but whenever I try to compile the code , I get a long list of errors. firstly it says that header files not found...someone suggested to install glibc-devel package for inclusion of header files in gcc...I did download the package but it failed to install as it required dependencies...now I m in dire need of help from experts in two areas

1. tell me what dependencies shud I search for the glibc package installation and which folder I shud install it! with complete txt commands.

2. does anyone know ho to build a dummy driver for rtl8139 in linux?

btw I m running fc7...on a 32 bit intel processors......


this was the code I was trying to compile

http://linuxgazette.net/issue93/bhaskaran.html

#define MODULE
#define __KERNEL__

#include < linux/module.h >
#include < linux/config.h >

#include < linux/netdevice.h >

int rtl8139_open (struct net_device *dev)
{
printk("rtl8139_open called\n");
netif_start_queue (dev);
return 0;
}

int rtl8139_release (struct net_device *dev)
{
printk ("rtl8139_release called\n");
netif_stop_queue(dev);
return 0;
}

static int rtl8139_xmit (struct sk_buff *skb,
struct net_device *dev)
{
printk ("dummy xmit function called....\n");
dev_kfree_skb(skb);
return 0;
}

int rtl8139_init (struct net_device *dev)
{
dev->open = rtl8139_open;
dev->stop = rtl8139_release;
dev->hard_start_xmit = rtl8139_xmit;
printk ("8139 device initialized\n");
return 0;
}

struct net_device rtl8139 = {init: rtl8139_init};

int rtl8139_init_module (void)
{
int result;

strcpy (rtl8139.name, "rtl8139");
if ((result = register_netdev (&rtl8139))) {
printk ("rtl8139: Error %d initializing card rtl8139 card",result);
return result;
}
return 0;
}

void rtl8139_cleanup (void)
{
printk ("<0> Cleaning Up the Module\n");
unregister_netdev (&rtl8139);
return;
}

module_init (rtl8139_init_module);
module_exit (rtl8139_cleanup);
 
Old 05-12-2008, 01:43 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
In order to compile a device driver you need the kernel headers, that match your kernel version. Run:
Code:
uname -r
to find your kernel version and then install the kernel source package.
You can use yum to install packages, as it can find and resolve dependencies.

Regards
 
Old 05-13-2008, 12:24 AM   #3
siddhi817
LQ Newbie
 
Registered: May 2008
Posts: 4

Original Poster
Rep: Reputation: 0
please tell me the command to install kernel source package...
 
Old 05-13-2008, 01:46 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
If you have the installation CDs you can use rpm to install it. Else you can d/l it from here (make sure you get the correct kernel-devel that matches your installed kernel version) and use again rpm to install.
You can also use yum to d/l and install:
Code:
yum install kernel-devel
 
  


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
dhcp bug or bug in my head belda Linux - Networking 2 01-26-2008 08:46 AM
LXer: 2008 CES: Bug Labs Introduces BUG, BUGbase. So Cool! LXer Syndicated Linux News 0 01-09-2008 01:21 AM
2038 bug-Is Debian Bug-Proof? deepclutch Debian 1 08-02-2007 10:59 AM
Firefox bug? Fedora 7 bug? or what? hawke Fedora 8 07-22-2007 07:00 PM
Free86 bug or nVidia bug?? ProtoformX Linux - Software 2 05-12-2004 02:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:44 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