Before Booting
In the previous section, we treated start_kernel as the first kernel function. However, you might be interested in what happens before that point, so we’ll step back to take a quick look at that topic. The uninterested reader can jump directly to the next section.
As suggested, the code that runs before start_kernel is, for the most part, assembly code, but several platforms call library C functions from there (most commonly, inflate, the core of gunzip).
On most common platforms, the code that runs before start_kernel is mainly devoted to moving the kernel around after the computer’s firmware (possibly with the help of a boot loader) has loaded it into RAM from some other storage, such as a local disk or a remote workstation over the network.
It’s not uncommon, though, to find some rudimentary boot loader code
inside the boot directory of an
architecture-specific tree. For example,
arch/i386/boot includes code that can load the
rest of the kernel off a floppy disk and activate it. The file
bootsect.S that you will find there, however, can
run only off a floppy disk and is by no means a complete boot loader
(for example, it is unable to pass a command line to the kernel it
loads). Nonetheless, copying a new kernel to a floppy is still a handy
way to quickly boot it on the PC.
A known limitation of the x86 platform is that the CPU can see only 640 KB of system memory when it is powered on, no matter how large your installed memory is. Dealing with the limitation ...