Thursday 27 February 2014

PC's Boot Process


Boot Process

Firstly let me state this is my "adapted" version of the boot process for a Windows system.

The boot process is divided into 3 stages:

  1. Powering on the PC
  2. BIOS Power On and Self Test (Post)
  3. Bootstrapping the Operating System

ATX V1.0 standard

Powering on the computer

The power supply in a PC conforms to the ATX standard. For the purposes of this discussion what does matter is the functionality of the POK pin on the ATX connector.
POK or “Power Good” pin is an output from the power supply that indicates that its output has stabilized and is ready for use. It remains low for a brief time (100–500 ms) after the power supply is turned on.

When the POK pin had power, a power good signal which is received by the motherboard timer. When the timer receives this signal, it stops forcing a reset signal to the CPU and the CPU begins processing instructions.

When the CPU has reset it passes control to the software in the BIOS ROM.

BIOS ROM

BIOS Chip
In IBM PC compatible computers, the Basic Input/Output System (BIOS), also known as System BIOS, ROM BIOS or PC BIOS, is a de facto standard defining a firmware interface. Nowadays the BIOS is stored in Flash memory so the BIOS is upgradeable but traditionally the BIOS was "burned" into non volatile read-only memory (ROM).

The BIOS contains a sequence of instructions to start up the computer system. The boot sequence otherwise known as the power on and self test procedure is now executed.

BIOS Power On and Self Test (Post)

When the CPU is reset and control is passed to the BIOS at 0xF0000 to 0xFFFFF. Each manufacturers BIOS is unique but the aim of the BIOS is to initialise the hardware functionally, test the motherboard and the RAM on board and initialise each hardware component  plugged into the system bus.

An irregular POST could generate no beeps at all or a combination of different beeps to indicate the cause of the failure. 

Below is the BIOS Sequence for American Megatrends BIOS & Phoenix Technologies BIOS
American Megatrends Phoenix Technologies
1 Disable the NMI Check the CPU
2 Power-on Delay Test CMOS RAM
3 Initialize chipsets BIOS ROM checksum
4 Reset determination Test chipset(s)
5 BIOS ROM checksum Test PIT
6 Keyboard test Test DMA
7 CMOS shutdown check Test base 64KB memory
8 Controller disable Check serial and parallel ports
9 Disable video Test PIC
10 Detect memory Check the Keyboard Controller (KBC)
11 PIT test Verify CMOS data
12 Check memory refresh Verify video system
13 Check low address lines Test RTC
14 Check low 64KB RAM Test CPU in protected mode
15 Initialize support IC's Verify PIC 2
16 Load INT vector table Check NMI
17 Check the Keyboard Controller (KBC) Check the keyboard
18 Video tests Check the mouse
19 Load the BDA Check system RAM
20 Test memory Test disk controller
21 Check DMA registers Set shadow RAM areas
22 Check the keyboard Checkextended ROMs
23 Perform high-level tests Test cache controller
24 Load the Operating System (OS) Test CPU cache
25 Check hardware adapters
26 Load the Operating System (OS)

Note about BIOS CMOS

Battery for BIOS CMOS memory
The PC maintains system values set up in the BIOS Setup Screen in the battery backed up CMOS memory. This memory contains information such as the system time and date and information, the boot disc sequence and hardware configuration information required to get the computer running. If the battery fails this may be enough to stop the boot sequence.

Booting the Operating System

After the computer has passed the POST the last act in the boot sequence is to "bootstrap" the operating system. The bootstrap process gets quite mirky but essentially the BIOS loads the Master Boot Record (MBR) sector of the selected boot device and hands control over to the bootstrap loader.

The bootstrap loader further instructs the computer where to find the remaining code on the hard drive. Next, Windows loads the ntdetect.com file, which displays the Windows splash screen and loads the Windows registry. After loading the registry, Windows begins to load dozens of low-level programs that make up the operating system into memory. Many of the initially loaded programs are what allow Windows to communicate with the essential hardware and other programs running on the computer.

After the registry has loaded the initial basic hardware devices, it begins to load Plug and Play devices, PCI, and ISA devices. After loading all these devices, Windows then moves to loading full support of the hard drive, partitions, and any other disk drives and then moves to all other drivers that have been installed.

Finally, after successfully completing the above steps any additional required services are loaded and Windows starts.

No comments:

Post a Comment