Virtual 8086 Mode

The operating mode Virtual 8086 Mode was introduced with the Intel 80386 processor. Since then - in 1985 - to protected-mode operating systems had not yet been established on the market against the real mode DOS operating system, was created with the Virtual 8086 Mode (short: VM86 ) created the possibility within a protected-mode operating system Real -mode programs ( ie especially DOS programs ) execute, without leaving the protected-mode environment.

The most famous example is the so-called DOS box, which existed from Microsoft Windows 3.0.

In Protected Mode (PM ) several programs (called tasks) can run more or less parallel. For each of these tasks can be specified on a particular bit in the status register, whether it should be a VM86 task.

In the Virtual 8086 mode, the processor behaves like a view from program ( very fast ) 8086th each VM86 task, a maximum of a mebibyte of memory. This needs - as opposed to real mode - however, not be the first mebibyte in memory because the protected-mode environment automatically performs a translation of the virtual addresses to physical addresses in the background.

Since a VM86 task runs unprivileged usually, he only has limited access rights to the hardware or certain CPU registers. (This is necessary because otherwise a program could handle in a " DOS box " the protected-mode operating system and thus the memory protection. ) Each hardware access that makes a VM86 task is, therefore intercepted by the processor and as an exception to the reported PM- operating system, which then either mimic the behavior of the hardware ( simulate ) must, or unauthorized access to the VM86 task and the current in his or her program ended. Since under DOS such direct hardware access are quite common, this is to the PM operating system wide requirements, since a large number must be replicated in hardware behavior. Since the flare and simulate the hardware access is also usually slower than the direct hardware access, many DOS programs running in VM86 mode is noticeably slower than in the "real" real mode.

The VM86 mode, however, was for example not only for DOS boxes Windows, OS / 2, Linux uses (via the dosemu program ), but also from DOS itself The store driver EMM386 from MS -DOS turned - by the user usually unnoticed - into protected mode to access the memory on the other side to get 1 - mebibyte limit. He then launched a VM86 task in the ongoing DOS was moved. EMM386 used the also available from the 80386 paging technology to provide the DOS programs more memory available by einblendete memory beyond the 1- mebibyte boundary in the DOS address space. ( Expanded Memory EMS) Such memory manager also existed for the other MS- DOS - compatible operating systems. Their names were different there, but their principle of operation was identical.

At 486 and Pentium more features for the VM86 mode were added that allow that certain interrupt service routines can be processed completely in VM86 mode without consuming task switching must take place in the protected mode operating system. This allows an execution speed that comes very close to the real Real fashion, especially since DOS software interrupts are very common, as they are used as a call to the operating system and BIOS routines.

With the dwindling importance of the DOS operating system and the VM86 mode is now to be considered rather historically and is therefore rarely used, even if it is still available in any current x86-compatible CPU. In the " Compatibility Mode " of the AMD64 architecture Virtual86 Fashion is no longer supported. However, there are software emulators like DOSBox, which can completely emulate a 8086 - compatible CPU incl typical PC hardware environment in software. He is still in "Legacy Mode" (32 -bit mode ) and available bit in each virtual machine with 16 or 32.

  • Microprocessor technology
806459
de