LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-08-2006, 02:47 AM   #1
bishalpoudyal
LQ Newbie
 
Registered: Apr 2006
Location: Nepal
Distribution: bash46
Posts: 10
Blog Entries: 2

Rep: Reputation: 0
compiling raw source code of device driver


I have a device driver's(ethernet card)source code in "driver.c" i have to compile it and convert it to "driver.o" how to compile please help.After compiling it i can easily insert to the kernel module but i could not compile it.
 
Old 04-08-2006, 03:09 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You will need to provide more information. Such as which NIC card the driver is for, your distribution, the version of the kernel (ver 2.4 vs 2.6). I doubt that you have just a driver.c program. You probably started with a tarball, and need to read the README file for full instructions.

"driver" is too generic of a name, so if the target is driver.o, it will probably be linked into the final driver-name.ko kernel module.

One of the things you will need to do is install the kernel-source.
If your distro is RPM based, there will probably be a package named kernel-source-<version>.rpm, however for Fedora Core, it will be a source rpm that you need to install.
The version of the rpm file should match the version displayed by the "uname -r" command.

You will also need the GCC compiler package if it isn't already.

The exact steps for producing a kernel module differs between 2.4 and 2.6 version kernels. If you are using the kernel-source from your distro, there will also be a Readme file with the distro detailing the steps you need to perform. There may be a makefile which performs the steps needed. This is usually the case for 3rd party drivers that aren't part of the kernel tree. One example is ndiswrapper, which compiles a ndiswrapper.ko kernel module and installs it.

-------
By the way, the personal pronoun "I" should be capitalized.

Last edited by jschiwal; 04-08-2006 at 05:19 AM.
 
  


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
Compiling hplip source code. hscast Linux - Software 4 06-16-2006 07:36 PM
RPM vs compiling from Source Code ceci2 Linux - Enterprise 4 03-15-2005 03:58 PM
HELP: newbie compiling source code.... kevingpo Linux - Software 6 12-13-2004 01:16 PM
Problem in compiling source code JIV Linux - Software 1 02-14-2004 03:11 AM
Problems with compiling source code cav Linux - General 4 02-06-2003 12:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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