Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been a Windows kernel developer for many years. Now I start to develop Linux kernel modules.

To begin with, I installed kernel-devel under /usr/src/kernels/$(uname -r). However, after checking the installation folder, I am confused because there seem a lot of seemingly useless folders and files inside the directory. Many folders are empty except for two files: Kconfig and Makefile.

Under Windows, to develop kernel device drivers, I just need an include folder containing all necessary header files, and an lib folder containing necessary libraries to link.

Under Linux, I can't understand why there are so many seemingly useless folders.

Any explanations?

share|improve this question
either put your headers under /usr/local/src, or install your distro's package. it will probably be called linux-headers or somesuch. – strugee May 22 '14 at 5:08
up vote 2 down vote accepted

The kernel-devel package in Fedora and other Red Hat derivatives does not contain the full kernel source, just headers for public interfaces and makefiles needed for driver development. Most headers can be found under /usr/src/kernels/$(uname -r)/include/ and some architecture specific headers, e.g. for x86 under /usr/src/kernels/$(uname -r)/arch/x86/include/.

The directories with Kconfig and Makefile are not useless, you only don't see the complete picture because you don't have the entire kernel source (which you typically wouldn't need for driver development anyway).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.