Computer Startup Process

Source: Internet
Author: User

Computer Startup Process]

This post includes:

1. General Computer Startup Process (more detailed)

2. Start Windows XP (more detailed)

3. Vista boot process (rough)

General Computer Startup Process

Step 1:
When we press the power switch, the power supply starts to power the motherboard and other devices, the voltage is not stable, the control chipset on the motherboard will send to the CPU and keep a reset (reset) signal, so that the CPU is automatically restored to the initial state, but the CPU will not immediately execute the command at the moment. When the chipset detects that the power supply has begun to stabilize the power supply (of course, the process from unstable to stable is only a matter of an instant ), it removes the reset signal (if you manually press the reset button on the computer panel to restart the machine, the chipset removes the reset signal when the button is released ), the CPU immediately starts executing commands from the address ffff0h. From the previous introduction, we can see that this address is actually within the system BIOS address range, whether it is Award bios or ami bios, here is just a jump command, jump to the real startup code in the system BIOS.

Step 2:
The first thing to do with the startup code of the system BIOS is to perform post (power-on self test, self-check after power-on ), the main task of post is to detect the existence and normal operation of some key devices in the system, such as memory and video card devices. Since post is the earliest detection process, the video card has not been initialized yet. If the system BIOS finds some fatal errors during the post process, for example, if the memory is not found or the memory is faulty (only KB of general memory will be checked at this time), the system BIOS will directly control the speaker voice to report the error, the length and number of sounds indicate the type of errors. Under normal circumstances, the post process is very fast and we can hardly feel its existence. After the post process is completed, other code will be called for more complete hardware detection.

Step 3:
Next, the system BIOS will look for the BIOS of the video card. As mentioned above, the starting address of the ROM chip storing the video card BIOS is usually located at c0000h, after the system BIOS finds the video card bios, it calls its initialization code. The video card BIOS initializes the video card. At this time, most video cards will display some initialization information on the screen, introduce the manufacturer, graphics chip type and other content, but this picture is almost a flash. The system BIOS then looks for the BIOS program of another device. After finding the program, you also need to call the initialization code in the BIOS to initialize the relevant device.

Step 4:
After finding the BIOS of all other devices, the system BIOS displays its own boot screen, including the type, serial number, and version number of the system BIOS.

Step 5:
Then, the system BIOS detects and displays the CPU type and operating frequency, starts testing all ram, and displays the Memory Test Progress on the screen, we can choose to use a simple and time-consuming or detailed testing method in the CMOS settings.

Step 6:
After the memory test is passed, the system BIOS starts to detect some standard hardware devices installed in the system, including hard disks, CD-Rom, serial ports, parallel ports, and soft drives, in addition, the vast majority of newer versions of the system BIOS also need to automatically detect and set the memory timing parameters, hard disk parameters and access mode.

Step 7:
After the standard device is detected, the plug-and-play code in the system BIOS starts to detect and configure the plug-and-play devices installed in the system. After each device is found, the system BIOS displays the device name, model, and other information on the screen, and allocates resources such as interrupts, DMA channels, and I/O ports to the device.

Step 8:
By now, all hardware has been tested and configured. Most system BIOS will be refreshed and a table is displayed above the screen, it roughly lists the various standard hardware devices installed in the system, the resources they use, and some related working parameters.

Step 9:
Next, the system BIOS updates the escd (extended system configuration data, extended system configuration data ). The escd is a means for the system BIOS to exchange hardware configuration information with the operating system. The data is stored in CMOS (a small block of special ram, powered by a battery on the motherboard. Generally, the escd data is updated only after the hardware configuration of the system is changed. Therefore, we do not see "Update escd every time we start the machine... success ", however, the BIOS of some motherboard uses a different data format than Windows 9x when saving escd data, therefore, Windows 9x will change the escd data to its own format during its own startup, but even if the hardware configuration does not change during the next startup, the system BIOS will also change the escd data format back, so that the loop will cause the system BIOS to update the escd every time the machine is started, this is why some machines will display relevant information each time they are started.

Step 10:
After the escd is updated, the startup code of the system BIOS performs the last task, that is, starting from a floppy disk, hard disk, or optical drive according to the boot sequence specified by the user. Take disk C as an example. The system BIOS will read and execute the Master Boot Record on the hard disk. The Master Boot Record will then find the first active partition from the partition table, then read and execute the Partition Boot Record of the active partition, And the Partition Boot Record reads and executes Io. sys (after 2000 and XP are installed, read and execute ntldr), which is the most basic system file for DOS and Windows 9X. Windows 9x Io. sys first needs to initialize some important system data, and then shows the familiar blue sky and white clouds. In this picture, Windows will continue to perform dos and Gui (graphic user interface) partial boot and initialization work.

If a tool or software is installed in the system that directs multiple operating systems, the Master Boot Record is usually replaced with the boot code of the software, which allows you to select an operating system, then read and execute the basic Boot Code of the operating system (the Basic Boot Code of DOS and Windows is the Partition Boot Record ).

The following post describes how to start XP.

Start Windows XP

From pressing the computer switch to start the computer, to logging on to the desktop to complete the startup, it has gone through the following phases:

Quote:
1. Pre-boot phase;
2. Pilot phase;
3. kernel loading phase;
4. initialize the kernel;
5. log on.

--------------------------------------------------------------------------------

Detailed introduction of each startup phase
A) pre-guided phase
This is called the pre-boot phase during which the computer is started by pressing the power of the computer and before the Windows XP Professional operating system is started, the computer first runs power on self test (post) to check the total memory of the system and the status of other hardware devices. If the BIOS of the computer system (Basic Input/Output System) is out-of-the-box, the computer hardware device will be inspected and configured. The computer's Basic Input/Output System (BiOS) locates the computer's boot device, and the MBR (Master Boot Record) is loaded and run. In the pre-boot phase, the computer will load the ntldr file of Windows XP.
B) Guiding phase
The Windows XP Professional boot phase contains four small phases.
First, the computer needs to go through the initial Boot Loader phase (initial Boot Loader). In this phase, ntldr converts the computer microprocessor from the real mode to the 32-bit flat memory mode. In real mode, the system reserves KB of memory for the MS-DOS, and the rest of the memory is considered as extended memory, while in 32-bit flat memory mode, the system (Windows XP Professional) regards all memory as available memory.
Then, ntldr (NT loader) starts the built-in mini-file system drivers. Through this step, ntldr can identify each partition formatted with NTFS or fat file system, so that you can find and load Windows XP Professional. Here, the initial Boot Loader stage is over.
Then the system comes to the operating system selection stage. If more than one operating system (that is, multiple systems) is installed on the computer, and the boot is correctly set. if ini enables the system to provide the OS selection, the computer display displays an OS menu.
Boot. ini contains the following content:

[Copy to clipboard] [-] Code:
[Boot loader]
Timeout = 30
Default = multi (0) disk (0) RDISK (0) Partition (1)/Windows
[Operating systems]
Multi (0) disk (0) RDISK (0) Partition (1)/Windows = "Microsoft Windows XP Professional"/fastdetect
Multi (0) disk (0) RDISK (0) Partition (2)/winnt = "Windows 2000 Professional"

Here, multi (0) indicates the disk controller, disk (0) RDISK (0) indicates the disk, and partition (x) indicates the partition. Ntldr is used to find the location of the system files of Windows XP Professional.
(* Gnaw0725 Note: For instructions on boot. ini, see:
Http://support.microsoft.com/kb/289022/zh-cn
Http://support.microsoft.com/kb/314081/zh-cn
)
If. if there is only one operating system option in ini or the value of timeout is set to 0, the system does not display the operating system selection menu and directs directly to the unique or default system. After you select to start Windows XP Professional, the operating system selection phase ends and the hardware detection phase begins.
In the hardware detection phase, ntdetect.com collects the computer hardware information list and returns the list to ntldr, so that the hardware information can be added to the hardware in the Registry HKEY_LOCAL_MACHINE.
After the hardware detection is complete, enter the configuration selection stage. If the computer contains a list of multiple hardware configuration files, you can click the up or down button to select. If there is only one hardware configuration file, the computer will load Windows XP Professional Edition directly with the default configuration file without displaying this screen.
The boot phase ends. During the boot phase, the system will use a total of Files: ntldr, boot.ini, ntdetect.com, ntokrnl.exe, ntbootdd. sys, bootsect. Dos (optional ).
C) kernel loading stage
During kernel loading, ntldr loads ntokrnl.exe, which is called the Windows XP kernel. The system loads the Windows XP kernel but does not initialize it. Then, ntldr loads the hardware abstraction layer (Hal, Hal. dll), and the system continues to load the HKEY_LOCAL_MACHINE/system key. ntldr reads the select key to determine which control set will be loaded. The control set contains the driver of the device and the services to be loaded. Ntldr loads the driver of the underlying device whose start key value is 0 under HKEY_LOCAL_MACHINE/system/service. When the current control set of the image used as the control set is loaded, ntldr passes the control to the kernel and the kernel initialization starts.
D) initialize the kernel.
At the beginning of the kernel initialization stage, the color Windows XP logo and progress bar are displayed in the center of the screen. At this stage, the system has completed the following four tasks:
The kernel uses the data collected during hardware detection to create the HKEY_LOCAL_MACHINE/hardware key.
The kernel creates a clone control set by referencing the default value of HKEY_LOCAL_MACHINE/system/current. The clone control set configuration is a backup of computer data, and does not include changes during startup.
The system initializes and loads device drivers. The kernel initializes the underlying drivers that are loaded during kernel loading, and then the kernel scans HKEY_LOCAL_MACHINE/system/CurrentControlSet/service /... the device driver with the START key value of 1. These device drivers are initialized when loaded. If an error occurs, the kernel uses the errorcontrol key value to determine how to handle the error. If the value is 3, the error mark is crisis/critical, the system restarts with lastknowngood control set when an error occurs for the first time. If an error still occurs when you start with lastknowngood control set, the system reports that the startup failed, the error message is displayed, and the system stops the startup; if the value is 2, the error is serious. The system fails to start and restarts with lastknowngood control set. If the system is already started with the value of lastknowngood, the system ignores the error and continues to start; when the value is 1, the error is normal. The system will generate an error message, but it will still ignore this error and continue to start; when the value is 0, it will be ignored, the system does not display any error information and continues running.
Session Manager starts Windows XP advanced subsystems and services. Session Manager starts Win32 subsystems and Winlogon processes that control all input and output devices and access the display screen. kernel Initialization is complete.
E) Login
Winlogon.exe starts the Local Security Authority, and the Windows XP Professional welcome screen or Login Dialog Box is displayed. At this time, the system may continue to initialize the unfinished driver in the background.
Prompt to enter a valid user name or password.
The service controller finally executes and scans HKEY_LOCAL_MACHINE/system/CurrentControlSet/servives to check whether there are services that need to be loaded. The service controller searches for services whose start key value is 2 or higher, the service is loaded according to the value of START and the value of dependongroup and depandonservice.
The startup of Windows XP is considered complete only after the user successfully logs on to the computer. After Successful Logon, the system copies the clone control set to the lastknowngood control set. After this step is completed, the system is successful.

--------------------------------------------------------------------------------

Conclusion
This article briefly describes the startup/boot process of Windows XP Professional on 32-bit computers, including each startup phase and detailed steps in the phase. Although error handling is not mentioned in this Article, by letting readers understand the startup process, they will become more calm and easier to find the cause of the error when encountering an error.

--------------------------------------------------------------------------------

References
[1] Microsoft Windows XP Professional Edition help;
[2] MCSE: Windows XP Professional Study Guide. sybex press.
[3] MCSE Training Kit Microsoft Windows XP Professional. Microsoft Press

Vista Boot Process

1. MBR reads the Boot Sector. This fan area is used to start bootmgr.exe (Windows Boot manager)

2.bootmgr.exe reads information in BCD (BOOT confi guration Data Store. This information contains the configurations of all operating systems installed on the computer and is used to generate a boot menu.

3. When you select the following actions in the Startup Menu:

If "Windows Vista" is selected, bootmgr.exe runs OS loader: winload.exe in the % SystemRoot %/system32 folder.

If you select "recover from sleep to Windows vista”", the startup Manager installs winresume.exe and restores your previous use environment.

If you select "earlier Windows version", the start manager locates the volume where the system is installed and loads the earlier OS loader(ntldr.exe) in the Windows NT style. the Startup Menu determined by the INI content.

When Windows Vista starts, it loads its core files ntoskrnl.exe and Hal. DLL to read the settings from the registry and load the driver. After the process is completed, you can log on to your system.

It seems that the MBR has changed after Vista is installed. Let's talk about what it looks like!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.