Real Mode

The term real mode, actually real address mode or Germanized real-mode refers to a mode of x86 - compatible processors that exists from the Intel 80286 under that name.

Characteristics

In real mode, the processor uses the same method as the Intel 8086 processor, to access the main memory. That is, from a programming perspective, it's like a (faster ) to address 8086.

Each x86 -compatible processor starts after the reset in real mode. A special variant of the MOV instruction can move the processor into protected mode.

Importance

Real mode is the default mode for MS- DOS and compatible operating systems, such as PC-DOS, DR -DOS, PTS -DOS, FreeDOS, etc., as well as for CP/M-86. He is still supported even in the earliest versions of MS Windows until Windows 3.0. Newer operating systems can only use it during the startup phase, with virtually all modern operating systems already switch to a very early stage in the protected mode.

To run real-mode operating systems and the associated historical software today offer emulators such as DOSBox, QEMU, Bochs, etc..

Access Protection

In real mode, no access protection exists. That is, each current program may access the entire main memory and the hardware. This is for modern multitasking operating systems, however, not acceptable.

Segment register

In real mode, the processor uses a so-called segment: offset addressing. There are four segment registers: CS ( code segment ), DS ( data segment ), ES (extra segment) and SS (stack segment); 80386 from the two other segment registers (FS and GS) are added. All segment registers contain in real mode, only 16 -bit segment addresses. To calculate the real, linear addresses, the contents are multiplied by 16 and added to the offset. Since the offset address is also limited to 16 bits, resulting in a 20 - bittige linear address, which causes the usable directly and without tricks address space is limited to a MiB ( 220 bytes ) in " About Addressing" and open A20 address line will still once 64 KiB ( minus 16 bytes) in the range of FFFF: 0010 to FFFF: FFFF accessible in real mode. This memory area is referred to as the high memory area.

Fake Real mode (" Unreal fashion ", " Big Real Mode" )

The restriction to a mebibyte main memory was too MS- DOS times totally inadequate for many applications. But there are two tricks that you can also increase in real mode segment register on four GiB; working in real mode beyond a MiB called the " Unreal Mode". This special mode is considered undocumented and is not a separate mode

The simple " Unreal Mode" has been used primarily in the first half of the 1990s, for PC games, as these mostly expired at that time still directly under the real-mode MS- DOS. Windows was indeed at that time already a protected-mode system, but offered no support for game programs, which could fully utilize the computing power.

Both tricks based on the fact that the processor is in real mode uses the shadow registers of the segment registers for address calculation, even if they are not directly accessible in real mode. In a roundabout way you can, however, put the shadow registers to values ​​that allow access to memory areas beyond the 1- MiB limit: Either you set the segment start to a memory address beyond the 1 MiB boundary, or ( if at least a 80386 processor available ) increasing the segment size of 64 KiB 4 GiB.

The LOADALL trick

On the 80286 and 80386 (and some 486 models) exists an undocumented command LOADALL (286 ) or LOADALLD ( 386), with which you can fill in all the registers of the CPU with its own values ​​. This applies particularly to the registers that are not available in real mode, whereby the desired values ​​can be loaded into the segment descriptor cache. On newer CPUs these commands trigger an "Unknown opcode " exception, which can be used to emulate the instruction.

The PM Animation

The PM trick is to switch into protected mode to load the segment registers including shadow register with the desired values ​​, and then switch back to real mode, the values ​​are retained in the registers.

In the 80286, this method works not because this CPU can be turned over only a CPU reset to real mode; but here are the contents of the Segmentdeskriptorcaches reset to their default values. Accordingly, there remains only the above-mentioned LOADALL method for these types of processors.

DOS Extender

Another way to address the whole address space in real mode, the DOS extender. These special programs allow the use of the real -mode operating system MS- DOS by protected-mode programs by just switch between the two modes as required: the application program itself runs in protected mode, DOS calls is each to real mode connected.

Have DOS - Extender has the advantage over the Unreal fashion that they are mostly with Windows, at least with Windows 95/98/SE, yet compatible; Such DOS programs can be run directly under Windows so often. The Unreal mode under Windows, however, only by starting the computer in the "MS -DOS mode " can be used under Windows NT/2000/XP/Vista/7 directly.

674752
de