In the past, often in order to optimize the home Windows 7 system startup time distress, so I bought a solid state hard disk and can make smart cache motherboard for optimization, and then often use security Defender 360 of the start time optimization as a benchmark, Seeing an optimized computer can start the system in 17 seconds and show up in security defender 360 to beat the country's 99% of computers. However, the recent work of the notebook computer because of work to upgrade the Windows 8 RTM version, but was surprised to find in my big black ThinkPad W520, unexpectedly start time is 7 seconds, not wrong, really is the stunning 7 seconds!!! Compare the same with SSD launched the home of Mac Air unexpectedly still have to win a chip. So what's hidden in Windows 8? Let's Find out!
Have you ever been bothered by the fact that you've been trying to optimize startup time? Smart you might use the way I used to sleep, but it's obvious that it's a way to keep the state of power on the back of the battery, or it's not good for the life of the laptop or the computer. The advent of Windows 8 is designed to satisfy the cold start that we can efficiently and quickly. In fact, the boot process has been properly optimized and improved in Windows 7, such as parallel loading of device drivers and service startup, but Windows 8 is clearly a step closer to the point where Windows 8 is an innovative combination of cold start and hibernate to speed up the startup process.
So what are the steps involved in the startup and shutdown process in Windows 7?
A complete shutdown process includes:
Select the Close button in the Start menu or press the power button or the application initiates the shutdown by invoking the API ExitWindowsEx () or Initiateshutdown ().
The WINDOWS system broadcasts shutdown information to the applications that are running, giving them the opportunity to save active data and setting state, and the application can request a little extra time.
The Windows system closes each logged in user session.
The Windows system sends the system shutdown information to all services and tells the shutdown process has started, and then shuts it down sequentially, shutting down the service in parallel and shutting down the service with dependencies. If the service is not responding, the system forces the shutdown.
The system will also tell all devices to turn it off.
Windows shuts down its own system session (Session 0)
The Windows system flushes all pending data to the hard disk and ensures that it is fully saved.
The Windows system notifies the underlying power module shutdown through the ACPI Power interface.
What about the startup process for the system? (I'll also discuss the future of the diskless San boot boot Windows Server 2012 blog)
When the power button is pressed, the PC's firmware initiates the power-on self-test process (known as post) and loads the firmware settings. A valid system disk is detected at the end of this boot process to continue. (Of course we need to set the boot sequence after the hardware is detected in the BIOS.)
The firmware embedded launcher reads the master boot record (MBR) and then starts the Bootmgr.exe. Bootmgr.exe finds and starts the Windows loader (Winload.exe) on the Windows boot partition.
Load the basic drivers needed to start the Windows kernel and then Windows's kernel program starts running, in which the system registry hive and the add-on labeled Boot_start drivers are loaded into memory.
The Windows kernel passes control to the session Manager process (Smss.exe) to initialize the system session and then load and start devices and drivers that are not marked as Boot_start.
Winlogon.exe starts, displays the user login screen, Service Control Manager starts the service, and the corresponding Group Policy script runs. When a user logs on, Windows creates the user's session.
Explorer.exe starts, the system creates an initialization desktop and displays its Desktop Window Manager (DWM) process.
From the shutdown process above, you can find that the system needs to shut down all user sessions and kernel sessions, shut down services and devices before shutting down completely.
The key changes that Windows 8 can launch quickly are:
The user session is closed in Windows 8, but the kernel session is not closed but is handled in a flexible hibernation mode. Compared to full hibernation, because the application uses a lot of memory pages, the relative if only keep the system session 0 of the sleep state data is actually much smaller, which will greatly reduce the amount of memory used in hibernation to write to disk time. Hibernation means that files written to disk (Hiberfil.sys) effectively hold the state of the system and the contents of the memory, and then recover and restore the content by reading it back to memory. This technique is used by Windows 8 cold booting, which can read dormant files and reinitialize drivers much faster, with a significant increase in 30-70% on most hosts. This is also easier to see, smart fellow reader you know:
The rate of recovery from hibernation is obviously much faster than a reinitialization recovery (which is not the reason we can choose to hibernate before). In addition, Windows 8 also increased the functionality of multi-stage recovery, such as a stand-alone system of distributed job dismantling, for example, if you are i5 or i7 four core hosts will take full advantage of all the kernel concurrent read and decompression sleep hibernate files, to know whether the decompression or CPU consumption; This feature is also a great boost for us to restore the system from hibernation!
In addition, it is worth mentioning how to treat the hibernation file, in the Windows 8 system with DIR/S/ah Hiberfile.sys You may find that this is quite a large one. The default is to use 75% of physical memory as the size of the hibernation file. is essentially the size of the state data that is written as the system is to enter hibernation. Actually, as a quick start, it is usually just 10 ~15% of physical memory (depending on the driver, service, and other factors).
Another important feature of the fast start of Windows 8 is that although this approach does not fully enumerate all Plug and Play device drivers, the fast drive mode still initializes the driver. So cold start in the fast start mode can still be as easy as before to deal with the changes in the hardware environment. Of course, if you have the conditions to use the SSD fast start effect will be more obvious, you also understand even read a small number of dormant files solid-state disk than mechanical hard drive to force.
There is also a worthy introduction of the fact that if your PC is not old, of course, compared with the old BIOS boot, the new UEFI (Unified Extensible Firmware Interface) BIOS startup speed is much faster. Uefi the CPU and memory are initialized first, unlike the BIOS, then the load and initialization of other devices will likely be processed in parallel, which will greatly increase the system's boot speed. Of course, the majority of host motherboards are now supported UEFI mode:)
Finally, check that your Windows 8 is starting this feature, of course, the default should be open:
Running powercfg/a at the command line, you can see that my system has enabled the Quick Launch feature.
Through Control Panel, you can also set up and view:
Finally, you may know that you can disable hibernation and reclaim disk space by running the powercfg/hibernate off command, but looking at the Quick Launch section described earlier perhaps you should be aware that doing so will not only disable the Hibernate even fast start function. If you want to go straight back to Windows 7
Boot state, you can run the SHUTDOWN/S/full/t 0 shutdown or choose to reboot from the graphical interface will trigger an old cold start process, but why do you want to go back?