Load sequence

The boot sector is loaded by the ROM-BIOS at address 0x07C00. It moves itself to address 0x9A000, sets up the stack (growing downwards from 0x9B000 to 0x9A200), loads the secondary boot loader at address 0x9B000 and transfers control to it. It displays an ``L'' after moving itself and an ``I'' before starting the secondary boot loader. If a read error occurs when loading the secondary boot loader, a two-digit hex code is displayed after the ``L''. This results in an endless stream of error codes if the problem is permanent. Displaying these error codes is disabled if the build-time option <#24#> NO1STDIAG<#24#> is set. The secondary boot loader loads the descriptor table at 0x9D200 and the sector containing the default command line at 0x9D600. If the default command line is enabled, its magic number is invalidated and the sector is written back to disk. This potentially dangerous operation can be disabled by defining <#25#> LCF_READONLY<#25#> when passing <#26#> second.S<#26#> through <#27#> cpp<#27#>. Next, the secondary boot loader checks for user input. If either the default is used or if the user has specified an alternate image, the options sector is loaded at 0x9D000 and the parameter line is constructed at 0x9D800. If the resulting line contains the option 1lock;SPM_quot;, the command line as entered by the user (it is saved before the final line is constructed) is written to the disk as the new default command line. Next, the floppy boot sector of that image is loaded at 0x90000, the setup part is loaded at 0x90200 and the kernel part is loaded at 0x10000. During the load operation, the sectors of the map file are loaded at 0x9D000. If the loaded image is a kernel image, control is transferred to its setup code. If a different operating system is booted, things are a bit more difficult: the chain loader is loaded at 0x90200 and the boot sector of the other OS is loaded at 0x90400. The chain loader moves the partition table (loaded at 0x903BE as part of the chain loader) to 0x00600 and the boot sector to 0x07C00. After that, it passes control to the boot sector. Chain loaders that allow booting from a second drive (either floppy or hard disk) also install a small function to intercept BIOS calls and to swap the drive numbers at the top of available memory. The secondary boot loader displays an ``L'' after being started and an ``O'' after loading the descriptor table and the default command line. Before loading the descriptor table, it checks, whether it has been loaded at the correct location and displays a question mark if it hasn't. If the descriptor table has an incorrect checksum, a minus sign is displayed.

#displaymath575#

The area 0x90020-0x90023 is overlaid by a command-line descriptor while the secondary boot loader is running.