• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

What are kernel headers?

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

whooping_a_panda

Mr Slave Senior
Joined
Jul 24, 2001
Location
Los Angeles
so i've been playing with a gentoo install to a good deal of success too! i'm trying to get a usb wifi dongle working right that has drivers, but the drivers were done in the 2.6.10-20 range of kernels. a few sites suggest installing the proper kernel headers and i did find how to emerge them through portage.

but what the heck are they?
 
so i've been playing with a gentoo install to a good deal of success too! i'm trying to get a usb wifi dongle working right that has drivers, but the drivers were done in the 2.6.10-20 range of kernels. a few sites suggest installing the proper kernel headers and i did find how to emerge them through portage.

but what the heck are they?

Going ultra-basic, kernel headers are roadmaps to some of the internals of the kernel. Other software (drivers/etc) can use those roadmaps to get where they need to go in the kernel.

Think about it like a subway system..

Without a map of the subway system and the times that trains get to stations, you're pretty much hosed to get from point A to point B using the subway. With that stuff, you can pretty much know what trains to take when. You don't have to know how a train works, what the trains are made of, what the tracks are made of, etc. All you have to know is how to get on the train, which station to get on, and when to get on.

You're probably being told to get kernel headers to compile drivers for the kernel. Those drivers have to know how to interface to certain parts of the kernel. They can guess, but getting the headers (the roadmap) can help if there are issues.
 
The headers are all of the .h files associated for the kernel. In gentoo you can't just pull in the headers. You'd have to pull in then entire source, but that won't work because the newer kernel will reject a module built for the older kernel.

What usb dongle are you trying to get? There might be a new kernel driver for it?
 
its a d-link dwl-g122 based on a ralink 2570 chipset. been trying to get this driver to work as it supports some nifty features i'd like to learn how to play with. but it fails the make, which makes sense to me now as to why the kernel headers were suggested at other forums i've read. i would be open to just starting with a working fix, but i haven't really tried hard to get just anything to work yet.

gentoo specifics aside would the header files for a particular kernel version match or is it standard practice to install say 2.6.19 headers onto a 2.6.32 kernel? i only ask because as i was looking through portage it seems not every kernel has headers available to it (through portage at least). my 2.6.32 is not listed for instance.

http://www.gentoo-portage.com/sys-kernel/linux-headers
 
No you would want to have the particular kernel version. I don't know but my theory has always been the linux-headers package is not always up todate because gentoo expects the defacto is to just have the whole sources.

It seem a few things:
1) There is support in the kernel for your card, under device drivers -> wireless lan -> ralink driver support . I'm not sure if this driver supports the features you are looking for or not?
2) The website you linked says version 1.6.4 adds support for kernel 2.6.29. While that kernel is getting old, it's more up to date then 2.6.20. Maybe you can go with that version?
 
Last edited:
It seem a few things:
1) There is support in the kernel for your card, under device drivers -> wireless lan -> ralink driver support . I'm not sure if this driver supports the features you are looking for or not?
2) The website you linked says version 1.6.4 adds support for kernel 2.6.29. While that kernel is getting old, it's more up to date then 2.6.20. Maybe you can go with that version?

this is probably what i'll end up doing, and i might build a 2nd kernel of 2.6.29 just to play around with some of the wifi tools :) mostly i was just curious as to the kernel headers and their function. i'm pretty green with linux, knowing just enough to be dangerous haha, but i'm having a lot of fun learning. and gentoo is just rough enough on newbs for my liking :thup:

i imagine i'll have to keep the earlier kernel on its own partition with its own system as there will probably be a lot of other compilation problems as this one.

which i guess brings up a question in itself. i have a partition dedicated to swap space (2GB) if i built another system with the 2.6.29 would it use that same swap space or would it need its own swap partition? either way i'll be in vegas for the week so all the linux i'll be doing will be attempting an install on a macbook pro. and i can't wait to see what kind of hardware compatibility crapstorm i'll run into with this :D
 
Actually with gentoo and really any distro you are fine having multiple kernels. Just edit grub and make sure you pick the one you want in grub :D. The only limitation of this is you can't mix 2.4 and 2.6 kernels and some of the early 2.6 kernels probably will be lacking features need.

However having 2.6.29 and other's won't be a problem at all.

Just do emerge -av =sys-kernel/gentoo-sources-2.6.29-r6 (or -r5 if you aren't doing a testing install).
That will put the sources in /usr/src/linux-2.6.29-r5-gentoo . Make sure you don't use the symlink flag or else it'll symlink it to /usr/src/linux too.

Then compile it like in the gentoo handbook, don't forget make modules && make modules_install. Also you know about the -j flag for make right?

Edit grub and then reboot and select your new kernel :).
 
cool i keep a stable and a test kernel and with pointers in my grub.conf in case i bork something so this is a pretty simple extension then :)

using -j8 in my MAKEOPTS for my Q6600, the documentation i found said -j = cores+1 but i also found some evidence making it a subjective selection, though i'm not really sure of the reasoning besides the "-j flag is just a guestimate"

i did run into issues with parallel-fetch creating lock files that would not self remove as expected and stop portage dead in its tracks (manually removing the lock file and re emerging would fix it but that got old every 5-10 packages).
 
It's typical to install multiple kernels on the same system. No need to have a partition for each.

I have about 10 installed I think. Too lazy to remove old ones when I get new ones.

A kernel is just an entry in menu.lst, and a kernel image file in /boot, that gets copied to memory on startup. The rest can be shared.

No need for separate swap, too. The swap is effectively wiped out every boot (except if you do hibernate to disk, in which case your hibernation image will be wiped out if you try to boot a different kernel).
 
Back