In-depth understanding and optimization of the Windows XP boot

  
system startup is a three-step process. The first step starts from the power-on, and the system BIOS performs a routine power-on self-test on the hardware device, that is, the so-called POST (Power On Self Test) check, including RAM check, soft and hard drive, and CD-ROM drive detection. . Next, BiOS reads the boot loader of the active partition master record MBR (Master Boot Record). Finally, when the boot loader initialization is complete, the operating system boot process begins. Starting the operating system involves a lot of tasks and therefore takes the longest time. Typical tasks include booting the operating system kernel, loading disk volumes, loading device drivers, reading registration information, finding new hardware devices, initializing display devices, and displaying Out of the user interface, etc.

At the same time, it also has to connect to the network and implement various user-defined configurations, such as security configuration. Win XP speeds up the boot process by collaborating more effectively with hardware.

If you are planning to purchase a new motherboard running XP, consider whether the motherboard's BIOS supports SBFS, the Simple Boot Flag Specification, or the "Simple Boot Mark Specification", which is better able to operate with the BIOS. The system works with optimized startup speeds, such as minimizing BiOS memory detection time, no longer initializing devices for plug-and-play operating systems, and more.

Win XP's NTLDR boot loader has also been optimized. The task of starting the loader is to read and load the operating system kernel and related system files. In Win XP, the boot loader caches file and directory information, and reads the system files in just one I/O cycle, significantly increasing the speed of loading the operating system kernel. The XP kernel is also optimized to increase boot speed. Now, disk I/O operations and device initialization operations can overlap to some extent by detecting the device and loading the driver into memory while the disk is being read. In addition, the driver written for XP must be done, only the device that will be used will be initialized. In XP, the network is also initialized when the system is started, not later.

Win XP uses "pre-read" technology
to load device drivers, services, and shell programs before actually using them. The key to pre-reading technology
is to learn the previous boot process and optimize the load mode for the various files used during the boot process. This optimized technology
is also used in the application software, the system analyzes the first few startups of each application, and then creates a virtual "memory image" that describes the application requirements and puts this information Save to the WindowsPREFETCH folder. Once the image is built, the application software is loaded much faster. XP's pre-read data holds information about the last 8 system startups or application startups.

The effect of pre-reading technology
can be seen through a simple experiment: delete the pre-read data corresponding to an application under the WINDOWSPREFETCH directory, and then see that there is pre-reading. The difference between data and no pre-read data. Take Word as an example. If you haven't used it before, start it a few times and then use it in the normal way; then, record how long it takes for Word to start from clicking on the icon. Next, delete all WINWORD.EXE.*.PF files in the WindowsPREFETCH directory, click on the Word icon again to launch it and see how long it takes to start. As you can see, the time difference between the two starts is very large. But don't worry, Win XP will start collecting pre-read data for Word again. After several startups, Word will start up very quickly. For boot loaders, there are also pre-read data files that work similarly, but if you're just experimenting, it's best not to delete them.

Briefly explain the naming rules for files under the PREFETCH folder. As mentioned earlier, each application (including the boot process of XP) has a corresponding pre-read file in the PREFETCH directory. The pre-read file describes the loading order of each module when the application starts. The name of the prefetch file is based on the name of the application executable file, plus a "-" and a hexadecimal value describing the full path of the executable file, plus the file extension .PF, such as MMC.EXE-461B77C5. Pf. However, on any system, XP starts pre-reading files with the same name, NTOSBOOT-B00DFAAD.PF.

Pre-read data also helps with Win XP's defragmentation tools. The information about the optimal pre-reading order is saved in the Layout.ini file in the WindowsPREFETCH directory. You can open this file with Notepad and see how Win XP thinks how to arrange the physical location of the file on the disk to achieve the fastest startup. speed. The basis for the defragmentation tool to transfer file locations is here. In fact, when Win XP notices that the computer is idle, it will run the defragmentation tool and try to optimize the location of the file.

Win XP has the ability to buffer network connections and configuration, which allows XP to respond to network operations faster than previous Windows. By default, Win XP prefers a buffered network view instead of a real-time detected network view. That is to say, when you open the network view, Win XP displays the previously buffered network view, and it tries to establish a connection in the background. This processing method reduces the network operation delay time, even if the domain, DHCP or DNS server on the network fails, giving the user a smooth operation feeling.

Let's take a look at how the system should be optimized if the motherboard BIOS does not support the SBFS specification. Since the BIOS menus of different manufacturers are different, only a few items to be concerned can be given here. The menu or option names actually displayed by BiOS may differ:

Enable Quick POST (Quick POST) . This will disable operations such as full memory checking and launching Logo.

Disabling Boot up floppy seek, searching for a floppy drive will take a certain amount of startup time.

Adjust the order of boot devices, preferably set to "C only" (boot from hard drive only). This not only improves the startup speed (avoids the system checking for unbootable devices, such as floppy drives without floppy disks), but also prevents the system from booting from a floppy drive or other device. When there are special needs, such as the inability to boot with the C drive, then change the boot device to a device such as a floppy drive or CD-ROM in BiOS.

Enable PnP-OS (Plug and Play OS). This option disables the BiOS detection device and leaves the task of detecting the device to the operating system. For mainstream Windows operating systems, enabling this option can significantly reduce startup time.

For operating systems, the most important thing to increase startup speed is to prohibit various unnecessary programs and services from starting automatically. Win XP provides a handy tool: Click "Run" in the "Start" menu, run msconfig, and then disable all unnecessary programs from starting automatically.

Finally, a tool is recommended that analyzes, displays, and optimizes the startup process of the system. This tool is BootVis, you can search for "BootVis" from the Microsoft Download Center, because the download Url is very long, it will not be given here. After downloading, unzip and click BootVis.exe to run. Close all other running software and select BootVis's menu File>New>Next Boot+ Drivers Trace. The system will restart in 15 seconds. After rebooting, wait a moment, because there are some files to write to disk - you can see the corresponding prompt. At the end of this process, BootVis starts again and displays the chart shown in Figure 1. For a detailed description of these charts, see the help of BootVis, which will not be explained here. If you don't want to know the details of BootVis' work, it's enough to know that these diagrams describe the time it takes to load the various parts during startup.



If you want to optimize the system, you should repeat the above process 4-5 times. When you are done, select BootVis's menu Trace>Optimize System and wait for a reboot. This time the startup time will be much longer than before. After logging in to Win XP, defragment is performed immediately. In the future, you will be able to enjoy the feeling of deep optimization after the startup speed.

Copyright © Windows knowledge All Rights Reserved