HOME

TheInfoList



OR:

In
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel, based on the 8086 microprocessor and its 8-bit-external-bus variant, the 8088. Th ...
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
, unreal mode, also big real mode, flat real mode, or voodoo mode is a variant of
real mode Real mode, also called real address mode, is an operating mode of all x86-compatible CPUs. The mode gets its name from the fact that addresses in real mode always correspond to real locations in memory. Real mode is characterized by a 20- bit s ...
, in which one or more segment descriptors has been loaded with non-standard values, like 32-bit limits allowing access to the entire memory. Contrary to its name, it is not a separate addressing mode that the x86 processors can operate in. It is used in the 80286 and later x86 processors.


Mechanism

For efficiency reasons, the 80286 and all later x86 processors use the base address, size and other attributes stored in their internal segment descriptor cache whenever computing effective memory addresses, even in real mode. Therefore, a modification of the internal segment descriptor allows altering some properties of segments in real mode, like the size of addressable memory. This technique became widely used and is supported by all Intel processors. A program in unreal mode can call 16-bit code programmed for real mode (BIOS, DOS kernel and drivers) without any thunking. This makes an unreal mode driver simpler than a DPMI driver. However unreal mode is incompatible with protected mode operating systems such as Windows 3.x/9x/NT and OS/2. Big real mode has a 1 MiB code segment and a 4 GiB data segment.


Uses

HIMEM.SYS uses this feature (both 286 and 386 variants) to address extended memory, unless DOS is switched to run in a
virtual 8086 mode In the 80386 microprocessor and later, virtual 8086 mode (also called virtual real mode, V86-mode, or VM86) allows the execution of real mode applications that are incapable of running directly in protected mode while the processor is running ...
that is incompatible with unreal mode. One of the very few games—if not the only one—that used unreal mode was '' Ultima VII''. Unreal mode is used by
BIOS In computing, BIOS (, ; Basic Input/Output System, also known as the System BIOS, ROM BIOS, BIOS ROM or PC BIOS) is a type of firmware used to provide runtime services for operating systems and programs and to perform hardware initialization d ...
code as this is the initial mode of modern Intel processors. Furthermore, the System Management Mode (SMM) in
Intel 386SL The Intel 386, originally released as the 80386 and later renamed i386, is the third-generation x86 architecture microprocessor from Intel. It was the first 32-bit computing, 32-bit processor in the line, making it a significant evolution in ...
and later processors places the processor in huge real mode. Some
boot loader A bootloader, also spelled as boot loader or called bootstrap loader, is a computer program that is responsible for booting a computer and booting an operating system. If it also provides an interactive menu with multiple boot choices then it's o ...
s (such as LILO) use the unreal mode to access up to 4 GiB of memory.


Enabling unreal mode

The 80286 microprocessor can be put into unreal mode only with help of the undocumented instruction LOADALL to modify the hidden segment base registers to point to the source or target memory location above 1 MiB. To put an 80386 or higher microprocessor into unreal mode, a program must first enter
protected mode In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units (CPUs). It allows system software to use features such as Memory_segmentation, segmentation, virtual mem ...
, find or create a flat descriptor in the GDT or LDT, load some of the data segment registers with the respective protected mode "selector", and then switch back to real mode. After returning to real mode, the processor will continue using the cached descriptors as established in protected mode, thus allowing access to 4 GiB of extended memory from real mode. Starting with the 80386, real mode programs can use the 32 bit registers with the Address Size Override Prefix. This allows programs to use an address like DS: BX In normal real mode, a fault occurs if EBX exceeds 0xFFFF. In unreal mode, the access is allowed.


Variants of unreal mode

As described above, unreal mode usually involves using one or more data selectors to address data in memory more efficiently. This has been common practice and often referred to as "flat real mode" or "big real mode". The term "unreal mode" was introduced in 1991 by Rakesh K. Agarwal.


32-bit code

The "huge real mode" (named in Ralf Brown's interrupt list) or "unREAL" mode (named by Tomasz Grysztar) adds the ability to run 32-bit code with a 4 GiB code segment. This is achieved by loading the code selector (CS) from a descriptor having the 32-bit attribute ("D" bit) set to 1. This mode allows for avoiding Operand Size Override prefixes normally required when using 32-bit addressing in 16-bit code segment, but is more difficult to set up due to interaction with interrupts. The use of a 32-bit CS was described in Agarwal's 1991 article introducing the term "unreal mode". This mode is used in Grysztar's open-source
FASM FASM (''flat assembler'') is an assembler for x86 processors. It supports Intel-style assembly language on the IA-32 and x86-64 computer architectures. It claims high speed, size optimizations, operating system (OS) portability, and macro abi ...
and Helix RM386, a commercial DOS Extender bundled by Logitech mouse drivers. Grysztar wrote a description of techniques used for entering this mode and handling interrupts in 2010. He also reports that most of the CPUs he tested supports this previously-unknown mode, with the exception of a CPU of unknown model ("I think it was manufactured by
Cyrix Cyrix Corporation was a microprocessor developer that was founded in 1988 in Richardson, Texas, as a specialist supplier of floating point units for 286 and 386 microprocessors. The company was founded by Tom Brightman and Jerry Rogers. Ter ...
") and in a later user report, the
Bochs Bochs (pronounced "box") is a portable IA-32 and x86-64 IBM PC compatible emulator and debugger mostly written in C++ and distributed as free software under the GNU Lesser General Public License. It supports emulation of the processor(s) (includ ...
and
DOSBox DOSBox is a free and open-source MS-DOS emulator. It supports running programs primarily video games that are otherwise inaccessible since hardware for running a compatible disk operating system (DOS) is obsolete and generally unavailab ...
emulators.


See also

* LOADALL * Global EMM Import Specification (GEMMIS) *
x86 assembly language x86 assembly language is a family of Low-level programming language, low-level programming languages that are used to produce object code for the x86 class of processors. These languages provide backward compatibility with CPUs dating back to th ...
* A20 line


References


Further reading

* * *

https://archive.org/download/dr_dobbs_journal_vol_15/dr_dobbs_journal_vol_15.pdf] Errata

* (NB. Implements "Big real mode" SEG4G.) *
Intel IA-32 Software Developer's Manual - Volume 3A
* The Unabridged Pentium 4: IA32 Processor Genealogy, Addison Wesley . "Big real mode" * * * * {{cite book , title=DOS Internals , author-first=Geoff , author-last=Chappell , editor-first1=Andrew , editor-last1=Schulman , editor-first2=Amorette , editor-last2=Pedersen , date=January 1994 , edition=1st printing, 1st , series=The Andrew Schulman Programming Series , publisher= Addison Wesley Publishing Company , isbn=978-0-201-60835-9 (xxvi+738+iv pages, 3.5"-flopp

https://web.archive.org/web/20200222111608/https://www.pcjs.org/pubs/pc/programming/DOS_Internals/]) Errata

https://web.archive.org/web/20200222111853/https://gopher.tildeverse.org/gopher.viste.fr/1/programming/PC/DOS/DOS%2520Internals/crtdrv


Method for expanding addressable memory range in real-mode processing to facilitate loading of large programs into high memory
X86 operating modes DOS memory management