Saturday, March 15, 2008

Boot Loader

The term boot loader can refer to several programs your computer may use to begin. it can be one or a combination of programs such as Ntldr, BTX, MILO, LILO, BIOS, Coreboot, EMILE, Redboot, Yaboot, PC Booter, Quik, Bootman, GNU GRUB, Elilo, Klibc, Loadin, SILO, Boot X, Gujin, Das U-Boot, SYSLINUX, PALO, and System Commander to name a few. These boot loader programs can be executed automatically or configured to run by command or event.
In some systems the first set of instructions will load the Ntldr program from the root location on the specified boot drive. This will prompt the StartUp module to set the CPU to protected mode which enables the 32-bit memory access which it then creates the initial Interrupt Descriptor Table, Global Descriptor Table, page tables, and enables paging. This fundamental structure is required for the operating system to function. The StartUp module goes out and begins loading the operating system by launching the operating system loader.
The next step in the process includes the boot.ini. The contents of this file are read to get the information contained in the system volume. This will indicate the location and name of the operating system directory. If you have a dual operating system installed, a boot menu will be presented and the user can select which system to run. After the selection the booting process continues and the CPU is switched to Long mode which will enable the 64-bit addressing.
If you are running Windows the Ntoskrnl.exe and Hardware Abstraction Layer (HAL) are placed into memory. From here the boot-time device drivers get loaded but are not initialized. These are loaded into the HKLM/SYSTEM registry. After the controls are retrieved and the correct file system, such as FAT or NTFS is loaded, the kernel takes over.
The kernel creates the structure for memory and the CPU interrupt gets initialized as does the memory manager. Kernel then looks for system drivers and initializes the devices. Once this step is complete, the Session Manager Subsystem is started. The smss.exe file starts the Autochk routine which initializes and checks each drive. This then creates the environment settings in the registry. Windows then starts from the winlogon.exe files and you're on your way.

No comments: