- Virtual 8086 mode
In the
80386 microprocessor and later, Virtual 8086 mode, also called virtual real mode or VM86, allows the execution ofreal mode applications that are incapable of running directly inprotected mode .VM86 mode uses a segmentation scheme identical to that of real mode (for compatibility reasons), and also uses 21-
bit addressing — resulting in linear addressing — so it is subject topaging .Usage
It is used to execute
DOS programs inMicrosoft Windows/386 , Windows 3.x,Windows 9x /Me, andOS/2 2.x and later throughVirtual DOS machine s, inSCO UNIX through Merge, and inLinux throughdosemu .Protected mode DOS programs, either 16 or 32-bit, do not execute in virtual 8086 mode, but rather in user mode (as long as they are
DPMI compatible), so the above emulators actually do more than just supporting the virtual 8086 mode.Memory addressing
The most common problem by running 8086 code from protected mode is
memory addressing which is totally different betweenprotected mode andreal mode .As mentioned, by working under VM86 mode the segmentation mechanism returns to work just like under real mode, but thepaging mechanism is still active, and it is transparent to the real mode code, thusmemory protection is still applicable, and so is the isolation of the address space.Interrupts
When interrupts (both hardware, software and iret instruction) occur, the processor switches off the VM86 mode and returns to work in full protected mode to handle the interrupt. And before servicing the interrupt, the DS, ES, FS, and GS registers are pushed on the new stack and zeroed.
Virtual-8086 Mode Enhancements Identification
Support of Enhanced Virtual 8086 mode can be identified under Linux by "vme" flag in the /proc/cpuinfo file (Under "flags:" section).
Identification can be generally done also using cpuid instruction, where as result value of 2nd bit (bit no.1, 0x2 in value) in EDX register represents support of Enhanced Virtual 8086 mode.
Applications
Virtual 8086 mode is typically used to implement DOS boxes inside protected mode operating systems. Examples include
NTVDM under Windows andDOSEMU forLinux systems.See also
*
IA-32
*x86 architecture
*x86 assembly language
Wikimedia Foundation. 2010.