The Kernel

Now we finally have the Kernel loaded into memory and executing. But we are just getting started with the interesting stuff. Here is a "beat me over the head with the details" explanation of the kernel boot process if you like to be beaten over the head, but I'll give you a brief overview instead. First the kernel initializes some hardware devices (can't find details about this step). Next, the kernel, optionally, loads an initial ram disk (initrd). This is a temporary filesystem within a single file that contains some kernel modules that may be needed to mount the real root filesystem. For instance, if your root filesystem was a ReiserFS filesystem located on a USB thumb drive and you didn't have the (usb-storage and reiserfs) code built into the kernel, your initrd would have to contain the usb-storage.ko and the reiserfs.ko modules, so that the kernel could use them to access your root filesystem. We'll talk more in-depth about this we we compile our own custom kernel. Next the kernel mounts the root filesystem. This is the filesystem which contains most all of your Linux distro. The kernel then runs the program called init. You can specify, via the boot loader, an "init=" parameter for the kernel to use. For instance if you specify "init=/bin/sh" then the kernel will try to execute "/bin/sh" at this point from the root filesystem it has mounted. By the way, this is what system admin recovery mode does for most Linux distros. It basically logs you in directly as root without asking for a password (big security hole). If you don't specify an init parameter, the kernel usually looks for "/sbin/init" and executes it. This mostly finishes what you'd consider the boot process, at least to the application level, but we still can't login, so we'll see what init does for us.