[prog] Re: RedHat Linux and a lack of proper kernel headers

Patricia Gaughen gone at us.ibm.com
Thu Oct 3 14:32:22 EST 2002


  > On Thu, Oct 03, 2002 at 03:59:42PM -0500, Rebecca Erwin wrote:
  > > I reinstalled again and made sure to include the glibc-kernheaders 
  > > package.  Still no good.  If you look at /usr/include/linux/pci.h that 
  > 
  > I'm not sure what you want to do. If you are looking for the kernel
  > sources, these should end up in /usr/src/linux (which usually is a
  > symlink to /usr/src/linux-<version>).
  > 
  > The /usr/include/linux directory is something completely different.
  > Someone else might be able to explain better than me, though.

My understanding is that /usr/include/linux contains the header files that the 
glibc on your system was built with.  If you're writing a pci driver you want 
to use what's in /usr/src/linux-<version>/include/linux.  You want to use 
these headers because you want to use the same ones the kernel was built with 
that you are writing the driver for.  So, you'll want to specify a 
-I/usr/src/linux-<version>/include on your gcc compile line.

My box is running redhat 7.3 and the package I installed to get the kernel 
srces including the header files is kernel-source-2.4.18-3.

If you're writing device drivers, I highly recommend the "Linux Device 
Drivers" book by the O'reilly folks. (if you don't already have it :-)  It's 
even available online. ... I'd include the url, but I don't have it handy and 
I'm too lazy to go look right now ;-)

Hope this helps,
Pat

-- 
Patricia Gaughen (gone at us.ibm.com)
IBM Linux Technology Center
http://www.ibm.com/linux/ltc/





More information about the Programming mailing list