18

According to the relevant Wikipedia article, [h]ibernation was first implemented in 1992 and patented by Compaq Computer Corporation in Houston, Texas. This appears to refer specifically to hardware- and/or firmware-assisted hibernation — indeed, worthy of a patent; however, the idea of hibernation as a function of an OS or a monitor must be substantially older.

During the mainframe era, the need to save the state of the system currently doing a multi-hour computation in order to perform some urgent maintenance, must have arisen enough times to bear out implementations of hibernation as a feature of the OS — either of the full system state, or of the important process (that's a separate story) — by operator's request.

For the purpose of the question, hibernation means the ability to save the full state of the system, and to restore that state without relying on core (non-volatile) memory. Please note that even today, after hibernating the "main" OS on a computer, you can boot a different OS from a removable media, then come back to the saved state of the main system.

Was the feature present in OSes by the main players in the mainframe market in the 1960s (IBM, CDC, etc.)?


Incidentally, in OS DISPAK for the BESM-6 the feature to save the state of a running process to a temporary file and to restart it at a later time, either with or without an intervening reboot, was announced on Feb 10, 1984. The feature was called упрятывание ("hiding"). Translating literally,

*                   10.02.84
*                  ----------
...
* 2. HIDING TASKS IN THE ARCHIVE AREA IS INTRODUCED.
* THE AREA IS FORMED BY OS ON ARCH. DISK OF 0TH GROUP AT
* AVAILABILITY OF SPACE. AREA NAME CONTAINS A COMPUTER
* NUMBER AND TASK NUMBER IN INPUT QUEUE.

Where "archive area" means "a file in the file system".

There is also a remnant of the pre-existing feature of full system hibernation in the boot loader: an unused error message "НЕТ МД УПР." which can be translated as "NO HIDING MD".

According to personal communication with one of the users of the system, the feature was indeed used in the 1970s, but it was not popular because it required a dedicated disk pack, a scarce resource. Therefore, it has not survived in the OS code after introduction of the per-process hibernation, however, cleaning up the code of the boot loader was not a priority.

15
  • 5
    It's actually unclear what you are asking: Hibernation is, in my view, the complete freezing of the system state to disk - That means everything, every process, and the complete OS (Which might have been a bit of a challenge for early computers, as the dump media would most likely have been tape, due to other storage restrictions). Later on in your question you talk about per-process dump to disk, which is an entirely different thing closer to a restorable Unix core dump. What is it you're asking for?
    – tofro
    Commented Feb 12 at 9:10
  • 1
    @tofro I'm asking about either one, whichever came first. The phrase "in any form" (in bold) should have been enough of a clue.
    – Leo B.
    Commented Feb 12 at 9:40
  • 5
    I'm asking because a single process freeze to disk doesn't really fit the "hibernation" term, at least not in common terminology.
    – tofro
    Commented Feb 12 at 12:47
  • 5
    Note that core and drum memory-based systems did support that from day 1 (at least in principle). They suspended to RAM. Always. So that's more a feature that was lost over time, not one that was introduced at some point.
    – tofro
    Commented Feb 12 at 12:51
  • This question seems to be suffering something I've seen on a lot of questions here: innovations rarely come out of the blue, so "the precise moment when <thing> first happened" is subject to endless debate, and talking about "the history and origin of <thing>" is more enlightening. It's like asking an anthoropologist about "the first human" - they will be able to give you a number of key moments in evolution, but which of them is given the label "first human" is pretty arbitrary.
    – IMSoP
    Commented Feb 14 at 14:49

3 Answers 3

21

The idea of saving a complete running system to disk was present in the 1970s RSX-11 family of operating systems for the PDP-11 (RSX-11D, RSX-11M). In fact, it was originally the only way to create the system in the first place.

In RSX-11M, which is the system I am most familiar with, you first generated the system kernel. This was then booted, and then you could install programs, create memory partitions, etc., and do any other configuration you needed. Finally, the entire memory image was saved to disk as a contiguous file, overwriting the original file from which you booted. Subsequently boots read the fully-configured system into memory.

Subsequent configuration changes could be saved by the same method.

For this to work, the SAVe program arranged to quiesce the system, ensuring that there was no I/O in progress. Files remained open, which required that in-memory pointers to on-disk structures remained valid. Task execution was blocked.

Of course, SAVe was running in the image that it saved. This allowed it to unblock task execution and reverse any other changes made to in-memory structures during the save. It also gave a route to run any startup commands that were not appropriate to freeze in the system image.

In later versions of the system, this approach of setting everything up 'live' gave way to doing it on a disk image. A program called VMR (virtual monitor console routine) implemented as set of commands to operate on addresses in the disk image similarly to commands in MCR (monitor console routine, the command interface) operating on addresses in memory. But the resulting disk image was the same - a 'frozen' execution of the OS.

For all I know, DEC systems before the RSX-11 family did similar things.

10
  • 1
    It is unclear if the feature could be used to save the state of the system including user processes.
    – Leo B.
    Commented Feb 12 at 15:31
  • 1
    It could. ('Tasks' is the RSX terminology). Task state is pretty limited - an address space and some I/O channels, both of which have in-memory representation. All of physical memory was saved.
    – dave
    Commented Feb 12 at 16:04
  • I'd like to see how the feature was described in the documentation.
    – Leo B.
    Commented Feb 12 at 17:06
  • See page 4-75 in the operator's manual for RSX-11M V2. The documentation is not very detailed. I could have been wrong about SAV waiting for I/O completion; it looks like it merely checked.
    – dave
    Commented Feb 12 at 17:41
  • It is surprising that the possibility to use the command to hibernate the system with running CPU-intensive tasks (which is not particularly obvious from the description, nor whether it was indeed suited for the purpose) was not mentioned. Has the command actually been used for hibernation successfully?
    – Leo B.
    Commented Feb 12 at 23:54
19

It Was Always There

Like with many of today's complex features, it was a non-issue with early mainframes - especially not any kind of software issue, as the hardware was taking care of it. In case of "hibernation", it was built in - as core memory. Core was standard in the 1960s you're asking for.

By pressing STOP on a /360 console the machine stopped and could be powered down, and restarted where it was after powering on again. All states (registers) were part of the scratch memory, which itself was core, either part of main core, or in a dedicated one (for speed).

Having that out of the way:

In the beginning there was no OS

OSes we know them today only arose during the late 1960s and 1970s. Before that they were monitor programs, more like CP/M than Windows or Linux. And without an OS, there could be no OS function doing such very complex stuff.

Those monitors were only a tiny step up from bare metal, providing services more like a function library. After all, even applications did their own hardware access (*1). Some of those services were intended to standardize support for applications.

Why Create them in the First Place?

The ability to restart an application was needed more than just for planned maintenance and super long running scientific jobs. Those machines were unreliable in a way today's PC customers wouldn't accept for a minute (*2).

1970s base line was one non-recoverable memory error per 32 KiB per month. That means even the smallest (full) /360, the model 30, could have every other week an error the machine detects but can not correct, thus stopping execution. If running with multiple applications this meant that the application whose memory contained the error had to be thrown out. If it was inside the monitor, than the whole machine was done for (*3).

Restart Was an Application Feature ...

As a result of those low reliability issues (*4), programs used Checkpoints from very early on. Every now and then, and whenever there was a stable state, they wrote a tape with information allowing to restart itself. Usually dumping some working memory with pointers to the last records processed and soon.

When restarted it would look for a checkpoint tape, read the content and continue from there. It's exactly like today: Libre-Office reopens all files and restores recent changes from a crashed session.

Even More So For Scientific Use

Considering that scientific machines during IBM 70x(x) times sacrificed ECC for more precision, writing such checkpoints was even more important for them.

... Supported By OS

Solely for size reasons it was out of question that an OS would dump a whole application onto some media. Too much, too slow. Having the application decide what's needed was the better option. What the OS could do is improving handling of those checkpoints to enable standardized management for job control. For example, IBM OS/360 introduced the CHKPT macro to write a short record (8..16 Bytes *5) to a specified device (*6).

Not Much But All It Needs

Sounds not much, as the application had still to maintain any additional data on its own media, but a huge step for integration. Now the controlling job could look for a checkpoint on a defined device (*7) and handle restart as needed for that specific application. Support was very much intrinsic (*8).

The huge benefit was that each application could be tailored to its specific needs, while management could be standardized within the OS's script language.

Best of both worlds and able to run on machines as small as 32 KiB :))

Once Popped - Can't Stop

While protecting against hardware failure was a good reason for development, an even better was system management. With those facilities standardized, an operator could stop any job at the next checkpoint and unload it. A situation common in computing centers no matter whether management had a higher priority job for a single-tasking machine, or memory got too low on one running multiple jobs.

Until Virtual Memory systems took over, manually swapping jobs was a standard task. After all, swapping jobs back then usually also meant (un)mounting tapes and disks, so interaction was needed anyway.


Further Remarks

On the PC side it might be notable that DESQview could, even with its first 1984 version, not only run multiple DOS programs in memory, but also swap them out to EMS or disk. This worked on all PCs, including 8088-based machines with as little as 256 KiB of RAM. Although, I'm not sure whether those applications could be restarted after rebooting the system.

Please note that even today, after hibernating the "main" OS on a computer, you can boot a different OS from a removable media, then come back to the saved state of the main system.

That can hardly be called part of the OS nor a function thereof, as booting another system in between is neither done by that OS, nor in any way supported. It's done by external means of the underlying system, such as a hypervisor, BIOS or other boot mechanism.


*1 - Creating the very same issues PC/MS-DOS users had to live with 20 years later.

*2 - Considering the speed of today's CPUs, they might not have to endure it a full minute before crashing:))

*3 - Well, depending on context, user and knowledge, one could try to patch it back to normal and let the machine continue. That was usually with errors in code, where one could simply look up the right code section from a listing - that includes OS code :))

*4 - Don't get that wrong: back then it wasn't seen as something out of the ordinary and painful, but absolute normal. Much like early motorists packed a dozen tires, as a flat was something that simply happens every so often. :)

*5 - For example, a label or a file and some record number. The whole record written was some 600 bytes, as the OS additionally stored information about the program, environment, devices and some other states.

*6 - Jup, device, not file, although that changed in later versions :))

*7 - Imagine them being handled line script/environment variables, so a program could have its default handled by operator assignment.

*8 - In simplified terms one could think of that the job being started at a label whose name was stored with the checkpoint, acting as alternate entry point.

1
5

Did anyone bother to actually look up the Compaq patent in question? Its title, specifically, is "Computer System with Power Loss Protection Mechanism", and it's entirely about hardware-driven, automatic hibernation controlled by the system's power-management interfaces.

A computer system protects against loss of a computer's volatile data using system ROM and operating system resources. Upon entry into a reduced power state, or sleep mode, the operating system directs device drivers to save the state of hardware registers to RAM. Then, the system ROM saves the contents of RAM to a file in a non-volatile storage medium, such as a hard disk drive. A bit is set in CMOS to indicate completion of this transfer.

Upon return from sleep mode, the system ROM clears the CMOS bit and returns to normal operation. However, if a system reboot occurs and the CMOS bit is set, the non-volatile storage file is retrieved, and its contents are restored to RAM. [...]

Yes, all sorts of prior systems had mechanisms for saving volatile state to non-volatile storage, but for the most part all of the ones described in other answers were operating-system features implemented entirely in software. The hardware/firmware-driven nature of the hibernation feature, and its novel support for saving and restoring the state of the system's hardware devices (via supporting device drivers), in addition to the running software, was the innovation.

6
  • 2
    Nope. I took the question about generalized 'hibernation' at face value. Though having written powerfail code for device handlers on PDP-11 (save volatile registers to core when the power supply tells you the power is failing, restore on power recovery), the patent does not seem all that novel in its principles, just in its implementation.
    – dave
    Commented Feb 12 at 20:21
  • 2
    Your point in the last paragraph is correct; my question alludes to the fact that Wikipedia is too narrow in its interpretation of hibernation in general, claiming that the concept was invented and implemented no earlier than 1992, which is, of course, utterly counterfactual. The rationale for the question is to establish a proper timeline.
    – Leo B.
    Commented Feb 12 at 23:34
  • 4
    @LeoB. Wp is hardly a good resource for computer history: far too many of the contributors have a very blinkered approach. The majority of them don't realise that there was anything pre-PC, there's a substantial IBM mainframe contingent who "do their own thing" with no attempt to explain what some of their terminology means, and there's a small number of others interested in DEC or ICL systems. Commented Feb 13 at 8:06
  • @MarkMorganLloyd I wholeheartedly agree.
    – Leo B.
    Commented Feb 13 at 8:36
  • Your answer really opens up an interesting point, as the OP specifically asks for "hibernation for maintenance". Maintenance typically changes something on the system (otherwise, you wouldn't have to shut it down). If the system comes up with an (even only slightly) different system or hardware configuration, I'd think I'm pretty sure the hibernated image would no longer be applicable for the (now) new system configuration without (very) extensive recalculation of state. That renders the whole process a bit useless for other than safely vacuuming the inside of your mainframe ;)
    – tofro
    Commented Feb 13 at 22:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .