System Initialization (x86): Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
 
No edit summary
Line 1: Line 1:
==== Power Supply Self-Check ====
==== Power Supply Self-Check ====
The first is a check done by the power supply to determine if internal voltage and current levels are valid. Next is a check done by the [http://en.wikipedia.org/wiki/BIOS BIOS (Basic Input/Output System)] program, which mainly concerns the existance of vital computer components such as the [http://en.wikipedia.org/wiki/Central_processing_unit Central Processing Unit (CPU)], [http://en.wikipedia.org/wiki/Random_access_memory Random Access Memory (RAM)] and any [http://en.wikipedia.org/wiki/Graphics_card Video (Graphics) Cards]. If you have ever started your computer and have it immediately spew out a weird series of beeps at you, one of those vital components is damaged or not installed correctly (if at all).
The first is a check done by the power supply to determine if internal voltage and current levels are valid. Next is a check done by the OS BIOS (Basic Input/Output System) program, which mainly concerns the existence of vital computer components such as the Central Processing Unit (CPU), Random Access Memory (RAM) and any Video (Graphics) Cards. If you have ever started your computer and have it immediately spew out a weird series of beeps at you, one of those vital components is damaged or not installed correctly (if at all).


==== Find Basic Hardware ====
==== Find Basic Hardware ====
Once those basic checks are done, the [http://en.wikipedia.org/wiki/BIOS BIOS] searches for any adapters that contain their own [http://en.wikipedia.org/wiki/Read-only_memory ROM] chips. [http://en.wikipedia.org/wiki/Read-only_memory ROM] chips on adapters are used to store vital code that specifies how to run that adapter. If the [http://en.wikipedia.org/wiki/BIOS BIOS] finds any of these adapter [http://en.wikipedia.org/wiki/Read-only_memory ROM] chips, they are mapped (not loaded) into the physical memory. One prime example is the video card adapter [http://en.wikipedia.org/wiki/Read-only_memory ROM], once executed it usually displays the video card manufacturer and detailed hardware info such as how much [http://en.wikipedia.org/wiki/Random_Access_Memory RAM] is on the video card.
Once those basic checks are done, the BIOS searches for any adapters that contain their own ROM chips. ROM chips on adapters are used to store vital code that specifies how to run that adapter. If the BIOS finds any of these adapter ROM chips, they are mapped (not loaded) into the physical memory. One prime example is the video card adapter ROM, once executed it usually displays the video card manufacturer and detailed hardware info such as how much RAM is on the video card.


==== POST ====
==== POST ====
Next is the [http://en.wikipedia.org/wiki/Power-on_self-test POST (Power-On Self-Test)]. This process involves further tests of computer hardware. The main concerns of the [http://en.wikipedia.org/wiki/Power-on_self-test POST] is a working video card adapter, a functional [http://en.wikipedia.org/wiki/BIOS BIOS] program and memory integrity tests. Newer generation [http://en.wikipedia.org/wiki/BIOS BIOS] programs also have further tests such as automatic hard drive detection. Most of these tests you will see on the video display output in some form.
Next is the POST (Power-On Self-Test). This process involves further tests of computer hardware. The main concerns of the POST is a working video card adapter, a functional BIOS program and memory integrity tests. Newer generation BIOS programs also have further tests such as automatic hard drive detection. Most of these tests you will see on the video display output in some form.


==== Loading the MBR ====
==== Loading the MBR ====
All the processes discussed so far brings us to the point where control of the computer at the lowest level is finally available to whomever programs it. Here is where the [http://en.wikipedia.org/wiki/BIOS BIOS] program loads the [[MBR (x86)|Master Boot Record]] (MBR) from the first device specified in the [http://en.wikipedia.org/wiki/BIOS BIOS] setup. A typical device boot order is from the floppy drive (A), then from the first hard drive (C). Newer [http://en.wikipedia.org/wiki/BIOS BIOS] programs include booting from such things as CD-ROM, zip drives and from a network. The [http://en.wikipedia.org/wiki/BIOS BIOS] will load the MBR into [http://en.wikipedia.org/wiki/Random_access_memory RAM] at physical memory address 0000:7C00. It isn't necessary for you to understand what that memory address means yet.
All the processes discussed so far brings us to the point where control of the computer at the lowest level is finally available to whomever programs it. Here is where the BIOS program loads the [[MBR (x86)|Master Boot Record]] (MBR) from the first device specified in the BIOS setup. A typical device boot order is from the floppy drive (A), then from the first hard drive (C). Newer BIOS programs include booting from such things as CD-ROM, zip drives and from a network. The BIOS will load the MBR into RAM at physical memory address 0000:7C00. It isn't necessary for you to understand what that memory address means yet.


Once the MBR is loaded into [http://en.wikipedia.org/wiki/Random_access_memory RAM], the [http://en.wikipedia.org/wiki/BIOS BIOS] program checks for a specific pattern which consists of two bytes at the end of the MBR in the form of 0x55AA. This special pattern is nothing more than a way of telling the [http://en.wikipedia.org/wiki/BIOS BIOS] program that "this" MBR was meant to be booted from. If the [http://en.wikipedia.org/wiki/BIOS BIOS] program cycles through all available boot device MBRs and doesn't find that special pattern, the computer will hang after the [http://en.wikipedia.org/wiki/Power-on_self-test POST] with a messages along the lines of "no ROM BASIC", "no valid disk found" or "invalid boot device". If the [http://en.wikipedia.org/wiki/BIOS BIOS] program does find this special pattern then processor execution control is given to that MBR program.
Once the MBR is loaded into RAM, the BIOS program checks for a specific pattern which consists of two bytes at the end of the MBR in the form of 0x55AA. This special pattern is nothing more than a way of telling the BIOS program that "this" MBR was meant to be booted from. If the BIOS program cycles through all available boot device MBRs and doesn't find that special pattern, the computer will hang after the POST with a messages along the lines of "no ROM BASIC", "no valid disk found" or "invalid boot device". If the BIOS program does find this special pattern then processor execution control is given to that MBR program.


[[Category:X86]]
[[Category:X86]]

Revision as of 22:52, 14 February 2007

Power Supply Self-Check

The first is a check done by the power supply to determine if internal voltage and current levels are valid. Next is a check done by the OS BIOS (Basic Input/Output System) program, which mainly concerns the existence of vital computer components such as the Central Processing Unit (CPU), Random Access Memory (RAM) and any Video (Graphics) Cards. If you have ever started your computer and have it immediately spew out a weird series of beeps at you, one of those vital components is damaged or not installed correctly (if at all).

Find Basic Hardware

Once those basic checks are done, the BIOS searches for any adapters that contain their own ROM chips. ROM chips on adapters are used to store vital code that specifies how to run that adapter. If the BIOS finds any of these adapter ROM chips, they are mapped (not loaded) into the physical memory. One prime example is the video card adapter ROM, once executed it usually displays the video card manufacturer and detailed hardware info such as how much RAM is on the video card.

POST

Next is the POST (Power-On Self-Test). This process involves further tests of computer hardware. The main concerns of the POST is a working video card adapter, a functional BIOS program and memory integrity tests. Newer generation BIOS programs also have further tests such as automatic hard drive detection. Most of these tests you will see on the video display output in some form.

Loading the MBR

All the processes discussed so far brings us to the point where control of the computer at the lowest level is finally available to whomever programs it. Here is where the BIOS program loads the Master Boot Record (MBR) from the first device specified in the BIOS setup. A typical device boot order is from the floppy drive (A), then from the first hard drive (C). Newer BIOS programs include booting from such things as CD-ROM, zip drives and from a network. The BIOS will load the MBR into RAM at physical memory address 0000:7C00. It isn't necessary for you to understand what that memory address means yet.

Once the MBR is loaded into RAM, the BIOS program checks for a specific pattern which consists of two bytes at the end of the MBR in the form of 0x55AA. This special pattern is nothing more than a way of telling the BIOS program that "this" MBR was meant to be booted from. If the BIOS program cycles through all available boot device MBRs and doesn't find that special pattern, the computer will hang after the POST with a messages along the lines of "no ROM BASIC", "no valid disk found" or "invalid boot device". If the BIOS program does find this special pattern then processor execution control is given to that MBR program.