How does Windows 2000 boot

  

In fact, the boot process of Windows 2000 has been started since the installation.

Then let's start with the installation.

When the setup is running, it writes the MBR (master boot record) to the hard disk and writes the boot fan on the first bootable partition of the disk drive (that is, the partition we activated after fdisk). Area, the contents of the boot sector vary according to different file system formats (FAT or NTFS). If the MS has been installed on your machine and the boot sector is set up, the setup will check if the boot sector it is over is valid. If it is valid, the setup installer will copy the contents of the boot sector to the root of the partition. The files in the directory are in bootsect.dos. After the Setup program finishes writing the boot sector, it will copy the files used to the hard disk, including the two boot files Ntldr and Ntdetect.com. In addition, setup will also create the boot menu file boot.ini in the root directory of the boot partition.

Example:

[boot loader]
timeout=3
default=multi(0)disk(0)rdisk(0)partition(1)WINDOWS
[ ,null,null,3],Operating systems]
multi(0)disk(0)rdisk(0)partition(1)WINDOWS="Microsoft Windows "
multi(0)disk(0)rdisk(0)partition(2)WINDOWS=" Windows Server 2000" /fastdetect

This is the boot.ini file on my machine. This content shows two installed, win98 and win2000. The latter parameter /fastdetect is the most common and is the default when installing the system. Its role is to make ntdetect ignore the enumeration of attributes and serial devices. There are many related parameters in the Boot.ini file, each with different functions, because it has nothing to do with this article, so I don't make a specific introduction. Interested friends can go online to find relevant information.

Windows 2000 startup:

When you press the power button on the machine, the computer starts to boot, first the power-on self-test, after the bios boot computer to read the hard disk腗BR, according to the information in the MBR, find the boot partition, read the code of the boot sector in the boot partition into the memory and give control to the code. The role of the boot sector code is to provide the structure and format information of the disk drive (hard disk) to Windows 2000 and read the Ntldr file from the root directory of the disk. After the boot sector code loads Ntldr into the memory, it gives control to The entry point for Ntldr. If the boot sector code does not find the Ntldr file in the root directory, if the file system is in FAT format, it displays: "Boot: Ntldr cannot be found". If the boot file system is in NTFS format, it displays: "NTLDR is lost". Ntldr then reads the boot.ini file from the root directory using the built-in file system code (the Ntldr built-in code differs from the boot sector file system code in that the Ntldr file system code can read subdirectories). At this point, Ntldr clears the screen. If there is more than one boot option in boot.ini, the boot select menu is displayed. If there is no action within the timeout range specified by boot.ini, Ntldr will select the default option. After the boot option is determined, Ntldr loads and executes Ntdetect.com (this is a 16-bit real-mode program that uses the system bios to query the computer's basic device and setup information). Then, Ntldr starts to clear the screen and displays: "Starting Windows..." progress bar. This progress bar remains blank until Ntldr starts loading the boot driver (if there are 100 boot drivers, the progress bar increases by 1% for each file loaded). Below the progress bar is the message: "For troubleshooting and advanced startup options for , press F8 ." If you press the F8 key at this time, the advanced boot menu will appear, including: known last known good, safe Safe mode, debug mode, etc.

After that, Ntldr loads the appropriate kernel and HAL image files (default is Ntoskrnl.exe and HAL.dll), and reads the SYSTEM registry hive file (hive file is a file containing the registry subtree) To determine which boot drivers to load, load the boot driver, and prepare the CPU registers for the execution of Ntoskrnl.exe. After that, Ntldr calls Ntoskrnl.exe and starts to initialize the executor subsystem and boots the system-start device driver. After a series of initialization work is completed, Ntoskrnl.exe prepares for the system native application. Run smss.exe.

The main tasks of smss are: initialize the registry, create system environment variables, load the kernel mode part of the Win32 subsystem (Win32k.sys), start the subsystem process Crss, and start the login process winLogon. Then, winLogon begins its startup steps, such as creating initial windows and desktop objects. It then creates the Service Control Manager (SCM) process (WinntSystem32Services.exe), which loads all the services and device drivers marked as auto-start and the native security authentication subsystem (Lsass) process (Winntsystem32Lsass) .exe). When everything is successfully loaded and the user successfully logs in to the console, the SCM considers the system booting successfully, and the recently known correct configuration (HKLMSYSTEMselectLastKnownGood) in the registry is replaced by CurrentControlSet. Conversely, if the user selects the Known Recent Correct mode (LastKnownGood) in the Advanced menu at boot time or the driver returns a serious or critical error when loading, the system will use the value of LastKnownGood as the value of CurrentControlSet.

After that, we saw the familiar desktop. At this point, the boot process ends.

Due to space limitations, this article only briefly describes the general process of guidance. For some details, please read the other articles I have compiled.

Copyright © Windows knowledge All Rights Reserved