Yet another blog post from Steven Sinofsky where he talks about new features in Windows 8.
He talks extensively about how they planned to achieve faster bootup times for the operating system.
He sums up the goals as the following:
The new solution they came up with was a little bit of a hybrid of traditional cold boot and resuming from hibernate.
He goes on to explain how system shutdown and boot-ups work in Windows 7.
In Windows 7, Shutdown entails:
- The user initiates a shutdown by selecting “shut down” from the Start menu, or by pressing the power button; or an application initiates shutdown by calling an API such as ExitWindowsEx() or InitiateShutdown().
- Windows broadcasts messages to running applications, giving them a chance to save data and settings. Applications can also request a little extra time to finish what they’re doing.
- Windows closes the user sessions for each logged on user.
- Windows sends messages to services notifying them that a shutdown has begun, and subsequently shuts them down. It shuts down ordered services that have a dependency serially, and the rest in parallel. If a service doesn’t respond, it is shut down forcefully.
- Windows broadcasts messages to devices, signaling them to shut down.
- Windows closes the system session (also known as “session 0”).
- Windows flushes any pending data to the system drive to ensure it is saved completely.
- Windows sends a signal via the ACPI interface to the system to power down the PC.
And boot entails:
- After pressing the power button, the PC’s firmware initiates a Power-On Self Test (POST) and loads firmware settings. This pre-boot process ends when a valid system disk is detected.
- irmware reads the master boot record (MBR), and then starts Bootmgr.exe. Bootmgr.exe finds and starts the Windows loader (Winload.exe) on the Windows boot partition.
- Essential drivers required to start the Windows kernel are loaded and the kernel starts to run, loading into memory the system registry hive and additional drivers that are marked as BOOT_START.
- The kernel passes control to the session manager process (Smss.exe) which initializes the system session, and loads and starts the devices and drivers that are not marked BOOT_START.
- Winlogon.exe starts, the user logon screen appears, the service control manager starts services, and any Group Policy scripts are run. When the user logs in, Windows creates a session for that user.
- Explorer.exe starts, the system creates the desktop window manager (DWM) process, which initializes the desktop and displays it.
He points out that in a traditional shutdown, all of the user sessions are closed and in the kernel session services and devices are closed in anticipation of a complete shutdown.
Windows 8 will be different.
Just like Windows 7, the user sessions will be closed BUT instead of closing the kernel session, it’s hibernated.
This effectively saves the system state and memory contents to a file on disk (hiberfil.sys) and then reading that back in on resume and restoring contents back to memory.
Microsoft provided some graphics to show the contrast between the cold start and a Windows 8 fast start.
Click on the images to make them larger
He goes on:
Using this technique with boot gives us a significant advantage for boot times, since reading the hiberfile in and reinitializing drivers is much faster on most systems (30-70% faster on most systems we’ve tested).
It’s faster because resuming the hibernated system session is comparatively less work than doing a full system initialization, but it’s also faster because we added a new multi-phase resume capability, which is able to use all of the cores in a multi-core system in parallel, to split the work of reading from the hiberfile and decompressing the contents. For those of you who prefer hibernating, this also results in faster resumes from hibernate as well.
Drivers are also initialized upon boot-up.
Interesting: he states that systems using Unified Extensible Firmware Interface (UEFI) are more likely to achieve very fast pre-boot times when compared to those with traditional BIOS.
Check out this video provided by Microsoft to highlight the start up speed of Windows 8.