Computers have several operating modes, ranging from full operation to full shutdown. In full operation, software defining the executing portions of the operating system has been loaded from non-volatile memory into operational memory, which is conventionally volatile memory, from which it can more quickly be executed. The computer enters this full operation mode though a “startup” process. The startup process configures the hardware and loads the operating system of the computer. As part of the startup process, drivers are installed and operating system services are started.
Once the computer is ready for operation by any user, a user may log on to the computer. This log on may involve further configuration of the computer based on a profile specific to the user who is logged on. Either automatically or in response to user input, applications may then be loaded, such that the applications can execute, taking advantage of the capabilities of the hardware and operating system services of the computing device.
In the process of loading software, whether for the operating system or applications, memory may be allocated, parameters of the software may be assigned values based on the hardware configuration of the computer or a user profile, and other configuration actions may be performed. These actions establish a “state” of the computing device. Further changes to the memory and other parameters of the system that define its operating state may also be made as the user provides commands to interact with executing applications or operating system services.
In full shutdown mode, power is not supplied to the hardware components of the computer. No software or state information is stored in volatile memory, as this memory does not retain information when it is powered off. Rather, any information that will be used later to re-configure the computer for a full operation mode is stored in non-volatile memory.
The computer enters shutdown mode through a process called shutdown. During shutdown, any information that may be needed to re-configure the computer, if it is not already stored in non-volatile memory, may be stored in non-volatile memory. Software and other configuration information that was copied into volatile memory from non-volatile memory is not copied back to non-volatile memory, because it can be re-created upon a subsequent startup process.
In addition to a full shutdown, there may be power saving modes in which power to some or all of the hardware components of the computer is turned off. In a power saving mode, sometime called sleep mode, power is turned off for the computer processor, network interfaces and possibly other components. However, power is retained for volatile memory. In this way, any state information created during boot or subsequent operation of the computer is retained in volatile memory. When power is supplied to the processor again, it may resume operation in the state where it left off upon entering sleep mode.
A further mode is sometimes called hibernate mode. The computer enters this mode through a process called hibernation. During hibernation, a file capturing the operating state of the computer is created and stored in non-volatile memory, typically a hard disk. Data representing the state of the system may be compressed as it is stored in the hibernation file. During a process of resuming from hibernate, this file may be read from the disk, decompressed and used to re-establish the state of the computer as it existed at the time of hibernation. Resuming from hibernate restores in volatile memory copies of software or parameters set during operation that existed at the time of hibernating, such that any user state is also restored.
Resuming from hibernation can be faster than performing a full startup for several reasons. One reason is that copying the state information in the hibernation file into volatile memory re-creates the results of the full startup process, while avoiding the time spent executing the steps of the startup process, such as CPU consumption, device initialization and many other types of work that has to be done during boot. Additionally, the information accessed during startup is stored in many different files, representing different components that are accessed to load and configure what may be potentially tens of thousands of components in the operating system. These components, and the information accessed to configure them, may be randomly distributed across the hard disk. Because hard disk drives, and some other forms of high capacity storage, are most efficient at accessing sequential data, accessing randomly distributed data may include substantial disk access time, leading to a long startup process. In contrast, the access time is less in reading the hibernation file because information in that file may be stored sequentially on the disk.