In a recent discussion, Microsoft’s Raymond Chen shed light on a fascinating aspect of Windows 95 that many users may have overlooked: the “Shift during Restart” trick. This simple maneuver allowed users to bypass a lengthy reboot process, a feature that could have saved countless hours for those familiar with the quirks of the operating system.
Understanding the Mechanics
Chen elaborated on the technical details behind this clever shortcut. When the EW_RESTARTÂWINDOWS flag was sent to the 16-bit ExitWindows function, the system underwent a series of shutdowns. First, the 16-bit Windows kernel would close down, followed by the 32-bit virtual memory manager. Finally, the CPU would revert to real mode, relinquishing control to win.com.
For those unfamiliar with the term, real mode is the initial state in which x86-compatible CPUs operate. It provides direct access to hardware and serves as a transitional phase before entering protected mode, the environment utilized by contemporary operating systems. Upon receiving control, win.com would signal the CPU to initiate protected-mode Windows.
Memory Management Insights
Chen pointed out an interesting aspect of how .com files operate. These files are automatically allocated all available conventional memory upon launch, which can then be returned to the system for use by other applications. In the case of win.com, it efficiently releases any memory beyond its own image back to the system, creating a large contiguous block of memory essential for loading protected-mode Windows.
However, if another program had claimed memory in the space that win.com relinquished, the conventional memory could become fragmented. This fragmentation would hinder win.com‘s ability to restore the system to its previous state, as it expected a singular, uninterrupted block of memory. In such scenarios, win.com would respond with a simple message: “Sorry, I can’t do what you asked,” resulting in the need for a full reboot.
The User Experience
This clever engineering solution allowed for quick restarts, offering a smoother user experience—provided that no rogue code, such as a misbehaving device driver, interfered with memory allocation. Unlike today’s Windows users, who often face the dreaded notification of impending updates that could disrupt their workflow, those using Windows 95 enjoyed a more straightforward and efficient restart process.