- Unreal mode
Unreal mode, also big real mode, huge real mode, or flat real mode, is a variant of
real mode (PE=0), in which one or more data segment registers have been loaded with 32-bit addresses and limits. Contrary to its name, it is not a separate addressing mode that thex86 andx86-64 processors can operate in. It is used in the80386 and later x86 processors.Overview
For efficiency reasons, the
80386 and later x86 processors use the base address stored in their internal "descriptor" cache whenever accessing memory, regardless if they are operating in real or protected mode. The "selector", i.e. the 16-bit "segment number" visible to the programmer is used once, while reloading a segment register, to update the various fields of the respective "descriptor", and then is simply disregarded.Some
DOS extender s use this feature to address thehigh memory . It was used by manycomputer game s 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 theDOS operating system, which doesn't work in protected mode. After the introduction ofWindows 95 unreal mode quickly fell out of favour as programs using it cannot be run in the DOS prompt ofMicrosoft Windows ; they require a "Restart in MS-DOS mode" in Windows 95 and 98, and cannot be run at all on NT and later Windows systems. For those operating systems, anemulator such asDOSBox is the only way to run programs designed for unreal mode. Unreal mode is still extensively used byBIOS code.Enabling Unreal Mode
To enable unreal mode without using any undocumented features of the CPU, the program has to enter protected mode, locate a flat descriptor in the GDT or LDT or create such, load some of the segment registers with the respective protected mode "selector", then cancel back to real mode. When jumping back to RM, the processor will continue using the cached descriptors as established in PM - thus allowing access to 4 GB of "extended" memory from inside real mode.
A much simpler way to load such information into a selector is with the undocumented
LOADALL instruction, which can be used to load arbitrary data into the descriptor cache for each selector.ee also
*
x86 assembly language
Wikimedia Foundation. 2010.