Hibernation (computing)

Last updated

Hibernation (also known as suspend to disk, or Safe Sleep on Macintosh computers [1] ) in computing is powering down a computer while retaining its state. When hibernation begins, the computer saves the contents of its random access memory (RAM) to a hard disk or other non-volatile storage. When the computer is turned on the RAM is restored and the computer is exactly as it was before entering hibernation. Hibernation was first implemented in 1992 and patented [2] by Compaq Computer Corporation in Houston, Texas.

Contents

Microsoft's Windows 8, Windows 10 and Windows 11 employs a type of hibernation (Fast Startup) by default when shutting down. [3]

Uses

After hibernating, the hardware is powered down like a regular shutdown. [4] The system can have a total loss of power for an indefinite length of time and then resume to the original state. Hibernation is mostly used in laptops, which have limited battery power available. [4] It can be set to happen automatically on a low battery alarm. Most desktops also support hibernation, mainly as a general energy saving measure and allows for replacement of a removable battery quickly. Google and Apple mobile hardware (Android, Chromebooks, iOS) do not support hibernation. Apple hardware using macOS calls hibernation Safe Sleep. [1]

Comparison to sleep mode

Many systems support a low-power sleep mode in which the processing functions of the machine are lowered, using a trickle of power to preserve the contents of RAM and support waking up. Instantaneous resumption is one of the advantages of sleep mode over hibernation. A hibernated system must start up and read data from permanent storage and then transfer that back to RAM, which takes longer and depends on the speed of the permanent storage device, often much slower than RAM memory. A system in sleep mode only needs to power up the CPU and display, which is almost instantaneous. On the other hand, a system in sleep mode still consumes power to keep the data in the RAM. Detaching power from a system in sleep mode results in data loss, while cutting the power of a system in hibernation has no risk; the hibernated system can resume when and if the power is restored. Both shut down and hibernated systems may consume standby power unless they are unplugged. [5]

Hibernation is a means of avoiding the burden of saving unsaved data before shutting down and restoring all running programs and re-opening documents and browser tabs. Both hibernation and sleep preserve memory fragmentation and atrophy that lead to mobile devices working more poorly the longer you avoid a power off. This is why many experts recommend a frequent shut down or reboot of electronic devices.

First implementation

The first working retail hibernation was in 1992 on the Compaq LTE Lite 386 as noted in its sales material. [6] It is made possible in part due to the sleep and protected mode opcodes in the Intel 386 CPU. It was implemented in ROM and worked independently of the operating system with no drivers needed. The LTE would sense low battery and prevented data loss by making use of a hidden partition. It preserved and restored the system in the midst of disk writes and operations with a math co-processor. It could also be controlled using an optional software GUI or a customized keyboard shortcut. It was tested on DOS, Windows 3.1, Banyan Vines, and Novell Netware. Compaq's hibernation is also noted in an IBM patent [7] from 1993.

Operating system support

Early implementations of hibernation used the BIOS as noted above, but modern operating systems usually handle hibernation themselves. Hibernation is defined as sleeping mode S4 in the ACPI specification. [8]

Microsoft Windows

On Windows computers, hibernation is available only if all hardware and device drivers are ACPI and plug-and-play–compliant. This allows some desktop computers to hibernate quickly to SSD in the event of a power failure and power supplied to even a lightweight or aging UPS. Hibernation can be invoked from the Start menu or the command line. [9]

Windows 95 supports hibernation through hardware manufacturer-supplied drivers and only if compatible hardware and BIOS are present. Since Windows 95 supports only Advanced Power Management (APM), hibernation is called Suspend-to-Disk. Windows 98 and later support ACPI. However, hibernation often caused problems since most hardware was not fully ACPI 1.0 compliant or did not have WDM drivers. There were also issues with the FAT32 file system, [10] making hibernation problematic and unreliable.

Windows 2000 is the first Windows to support hibernation at the operating system level (OS-controlled ACPI S4 sleep state) without special drivers from the hardware manufacturer. A hidden system file named "hiberfil.sys" in the root of the boot partition is used to store the contents of RAM when the computer hibernates. In Windows 2000, this file is as big as the total RAM installed.

Windows Me, the last release in the Windows 9x family, also supports OS-controlled hibernation like Windows 2000 and requires disk space equal to that of the computer's RAM. [11] [12]

Windows XP further improved support for hibernation. [13] Hibernation and resumption are much faster as memory pages are compressed using an improved algorithm; compression is overlapped with disk writes, unused memory pages are freed and DMA transfers are used during I/O. [14] hiberfil.sys contains further information including processor state. This file was documented by security researcher Matthieu Suiche [15] during Black Hat Briefings 2008 who also provided a computer forensics framework to manage and convert this file into a readable memory dump. [16] The compression feature was later documented by Microsoft as well. [17]

Although Windows XP added support for more than 4 gigabytes of memory (through Windows XP 64-bit Edition and Windows XP Professional x64 Edition), this operating system, as well as Windows Server 2003, Windows Vista and Windows Server 2008 do not support hibernation when this amount of memory is installed because of performance issues associated with saving such a large pool of data from RAM to disk. [18] This would later be resolved by Windows 7 and Windows Server 2008 R2.

Windows Vista introduced a hybrid sleep feature, which saves the contents of memory to hard disk but instead of powering down, enters sleep mode. If the power is lost, the computer can resume as if hibernated.

Windows 7 introduced compression to the hibernation file and set the default size to 75% of the total physical memory. [17] Microsoft also recommends that the size be increased using the powercfg.exe tool in some rare workloads where the memory footprint exceeds that amount. It can be set from anywhere between 50% and 100%, although decreasing it is not recommended.

Windows 8 also introduces a Fast startup feature. When users select the Shut Down option, it hibernates the computer, but closes all programs and logs out the user session before hibernating. [19] According to Microsoft, a regular hibernation includes more data in memory pages which takes longer to be written to disk. In comparison, when the user session is closed, the hibernation data is much smaller and therefore takes less time to write to disk and resume. Users have the option of performing a traditional shutdown by holding down the Shift key while clicking Shut Down [20] and could also be shutdown in the same way by disabling Fast Startup in the system settings.

Windows 10 mirrors Windows 8 as noted by Microsoft. [3] Windows 10's hibernation algorithm is solid-state drive optimized. This behavior is carried over to Windows 11.

Hibernation is often underused in business environments as it is difficult to enable it on a large network of computers without resorting to third-party PC power management software. [21] This omission by Microsoft has been criticized as having led to a huge waste in energy. [22]

It is possible to disable hibernation and delete hiberfil.sys. [23]

Third-party PC power management software offers features beyond those present in Windows. [24] [25] [26] Most products offer Active Directory integration and per-user or per-machine settings with more advanced power plans, scheduled power plans, anti-insomnia features and enterprise power usage reporting.

macOS

On Macs, a feature known as Safe Sleep saves the contents of volatile memory to the system hard disk each time the Mac enters Sleep mode. The Mac can instantaneously wake from sleep mode if power to the RAM has not been lost. However, if the power supply was interrupted, such as when removing batteries without an AC power connection, the Mac would wake from Safe Sleep instead, restoring memory contents from the hard drive. [27] Because Safe Sleep's hibernation process occurs during regular Sleep, the Apple menu does not have a "hibernate" option.

Safe Sleep capability was added in Mac models starting with the October 2005 PowerBook G4 (Double-Layer SD). Safe Sleep requires Mac OS X v10.4 or higher.

Shortly after Apple started supporting Safe Sleep, Mac enthusiasts released a hack to enable this feature for much older Mac computers running Mac OS X v10.4. [28] The classic Mac OS once also supported hibernation, but this feature was dropped by Apple. [29]

Linux

In the Linux kernel, hibernation is implemented by swsusp which is built into the 2.6 series. An alternative implementation is TuxOnIce which is available as patches for the kernel version 3.4. TuxOnIce provides advantages such as support for symmetric multiprocessing and preemption. Another alternative implementation is uswsusp. All three refer to it as "suspend-to-disk". systemd, if deployed, manages hibernation itself.

Hybrid sleep

Sleep mode and hibernation can be combined: the contents of RAM are copied to the non-volatile storage and the computer enters sleep mode. This approach combines the benefits of sleep mode and hibernation: The machine can resume instantaneously, and its state, including open and unsaved files, survives a power outage. Hybrid sleep consumes as much power as sleep mode, whereas hibernation powers down the computer. [30] [4]

See also

Related Research Articles

<span class="mw-page-title-main">BIOS</span> Firmware for hardware initialization and OS runtime services

In computing, BIOS is firmware used to provide runtime services for operating systems and programs and to perform hardware initialization during the booting process. The BIOS firmware comes pre-installed on an IBM PC or IBM PC compatible's system board and exists in some UEFI-based systems to maintain compatibility with operating systems that do not support UEFI native operation. The name originates from the Basic Input/Output System used in the CP/M operating system in 1975. The BIOS originally proprietary to the IBM PC has been reverse engineered by some companies looking to create compatible systems. The interface of that original system serves as a de facto standard.

<span class="mw-page-title-main">Windows 2000</span> Fifth major release of Windows NT, released in 2000

Windows 2000 is a major release of the Windows NT operating system developed by Microsoft and designed for businesses as the direct successor to Windows NT 4.0. It was released to manufacturing on December 15, 1999, officially released to retail on February 17, 2000, and released on September 26, 2000, for Windows 2000 Datacenter Server. It was Microsoft's business operating system until the introduction of Windows XP Professional in 2001.

<span class="mw-page-title-main">Wake-on-LAN</span> Mechanism to wake up computers via a network

Wake-on-LAN is an Ethernet or Token Ring computer networking standard that allows a computer to be turned on or awakened from sleep mode by a network message.

<span class="mw-page-title-main">Windows 98</span> Microsoft personal computer operating system released in 1998

Windows 98 is a consumer-oriented operating system developed by Microsoft as part of its Windows 9x family of Microsoft Windows operating systems. It is the second operating system in the 9x line, as the successor to Windows 95. It was released to manufacturing on May 15, 1998, and generally to retail on June 25, 1998. Like its predecessor, it is a hybrid 16-bit and 32-bit monolithic product with the boot stage based on MS-DOS.

<span class="mw-page-title-main">Windows Me</span> Personal computer operating system by Microsoft released in 2000

Windows Millennium Edition, or Windows Me, often capitalized as Windows ME, is an operating system developed by Microsoft as part of its Windows 9x family of Microsoft Windows operating systems. It was officially codenamed as Millennium. It is the successor to Windows 98, and was released to manufacturing on June 19, 2000, and then to retail on September 14, 2000. Windows Me is the last version of Windows 9x. It was Microsoft's main operating system for home users until the introduction of its successor Windows XP on October 25, 2001.

Power management is a feature of some electrical appliances, especially copiers, computers, computer CPUs, computer GPUs and computer peripherals such as monitors and printers, that turns off the power or switches the system to a low-power state when inactive. In computing this is known as PC power management and is built around a standard called ACPI which superseded APM. All recent computers have ACPI support.

NTLDR is the boot loader for all releases of Windows NT operating system from 1993 with the release of Windows NT 3.1 up until Windows XP and Windows Server 2003. From Windows Vista onwards it was replaced by the BOOTMGR bootloader. NTLDR is typically run from the primary storage device, but it can also run from portable storage devices such as a CD-ROM, USB flash drive, or floppy disk. NTLDR can also load a non NT-based operating system given the appropriate boot sector in a file.

Virtual PC is an x86 emulator for PowerPC Mac hosts and a virtualization app for Microsoft Windows hosts. It was created by Connectix in 1997 and acquired by Microsoft in 2003. The Mac version was discontinued in 2006 following the Mac transition to Intel, while the Windows version was discontinued in 2011 in favour of Hyper-V.

<span class="mw-page-title-main">Windows XP Professional x64 Edition</span> Edition of Windows XP for x86-64 computers, released in 2005

Microsoft Windows XP Professional x64 Edition is an edition of Windows XP for x86-64 personal computers. It was released on April 25, 2005, around the same time as with the x86-64 versions of Windows Server 2003. It is designed to use the expanded 64-bit memory address space provided by the x86-64 architecture.

<span class="mw-page-title-main">Connectix</span> Software and hardware company

Connectix Corporation was a software and hardware company, noted for having released innovative products that were either made obsolete as Apple Computer incorporated the ideas into system software, or were sold to other companies once they became popular. It was formed in October 1988 by Jon Garber; dominant board members and co-founders were Garber, Bonnie Fought, and close friend Roy McDonald. McDonald was still Chief Executive Officer and president when Connectix finally closed in August 2003.

<span class="mw-page-title-main">UEFI</span> Operating system and firmware specification

Unified Extensible Firmware Interface is a specification that defines the architecture of the platform firmware used for booting the computer hardware and its interface for interaction with the operating system. Examples of firmware that implement the specification are AMI Aptio, Phoenix SecureCore, TianoCore EDK II, InsydeH2O. UEFI replaces the BIOS which was present in the boot ROM of all personal computers that are IBM PC compatible, although it can provide backwards compatibility with the BIOS using CSM booting. Intel developed the original Extensible Firmware Interface (EFI) specification. Some of the EFI's practices and data formats mirror those of Microsoft Windows. In 2005, UEFI deprecated EFI 1.10.

<span class="mw-page-title-main">Diskless node</span> Computer workstation operated without disk drives

A diskless node is a workstation or personal computer without disk drives, which employs network booting to load its operating system from a server.

<span class="mw-page-title-main">QEMU</span> Free virtualization and emulation software

QEMU is a free and open-source emulator. It emulates a computer's processor through dynamic binary translation and provides a set of different hardware and device models for the machine, enabling it to run a variety of guest operating systems. It can interoperate with Kernel-based Virtual Machine (KVM) to run virtual machines at near-native speed. QEMU can also do emulation for user-level processes, allowing applications compiled for one architecture to run on another.

<span class="mw-page-title-main">Sleep mode</span> Low power mode for electronic devices

Sleep mode is a low power mode for electronic devices such as computers, televisions, and remote controlled devices. These modes save significantly on electrical consumption compared to leaving a device fully on and, upon resume, allow the user to avoid having to reissue instructions or to wait for a machine to boot. Many devices signify this power mode with a pulsed or red colored LED power light.

Advanced Configuration and Power Interface (ACPI) is an open standard that operating systems can use to discover and configure computer hardware components, to perform power management, auto configuration, and status monitoring. It was first released in December 1996. ACPI aims to replace Advanced Power Management (APM), the MultiProcessor Specification, and the Plug and Play BIOS (PnP) Specification. ACPI brings power management under the control of the operating system, as opposed to the previous BIOS-centric system that relied on platform-specific firmware to determine power management and configuration policies. The specification is central to the Operating System-directed configuration and Power Management (OSPM) system. ACPI defines hardware abstraction interfaces between the device's firmware, the computer hardware components, and the operating systems.

The booting process of Windows NT is the process run to start Windows NT. The process has been changed between releases, with the biggest changes being made with Windows Vista. In versions before Vista, the booting process begins when the BIOS loads the Windows NT bootloader, NTLDR. Starting with Vista, the booting process begins with either the BIOS or UEFI loading the Windows Boot Manager, which replaces NTLDR as the bootloader. Next, the bootloader starts the kernel, which starts the session manager, which begins the login process. Once the user is logged in, File Explorer, the graphical user interface used by Windows NT, is started.

The Prefetcher is a component of Microsoft Windows which was introduced in Windows XP. It is a component of the Memory Manager that can speed up the Windows boot process and shorten the amount of time it takes to start up programs. It accomplishes this by caching files that are needed by an application to RAM as the application is launched, thus consolidating disk reads and reducing disk seeks. This feature was covered by US patent 6,633,968.

<span class="mw-page-title-main">Shutdown (computing)</span> Remove power from a computers main components in a controlled way

To shut down or power off a computer is to remove power from a computer's main components in a controlled way. After a computer is shut down, main components such as CPUs, RAM modules and hard disk drives are powered down, although some internal components, such as an internal clock, may retain power.

In computing, rebooting is the process by which a running computer system is restarted, either intentionally or unintentionally. Reboots can be either a cold reboot in which the power to the system is physically turned off and back on again ; or a warm reboot in which the system restarts while still powered up. The term restart is used to refer to a reboot when the operating system closes all programs and finalizes all pending input and output operations before initiating a soft reboot.

References

  1. 1 2 "What is safe sleep on Mac?". Apple Support. Retrieved 2021-01-24.
  2. "Hibernation Patent" (PDF). Patents.google.com. 1998. Archived (PDF) from the original on 25 January 2021. Retrieved 24 January 2021.
  3. 1 2 windows-driver-content. "Delivering a great startup and shutdown experience". docs.microsoft.com. Retrieved 2021-01-24.
  4. 1 2 3 "Sleep and hibernation: frequently asked questions". Windows 7 Online Help. Microsoft Corporation. Retrieved 15 October 2011.
  5. "Shut down, sleep, or hibernate your PC". support.microsoft.com. Retrieved 2021-01-15.
  6. "Sales Material from Compaq Computer Corp" (PDF). 10000 Bit. 1992. Archived from the original on 2017-01-02. Retrieved 2021-01-24.
  7. ,"Hibernation file creation device and method",issued 1993-07-26
  8. "ACPI Specification Rev 3.0b" (PDF). Archived from the original (PDF) on 2008-12-30. Retrieved 2008-11-09.
  9. "Microsoft Help and Support – How To Put the System into hibernation or Standby from Run menu". Archived from the original on 2009-02-11. Retrieved 2009-02-11.
  10. BIOS and Hibernate Issues for FAT32 File System
  11. "Interview with Nicolas Coudière, Chief Product Manager: Microsoft Windows Millennium Edition (Me)". Activewin.com. Retrieved 2010-08-26.
  12. "Windows Power Management". Microsoft.com. 2001-12-04. Archived from the original on 2004-07-13. Retrieved 2010-08-26.
  13. Windows Power Management: Instant PC availability and energy savings
  14. Kernel Enhancements for Windows XP
  15. "BlackHat USA 2008 – Windows hibernation file for fun and profit" (PDF). Archived from the original (PDF) on 2008-11-19. Retrieved 2008-08-18.
  16. "SandMan Computer Forensics Framework". Archived from the original on 2018-12-29. Retrieved 2022-03-08.
  17. 1 2 "Reducing the Disk Footprint for Windows 7 Hibernation" . Retrieved 2012-10-25.
  18. "You cannot put a computer that has more than 4 GB of memory into hibernation in Windows XP, in Windows Server 2003, in Windows Vista, or in Windows Server 2008". Support (9.0 ed.). Microsoft. 23 September 2011. Archived from the original on 23 March 2014. Retrieved 23 March 2014.
  19. "Delivering fast boot times in Windows 8". Archived from the original on 2011-11-08. Retrieved 2011-11-09.
  20. "Windows 8 / Windows Server 2012: Faster Boot Process | Ask the Performance Team Blog". Archived from the original on 2018-05-24. Retrieved 2018-05-24.
  21. Enable hibernate using group policy
  22. "EcoGeek – How Windows XP Wasted $25 Billion of Energy". Archived from the original on 2006-11-27. Retrieved 2009-01-14.
  23. How to disable and re-enable hibernation on a computer that is running Windows; Microsoft; August 12, 2010.
  24. "Power Management Software for Windows Workstations". Archived from the original on 2012-04-26. Retrieved 2011-04-19.
  25. "Energy Star Commercial Packages List".
  26. The Headmasters' and Headmistresses' Conference. "HMC: A Practical Guide to Sustainable Building for Schools". Archived from the original on 2012-03-15. Retrieved 2011-04-19.
  27. "Apple Support: Progress bar appears after waking from sleep". February 20, 2006. Archived from the original on March 12, 2008.
  28. "How to Safe Sleep (Hibernate) Your Mac". AndrewEscobar.com. Archived from the original on 2008-01-05.
  29. "Sleep Memory Extension 1.0 Document and Software". Archived from the original on August 19, 2007.
  30. "Turn off a computer: frequently asked questions". Windows Vista Online Help. Microsoft Corporation. Archived from the original on 10 October 2011. Retrieved 15 October 2011.