Search code examples
linuxlinux-kernelvmwaredevice-driverfedora11

kernel source code location in linux


I am working in Windows and running fedora through VMware.

By default, the kernel source tree should be in usr/src/ directory. Instead I could find only an empty directory called kernels. The actual source code is missing there.

When browsing I thought it might be in other directories like /boot. But I couldn't find source tree there as well.

I need to modify system call tables for which I should be able to access those source codes.


Solution

  • You probably need to install the kernel-devel package.

    On Fedora, all of the software is managed through a system called the Red Hat Package Manager (RPM). Every file (other than user data and other transient files like logs and such) is "owned" by a package. The ls command is from coreutils, the kernel is probably from kernel and BZFlag (the greatest Linux game ever) is provided by the bzflag package.

    In the good old days, you would try to install software by using the rpm command (type "man rpm" for more information) and giving it the path to an RPM file that you had downloaded. The rpm command would then dutifully respond by informing you that you first need to satisfy 33 prerequisites. Then you would go download those 33 prerequisites and try to install them, only to find that each of those had their own prerequisites. And so on.

    These days, Fedora has a nice set of online repositories of packages (and you can add others for third party software), and a program called yum that can download databases of all the packages, and you tell yum "install package foo for me" (by typing something like "yum install kernel-devel") and it goes and figures out that in order to install that package, you need a bunch of other prerequisite packages, and so on. It then automatically downloads and installs everything you need, and away you go. For more information on the various incantations that make yum go, see "man yum").