When the system starts, it sometimes will fail to load the kernel – or perhaps there are other adjustments that must be made. It pays, thus, to know exactly how the system gets to the point of loading the kernel – even before initd runs or swapper runs.
It can also be a benefit in trying to get the system to use a serial console or to provide splash screens throughout.
In a FreeBSD/x86 system, the process goes something like this:
- The system turns on, and the BIOS begins processing and preparing hardware for the boot up. Most Intel machines do not provide a serial port view of the BIOS boot process.
- The system loads the first block (the master boot record, or MBR) from disk.
- The disk loader then loads the rest of the loader. It is at this point that the first screen appears. This loader may be GRUB or the FreeBSD loader.
- The next step is normally to load the FreeBSD boot loader (which is different from the FreeBSD MBR loader). The boot loader provides a FORTH-based environment for modifying the boot sequence, and so on.
- The final step is to load the kernel and to start processing. GRUB could load the kernel directly, but using the boot loader provides access to the prompt and to modify the boot process.
GRUB can be configured for a serial port, as can the FreeBSD kernel and loader. Likewise, the splash screens can be set here as well.
It is also possible that any of these items may fail; knowledge of the others will provide for methods of recovery.
If GRUB fails to load the loader (or kernel) properly, it can be adjusted interactively to load the right loader with the right parameters.
If the FreeBSD boot loader does not load the kernel properly (or is misconfigured), it can be adjusted by pressing a key and using the FORTH prompt to manipulate the loaded kernel – including loading a different kernel, changing parameters, loading modules, and so forth.