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?

  • 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, 2014 at 5:08

1 Answer 1


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).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .