Exploring the Linux Source Code

If you want to study what makes the Linux operating system tick, the pleasure can be yours!

The source code for Linux is in the subdirectories of /usr/src/linux-2.2.5. You'll find the source code for the Linux kernel in /usr/src/ linux-2.2.5/kernel.

A make file is used to set compilation options and tell the compiler what modules and libraries should be compiled together.

To view the Linux kernel make file:

  • Using a text editor, open the file makefile in the /usr/src/linux-2.2.5/kernel directory (Figure 12.25).

    Figure 12.25. You can view the make file used to compile the Linux kernel.


    Tip

    By viewing the make file, you can determine the code modules that do the work of the kernel.

    The main kernel file is sched.c. If you open it in a text editor, you'll see that it starts with Linus Torvalds' copyright notice and continues with a list of people who have modified the file (Figure 12.26).

    Figure 12.26. Kernel code modules such as sched.care well commented and fun to read.


    As you browse through the code in sched.c, you'll see that it concerns the scheduling and queuing of tasks. The code is well commented and makes a good read.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.47.218