China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-13 23:53
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Preliminary Boot Tutorial (5): The Complete Computer Boot Process View 1,447 Replies 5
Original Poster Posted 2002-11-21 00:00 ·  中国 湖北 随州 电信
元老会员
★★★
Credits 1,987
Posts 632
Joined 2002-10-27 00:00
23-year member
UID 73
Gender Male
Status Offline
This article explains what exactly the computer does from the moment you turn on the power until the blue-sky-and-white-clouds screen of Windows 9x appears. During the boot process, the computer has a very complete hardware self-test mechanism. For computers using award bios, in those brief few seconds of power-on self-test, it can complete more than 100 test steps.
  
First let's understand some basic concepts. The first is the BIOS (Basic Input/Output System), which everyone is very familiar with. BIOS is low-level code that deals directly with hardware, and it provides the operating system with the basic functions for controlling hardware devices. BIOS includes the system BIOS (that is, what we usually call the motherboard BIOS), video card BIOS, and the BIOS of other devices (such as IDE controllers, SCSI cards, or network cards). Among them, the system BIOS is the main focus of this article, because the computer boot process is carried out under its control. BIOS is generally stored in ROM (read-only memory chips), and even after shutdown or power loss, this code will not disappear.
  
The second basic concept is memory addresses. Our machines are generally equipped with 32MB, 64MB, or 128MB of memory. Every byte in this memory is assigned an address so that the CPU can access it. The address range of 32MB expressed in hexadecimal is 0~1FFFFFFH, among which the low 1MB memory from 0~FFFFFH is very special, because the original 8086 processor could access at most only 1MB of memory. Of this 1MB, the lower 640KB is called conventional memory, while A0000H~BFFFFH is reserved for the video card's video memory, and C0000H~FFFFFH is reserved for BIOS use. Of this area, the system BIOS generally occupies the last 64KB or a little more, the video card BIOS is generally at C0000H~C7FFFH, and the IDE controller BIOS is at C8000H~CBFFFH.

After understanding these basic concepts, let's now take a careful look at the computer boot process.

Step One
  
When we press the power switch, the power supply begins supplying power to the motherboard and other devices. At this time the voltage is still not very stable, and the control chipset on the motherboard will send and hold a Reset signal to the CPU, causing the CPU to automatically return to its initial state internally, but the CPU will not immediately execute instructions at this moment. When the chipset detects that the power supply has begun providing stable power (of course, the process from unstable to stable takes only an instant), it removes the RESET signal (if the machine is being restarted by manually pressing the Reset button on the computer case, then when that button is released the chipset will remove the RESET signal), and the CPU immediately begins executing instructions from address FFFF0H. As we know from the earlier introduction, this address is actually within the address range of the system BIOS. Whether it is Award BIOS or AMI BIOS, what is placed here is only a jump instruction, which jumps to the real boot code in the system BIOS.

Step Two
  
The first thing the system BIOS boot code does is carry out POST (Power-On Self Test). The main task of POST is to check whether some key devices in the system exist and can work properly, such as memory and the video card. Since POST is the earliest test process to run, the video card has not yet been initialized at this time. If the system BIOS finds some fatal errors during POST, for example if no memory is found or there is a problem with the memory (at this time only the 640K conventional memory will be checked), then the system BIOS will directly control the speaker to sound an error report. The length and number of beeps represent the type of error. Under normal circumstances, the POST process is very fast, and we can hardly notice its existence. After POST is finished, other code will be called to carry out a more complete hardware check.

Step Three
  
Next, the system BIOS will look for the BIOS of the video card. As mentioned earlier, the starting address of the ROM chip storing the video card BIOS is usually set at C0000H. After the system BIOS finds the video card BIOS there, it calls its initialization code, and the video card BIOS initializes the video card. At this time, most video cards will display some initialization information on the screen, introducing the manufacturer, graphics chip type, and so on, but this screen almost flashes by in an instant. The system BIOS will then look for the BIOS programs of other devices. After finding them, it likewise calls the initialization code inside these BIOSes to initialize the related devices.

Step Four
  
After finishing the search for the BIOS of all other devices, the system BIOS will display its own startup screen, including the type, serial number, and version number of the system BIOS.

Step Five
  
Next, the system BIOS will detect and display the CPU type and operating frequency, then begin testing all RAM, while at the same time showing the progress of the memory test on the screen. In the CMOS settings, we can choose for ourselves whether to use a simple, faster test method or a detailed, slower one.

Step Six
  
After the memory test passes, the system BIOS will begin detecting some standard hardware devices installed in the system, including the hard disk, CD-ROM, serial port, parallel port, floppy drive, and so on. In addition, the vast majority of newer versions of system BIOS will also automatically detect and set memory timing parameters, hard disk parameters, access modes, and so forth during this process.

Step Seven
  
After the standard device check is complete, the Plug and Play support code inside the system BIOS will begin detecting and configuring the Plug and Play devices installed in the system. Each time it finds a device, the system BIOS will display information such as the device name and model on the screen, and at the same time assign resources such as interrupts, DMA channels, and I/O ports to the device.

Step Eight
  
By this step, all hardware has already been detected and configured. Most system BIOSes will clear the screen again and display a table at the top of the screen, briefly listing the various standard hardware devices installed in the system, as well as the resources they use and some related operating parameters.

Step Nine
  
Next, the system BIOS will update ESCD (Extended System Configuration Data). ESCD is a method the system BIOS uses to exchange hardware configuration information with the operating system. This data is stored in CMOS (a small piece of special RAM powered by the battery on the motherboard). Normally ESCD data is updated only after the system hardware configuration has changed, so we do not see messages like "Update ESCD… Success" every time the machine boots. However, the system BIOS of some motherboards uses a data format different from that of Windows 9x when saving ESCD data, so Windows 9x will modify the ESCD data into its own format during its own boot process. But at the next boot, even if the hardware configuration has not changed, the system BIOS will change the ESCD data format back again. Repeating like this will cause the system BIOS to update ESCD every time the machine boots. This is why some machines display related information at every startup.

Step Ten
  
After ESCD has been updated, the system BIOS boot code performs its final task: booting from the floppy disk, hard disk, or CD-ROM according to the boot order specified by the user. Taking booting from drive C as an example, the system BIOS will read and execute the master boot record on the hard disk. The master boot record then finds the first active partition from the partition table, then reads and executes the partition boot record of that active partition, and the partition boot record will be responsible for reading and executing IO.SYS, which is the most basic system file of DOS and Windows 9x. IO.SYS in Windows 9x first initializes some important system data, then displays the familiar blue sky and white clouds. Under this screen, Windows will continue carrying out the boot and initialization work for the DOS part and the GUI part.

If software tools for booting multiple operating systems are installed in the system, then usually the master boot record will be replaced by that software's boot code. This code will allow the user to choose an operating system, then read and execute that operating system's basic boot code (for DOS and Windows, the basic boot code is the partition boot record).

What was introduced above is the various initialization work the computer must complete during a cold boot when the power switch is turned on (or the Reset key is pressed). If we do a warm boot under DOS by pressing the Ctrl+Alt+Del key combination (or choose Restart Computer from Windows), then the POST process will be skipped and it will start directly from Step Three. In addition, the Step Five CPU detection and memory test will not be carried out again. We can see that whether it is a cold boot or a warm boot, the system BIOS repeats these things again and again that we usually do not pay much attention to. Yet it is precisely these monotonous hardware test steps that provide the foundation for us to use the computer normally.
http://dos.e-stone.cn/dosbbs
uploadImages/200311161145850422.swf
Floor 2 Posted 2002-12-02 00:00 ·  中国 广东 汕尾 电信
初级用户
Credits 164
Posts 18
Joined 2002-11-30 00:00
23-year member
UID 372
Gender Male
Status Offline
My eyes are almost blurred from reading this. But it's worth it.
I'll bump it again.
我就是我,我要努力。
Floor 3 Posted 2004-06-23 00:00 ·  中国 天津 电信
中级用户
Credits 297
Posts 44
Joined 2004-06-15 00:00
22-year member
UID 26749
Gender Male
Status Offline
Floor 4 Posted 2004-07-13 00:00 ·  中国 山东 烟台 联通
中级用户
Credits 293
Posts 42
Joined 2003-10-17 00:00
22-year member
UID 11396
Gender Male
Status Offline
Mm, I was just about to take a look
Floor 5 Posted 2004-07-14 00:00 ·  中国 浙江 绍兴 电信
初级用户
Credits 115
Posts 3
Joined 2004-07-14 00:00
22-year member
UID 28384
Gender Female
Status Offline
OK
Floor 6 Posted 2004-07-15 00:00 ·  中国 浙江 杭州 电信
中级用户
Credits 209
Posts 34
Joined 2004-05-25 00:00
22-year member
UID 25296
Gender Male
Status Offline
Good stuff, just not very detailed, but still worth bumping.
Forum Jump: