5.1. System Initialization OverviewIt's important to know where and how the main network-related subsystems are initialized, including device drivers. However, because this book is concerned only with the networking aspect of such initializations, I will not cover device drivers in general, or generic kernel services (e.g., memory management). For an understanding of that background, I recommend that you read Linux Device Drivers and Understanding the Linux Kernel, both published by O'Reilly. Figure 5-1 shows briefly where, and in what sequence, some of the kernel subsystems are initialized at boot time (see init/main.c). Figure 5-1. Kernel initialization![]() When the kernel boots up, it executes start_kernel, which initializes a bunch of subsystems, as partially shown in Figure 5-1. Before start_kernel terminates, it invokes the init kernel thread, which takes care of the rest of the initializations. Most of the initialization activities related to this chapter happen to be inside do_basic_setup. Among the various initialization tasks, we are mainly interested in three:
run_init_process determines the first process run on the system, the parent of all other processes; it has a PID of 1 and never halts until the system is done. Normally the program run is init, part of the SysVinit package. However, the administrator can specify a different program through the init= boot time option. When no such option is provided, the kernel tries to execute the init command from a set of well-known locations, and panics if it cannot find any. The user can also provide boot-time options that will be passed to init (see the section "Boot-Time Kernel Options"). ![]() |