Boot Processes
Objectives:
|
Documents & Resources |
Introduction: Boot Process
This lesson focuses on the boot process for the major operating systems available today. Booting, also called boot strapping, is the process of loading an operating system into a computer's main memory. This step take placeduring the boot sequence, which is a set of steps a computer system takes after it has been powered on. We begin by covering some basic information about the boot process. It then discusses the the boot process for the legacy operating systems MS-DOS before moving on to discussing the boot processes for Windows, Linux and Mac OS.
Boot Loader
A boot loader or boot manager is a program that loads the operating system into a computer's memory when the system is booted. Multiple-stage boot-loaders - where a number of small programs call each other, and the last program loads the operating system - are common.
Boot Sector
A boot sector is a memory sector of a hard disk, or a similar data storage device device that contains code for bootstrapping systems. The boot sector on a disk is always the first sector on the first track. Each valid boot sector has two bytes (0x55AA), called a boot sector signature, at the end of a sector, see below
There are two major kinds of boot sectors:
• Volume boot record: It is the first sector of a data storage device that has not been partitioned, or the
first sector of an individual partition on a data storage device that has been partitioned. It contains code
to load and invoke the operating system or other stand-alone program installed on that device or within
that partition.
• Master boot record: It is the first sector of a data storage device that has been partitioned. It contains
code to locate the active partition and to invoke its volume boot record. A master boot record contains
the following structures:
• Master partition table: It is a small bit of code that contains a complete description of the partitions
that are contained on the storage device.
• Master boot code: The master boot code is a small bit of computer code loaded and executed by the
BIOS to start the boot process. The BIOS is the program a personal computer's microprocessor uses
to get the computer system started after a user turns it on.
first sector of an individual partition on a data storage device that has been partitioned. It contains code
to load and invoke the operating system or other stand-alone program installed on that device or within
that partition.
• Master boot record: It is the first sector of a data storage device that has been partitioned. It contains
code to locate the active partition and to invoke its volume boot record. A master boot record contains
the following structures:
• Master partition table: It is a small bit of code that contains a complete description of the partitions
that are contained on the storage device.
• Master boot code: The master boot code is a small bit of computer code loaded and executed by the
BIOS to start the boot process. The BIOS is the program a personal computer's microprocessor uses
to get the computer system started after a user turns it on.
Basic System Boot Process:
After a computer's power is turned on, it goes through a number of steps:
1. The system clock generates a series of clock ticks, which initializes the CPU.
2. The CPU looks to the system's startup program in the ROM BIOS for its first instruction.
3. The first instruction is to run the power-on self-test (POST), in a predetermined memory address.
4. POST checks the BIOS chip and then tests CMOS RAM. CMOS (complementary metal-oxide semiconductor) memory holds the system date, time, and setup parameters.
5. If there is no battery failure, POST checks the inventoried hardware devices such as the video card; secondary storage devices, such as hard drives and floppy drives; ports; and other hardware devices, such as
the keyboard and mouse, to check whether they are functioning properly.
6. CPU initialization is completed if everything is fine.
7. The BIOS looks into the CMOS chip to find the drive where the OS is installed.
8. The BIOS then checks the boot record of the drive to find the beginning of the OS and the subsequent program file that initializes the OS.
9. The BIOS copies its files into memory after OS initialization.
1. The system clock generates a series of clock ticks, which initializes the CPU.
2. The CPU looks to the system's startup program in the ROM BIOS for its first instruction.
3. The first instruction is to run the power-on self-test (POST), in a predetermined memory address.
4. POST checks the BIOS chip and then tests CMOS RAM. CMOS (complementary metal-oxide semiconductor) memory holds the system date, time, and setup parameters.
5. If there is no battery failure, POST checks the inventoried hardware devices such as the video card; secondary storage devices, such as hard drives and floppy drives; ports; and other hardware devices, such as
the keyboard and mouse, to check whether they are functioning properly.
6. CPU initialization is completed if everything is fine.
7. The BIOS looks into the CMOS chip to find the drive where the OS is installed.
8. The BIOS then checks the boot record of the drive to find the beginning of the OS and the subsequent program file that initializes the OS.
9. The BIOS copies its files into memory after OS initialization.
10. The OS takes over control of the boot process
11. The OS performs another inventory of the system's memory and memory availability, and load the device drivers that it needs to control the peripheral devices, such as a printer, scanner, optical drive, mouse and keyboard.
11. The OS performs another inventory of the system's memory and memory availability, and load the device drivers that it needs to control the peripheral devices, such as a printer, scanner, optical drive, mouse and keyboard.
MS-DOS Boot Process
After a computer running MS-DOS is turned on, it goes through the following steps
1. The BIOS initiates power-on self-test (POST). POST performs the following actions:
a. Initializes the keyboard and other system hardware, such as the video card
b. Tests the computer's RAM
c. Checks the disk drives
d. Attempts to find a valid operating system
If all goes well in POST, the computer continues with these steps:
2. The BIOS searches for the file IO.SYS in the root directory and loads it into RAM.
3. IO.SYS provides services for peripherals such as printers, modems, and disk drives.
4. IO.SYS loads a file called MSDOS.SYS, which is an extension of ROM or the BIOS.
5. MSDOS.SYS acts as a gateway for communication between DOS and the BIOS.
6. MSDOS.SYS loads the CONFIG.SYS file.
7. CONFIG.SYS stores system configurations.
8. CONFIG.SYS is processed and executed.
9. MSDOS.SYS loads the COMMAND.COM program file into memory.
10. COMMAND.COM is a command interpreter that contains all the internal DOS instructions, such as DIR, CD, and CLS.
11. COMMAND.COM loads an optional file called AUTOEXEC.BAT and executes it.
1. The BIOS initiates power-on self-test (POST). POST performs the following actions:
a. Initializes the keyboard and other system hardware, such as the video card
b. Tests the computer's RAM
c. Checks the disk drives
d. Attempts to find a valid operating system
If all goes well in POST, the computer continues with these steps:
2. The BIOS searches for the file IO.SYS in the root directory and loads it into RAM.
3. IO.SYS provides services for peripherals such as printers, modems, and disk drives.
4. IO.SYS loads a file called MSDOS.SYS, which is an extension of ROM or the BIOS.
5. MSDOS.SYS acts as a gateway for communication between DOS and the BIOS.
6. MSDOS.SYS loads the CONFIG.SYS file.
7. CONFIG.SYS stores system configurations.
8. CONFIG.SYS is processed and executed.
9. MSDOS.SYS loads the COMMAND.COM program file into memory.
10. COMMAND.COM is a command interpreter that contains all the internal DOS instructions, such as DIR, CD, and CLS.
11. COMMAND.COM loads an optional file called AUTOEXEC.BAT and executes it.
Windows XP Boot Process
After the power supply is switched on, a computer running Windows XP goes through the following steps:
1. The power supply performs a self-test and sends the power-good signal to the processor.
2. The timer chip stops sending reset signals to the processor, allowing the CPU to begin operations.
3. The CPU loads the ROM BIOS starting at ROM memory address FFFF:0000.
4. The ROM BIOS contains a JMP (jump) instruction that points to the actual address of the ROM BIOS code.
5. The ROM BIOS performs a basic test of central hardware to verify basic functionality.
6. The BIOS searches for adapters that may need to load their own ROM BIOS routines.
7. Startup BIOS routines scan memory addresses C000:0000 through C780:0000 to find video ROM.
8. The ROM BIOS checks to see if this is a cold boot (the startup of a system from a powered-down state) or a warm boot (the restart of a system that is already on).
9. If this is a cold boot, the ROM BIOS executes a full POST (power-on self-test). If this is a warm boot,
the memory test portion of the POST is switched off.
10. POST can be broken down into two components:
• A video test initializes the video adapter.
• A video adapter tests the video card and video memory, and displays configuration information or any errors.
11. The BIOS locates and reads the configuration information stored in CMOS.
12. The BIOS examines the disk for a master boot record (MBR).
13. With a valid MBR loaded into memory, the BIOS transfers control of the boot process to the partition loader code.
14. The partition loader, or boot loader, examines the partition table for a partition marked as active.
15. The partition loader then searches the very first sector of that partition for a boot record.
16. The active partition's boot record is checked for a valid boot signature and, if found, the boot sector code is executed as a program.
17. NTLDR, a hidden system file in the root directory of the system partition, controls loading of Windows XP in four stages:
• Initial boot-loader phase: NTLDR switches the processor from real mode to protected mode, which
places the processor in 32-bit memory mode and turns memory paging on. It then loads the appropri
ate file system drivers to allow NTLDR to load files from a partition formatted with any of the file
systems supported by XP. If the file BOOT.INI is located in the root directory, NTLDR will read its
contents into memory.
• Operating system selection: If BOOT.INI contains entries for more than one operating system, NTLDR
will stop the boot sequence at this point, display a menu of choices, and wait for a specified period of
time for the user to make a selection. A user can press F8 at this stage of the boot sequence to display
various boot options (Figure 3-4), including "Safe Mode" and "Last Known Good Configuration."
• Hardware detection: If the selected operating system is XP, NTLDR locates and loads the DOS-based
NTDETECT.COM program to perform hardware detection. If this computer has more than one de
fined hardware profile, NTLDR will stop at this point and display the Hardware Profiles/Configura
tion Recovery menu. After the user selects a hardware configuration, NTLDR begins loading the XP
kernel (NTOSKRNL.EXE).• Configuration selection: NTLDR now loads device drivers that are marked as boot devices. After
loading these drivers, NTLDR relinquishes control of the computer to the device drivers.
18. NTOSKRNL goes through two phases in its boot process:
• Phase 0: XP disables interrupts during phase 0 and enables them before phase 1. The hardware ab
straction layer (HAL) is called to prepare the interrupt controller.
• Phase 1: All executive subsystems are reinitialized in the following order:
a. Object Manager
b. Executive
c. Microkernel
d. Security Reference Monitor
e. Virtual Memory Manager
f. Cache Manager
g. Local Procedure Calls (LPCs)
h. I/O Manager
i. Process Manager
19. I/O Manager starts loading all the system driver files:
• It first loads the boot devices.
• It assembles a prioritized list of drivers and attempts to load each in turn.
• It launches the Session Manager Subsystem (SMSS).
• SMSS loads the win32k.sys device driver, which implements the Win32 graphics subsystem.
20. Win32k.sys switches the screen into graphics mode.
21. The services subsystem starts all services marked as Auto Start.
22. Once all devices and services are started, the boot is deemed successful, and this configuration is save
as the last known good configuration.
23.The WINLOGON.EXE file starts the logon process. It is a login manager file that is responsible for all login and logout procedures.
24. The Local Security Authority (LSASS.EXE) process displays the logon dialog box (Figure 3-5).
1. The power supply performs a self-test and sends the power-good signal to the processor.
2. The timer chip stops sending reset signals to the processor, allowing the CPU to begin operations.
3. The CPU loads the ROM BIOS starting at ROM memory address FFFF:0000.
4. The ROM BIOS contains a JMP (jump) instruction that points to the actual address of the ROM BIOS code.
5. The ROM BIOS performs a basic test of central hardware to verify basic functionality.
6. The BIOS searches for adapters that may need to load their own ROM BIOS routines.
7. Startup BIOS routines scan memory addresses C000:0000 through C780:0000 to find video ROM.
8. The ROM BIOS checks to see if this is a cold boot (the startup of a system from a powered-down state) or a warm boot (the restart of a system that is already on).
9. If this is a cold boot, the ROM BIOS executes a full POST (power-on self-test). If this is a warm boot,
the memory test portion of the POST is switched off.
10. POST can be broken down into two components:
• A video test initializes the video adapter.
• A video adapter tests the video card and video memory, and displays configuration information or any errors.
11. The BIOS locates and reads the configuration information stored in CMOS.
12. The BIOS examines the disk for a master boot record (MBR).
13. With a valid MBR loaded into memory, the BIOS transfers control of the boot process to the partition loader code.
14. The partition loader, or boot loader, examines the partition table for a partition marked as active.
15. The partition loader then searches the very first sector of that partition for a boot record.
16. The active partition's boot record is checked for a valid boot signature and, if found, the boot sector code is executed as a program.
17. NTLDR, a hidden system file in the root directory of the system partition, controls loading of Windows XP in four stages:
• Initial boot-loader phase: NTLDR switches the processor from real mode to protected mode, which
places the processor in 32-bit memory mode and turns memory paging on. It then loads the appropri
ate file system drivers to allow NTLDR to load files from a partition formatted with any of the file
systems supported by XP. If the file BOOT.INI is located in the root directory, NTLDR will read its
contents into memory.
• Operating system selection: If BOOT.INI contains entries for more than one operating system, NTLDR
will stop the boot sequence at this point, display a menu of choices, and wait for a specified period of
time for the user to make a selection. A user can press F8 at this stage of the boot sequence to display
various boot options (Figure 3-4), including "Safe Mode" and "Last Known Good Configuration."
• Hardware detection: If the selected operating system is XP, NTLDR locates and loads the DOS-based
NTDETECT.COM program to perform hardware detection. If this computer has more than one de
fined hardware profile, NTLDR will stop at this point and display the Hardware Profiles/Configura
tion Recovery menu. After the user selects a hardware configuration, NTLDR begins loading the XP
kernel (NTOSKRNL.EXE).• Configuration selection: NTLDR now loads device drivers that are marked as boot devices. After
loading these drivers, NTLDR relinquishes control of the computer to the device drivers.
18. NTOSKRNL goes through two phases in its boot process:
• Phase 0: XP disables interrupts during phase 0 and enables them before phase 1. The hardware ab
straction layer (HAL) is called to prepare the interrupt controller.
• Phase 1: All executive subsystems are reinitialized in the following order:
a. Object Manager
b. Executive
c. Microkernel
d. Security Reference Monitor
e. Virtual Memory Manager
f. Cache Manager
g. Local Procedure Calls (LPCs)
h. I/O Manager
i. Process Manager
19. I/O Manager starts loading all the system driver files:
• It first loads the boot devices.
• It assembles a prioritized list of drivers and attempts to load each in turn.
• It launches the Session Manager Subsystem (SMSS).
• SMSS loads the win32k.sys device driver, which implements the Win32 graphics subsystem.
20. Win32k.sys switches the screen into graphics mode.
21. The services subsystem starts all services marked as Auto Start.
22. Once all devices and services are started, the boot is deemed successful, and this configuration is save
as the last known good configuration.
23.The WINLOGON.EXE file starts the logon process. It is a login manager file that is responsible for all login and logout procedures.
24. The Local Security Authority (LSASS.EXE) process displays the logon dialog box (Figure 3-5).
Review Questions
- What does the term "booting" mean?
- Describe the purpose of the master boot record.
- Write down the basic system boot process.
- What is a kernel?
- Explain the Mac OS boot process.
- What is the role of a boot loader in booting?
- Explain the XP boot process.
- Briefly explain the purpose of BIOS
- Briefly explain the purpose of CMOS
- Explain the difference between a cold boot and a warm boot.