Unreal mode

From Free net encyclopedia

Revision as of 16:04, 31 March 2006; view current revision
←Older revision | Newer revision→

Unreal mode is a mode in which the x86 processors and x86-64 processors can operate, as are real mode, protected mode and long mode.

Unreal mode (sometimes aka. big real mode and flat real mode) is very similar to real mode, except that 32-bit addressing is possible under certain conditions in unreal mode. To enable unreal mode, the program has to enter protected mode, load some of the segment registers with new 32-bit "selectors", then leave protected mode and get back to real mode again. When jumping back to real mode, the processor will not reload the segment registers with new data until they are being written to. The segment registers are simply left in an undefined state. The segment registers will, however, always continue to hold the protected-mode selectors and when used properly, it will allow 32-bit flat addressing (mixed with the default 20-bit segmented addressing) in real mode. Loading the segment register with any new value will disable this odd feature.

This mode was first considered a bug, but it has later on become a standard behaviour for x86 and x86-64 processors.

Some DOS extenders use this feature to address the high memory. It was used by many computer games in the 1990 to 1995 time frame, since it allowed programmers to use more memory than in real mode, which is restricted to 1 MB (640 KB usable), but still access the DOS operating system, which doesn't work in protected mode. After the introduction of Windows 95 unreal mode quickly fell out of favour as programs using it cannot be run in the DOS prompt of MS-Windows; they require a "Restart in MS-DOS mode" in Windows 95 and 98, and cannot be run at all on Windows NT, 2000 and XP systems. For those operating systems, an emulator such as DOSBox is the only way to run programs designed for unreal mode.

See also