LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 09-29-2003, 02:25 PM   #1
Toker
Member
 
Registered: Sep 2003
Distribution: Mandrake9.1
Posts: 92

Rep: Reputation: 15
What/where are kernel header files?


I need to set the path to the directory containing the kernel header files that should be used when I compile the NVIDIA kernel module. Both of the default directories the installer uses do not exist on my system. The two paths is searches by are:

/lib/modules/2.4.21-0.13mdk/build/include (the only directory I have in 2.4.21-0.13mdk is "kernel")

and:

/usr/src/linux/include (under src/ I only have alsa and rpm)

Since I'm very new to nix, I'm not really sure what a header file even is, let alone where they are. Any help on what I need here? This is using Mandrake 9.1

Thanks!
 
Old 09-29-2003, 04:00 PM   #2
LooseCanon
Member
 
Registered: Aug 2003
Location: Canada
Distribution: RH, Fedora, Debian
Posts: 128

Rep: Reputation: 15
Kernel header files (a.k.a. "kernel source" files) are a set of pre-compiled binary files reflecting your currently running kernel. Essentially the kernel headers are simply a "raw" mirror image of the kernel that's running your computer. You need kernel headers (or kernel source) files in order to make drivers, fix things etc..

The kernel headers are stored in /usr/src and usually appear as a directory reflecting the version of the currently running kernel. You can check that (currently running kernel version) by typing uname -r.


Keep in mind that there's a big difference between "kernel source" files and "source kernel" files.

-> Kernel source (i.e. kernel headers) is what I described above. Kernel source (header) files are pre-compiled set of binaries (inlcuding bug fixes and patches) that reflect the kernel that's running your system. These files are named in the following manner: "kernel-source-<version>.rpm"

--> Source kernel files are simply the source file for making a kernel. If you plan to make (compile) your own kernel (the core of linux) then you must use the "source" files - as you would with some programs... obtain the source and then compile your own program based on the "source files". These are normally named: "kernel-<version>.src.rpm"


Do a quick search on this in the forums and you'll get a better understanding for these terms that way.
 
Old 09-29-2003, 05:44 PM   #3
Toker
Member
 
Registered: Sep 2003
Distribution: Mandrake9.1
Posts: 92

Original Poster
Rep: Reputation: 15
Well, it's definately the kernel source files that I'm looking for. However, I don't have a directory in /usr/src/ with the current kernel (2.4.21-0.13mdk.) I do have that directory in /lib/modules/ though. The only directories in /usr/src/ are alsa and RPM in RPM, there is BUILD, RPMS, SOURCES, SPECS and SRPMS.

Is there a command that will show the path to the current kernel source files?
 
Old 09-29-2003, 07:56 PM   #4
LooseCanon
Member
 
Registered: Aug 2003
Location: Canada
Distribution: RH, Fedora, Debian
Posts: 128

Rep: Reputation: 15
If you can find the "kernel-source-<version>.rpm" file on ftp.mandrake-linux.com that matches the version of your kernel then download it and install the kernel-source file (rpm). If yours is an install off the Mandrake CD's then the "kernel-source-<version>.rpm" file will be on one of the CD's. You can just copy it from there and install it.

Use "rpm -ihv kernel-source-<version>.rpm" to install it (kernel-source) while logged in as root. The installation then creates the appropriate kernel headers as well as all the directories where those are housed.

The stuff you have in your /usr/src/ directory is good - all that is needed too in order to make drivers and programs....
 
Old 09-29-2003, 08:04 PM   #5
Toker
Member
 
Registered: Sep 2003
Distribution: Mandrake9.1
Posts: 92

Original Poster
Rep: Reputation: 15
Thank you LooseCannon! It's somewhere on one of those cd's....

I'm off to play this for a while!
 
Old 09-29-2003, 11:16 PM   #6
Toker
Member
 
Registered: Sep 2003
Distribution: Mandrake9.1
Posts: 92

Original Poster
Rep: Reputation: 15
post deleted - please ignore.

Last edited by Toker; 09-29-2003 at 11:21 PM.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What!? Kernel header files too old? LinuxLuvr Linux From Scratch 2 06-20-2005 08:43 AM
Kernel Header Files apocolpse Suse/Novell 3 11-19-2004 12:48 PM
c header files in linux in place of header files in windows? harun_acs Programming 1 03-17-2004 02:24 AM
Kernel Header Files? kholdstayr Slackware 1 12-22-2003 04:45 PM
where are the kernel header files? vance Linux - Software 5 03-05-2002 01:51 AM


All times are GMT -5. The time now is 12:52 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration