All Topics  
Virtual 8086 mode

 

   Email Print
   Bookmark   Link






 

Virtual 8086 mode



 
 
In the 80386 microprocessor
Microprocessor

A microprocessor incorporates most or all of the functions of a central processing unit on a single integrated circuit . The first microprocessors emerged in the early 1970s and were used for electronic calculators, using Binary-coded decimal arithmetic on 4-bit Word ....
 and later, Virtual 8086 mode, also called virtual real mode or VM86, allows the execution of real mode
Real mode

Real mode, also called real address mode, is an operating mode of 80286 and later x86-compatible Central processing unit. Real mode is characterized by a 20 bit segmented memory address space , direct software access to BIOS routines and peripheral hardware, and no concept of memory protection or computer multitasking at the hardware le...
 applications that are incapable of running
Protected mode

In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units ....
 directly in protected mode
Protected mode

In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units ....
.

VM86 mode uses a segmentation scheme identical to that of real mode (for compatibility reasons), and also uses 21-bit
Bit

A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
 addressing — resulting in linear addressing — so it is subject to paging
Paging

In computer operating systems that have their main memory divided into page , paging is a transfer of pages between main memory and an auxiliary store, such as hard disk drive....
.

s used to execute DOS
DOS

DOS, short for "Disk Operating System", is a shorthand term for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions Windows 95, Windows 98, and Windows Me....
 programs in Microsoft Windows/386, Windows 3.x
Windows 3.1x

Windows 3.1x is a line of operating systems produced by Microsoft for use on personal computers. The line began with Windows 3.1, which was released in March 1992 as a successor to Windows 3.0....
, Windows 9x
Windows 9x

Windows 9x is the family of Microsoft Windows operating systems that comprises the hybrid 16/32-bit Windows versions: Windows 95, Windows 98, which were produced in the 1990s, and often also Windows Me, which was produced in 2000....
/Me
Windows Me

Windows Millennium Edition, or Windows Me , is a hybrid 16-bit/32-bit graphical operating system released on 14 September 2000 by Microsoft....
, and OS/2
OS/2

OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "IBM Personal System/2 " line of second-generation personal computers....
 2.x and later through Virtual DOS machine
Virtual DOS machine

Virtual DOS machine is Microsoft's technology that allows running legacy MS-DOS and Windows 3.1x programs on Intel 80386 or higher computers when there is already another operating system running and controlling the hardware....
s, in SCO UNIX through Merge
Merge (software)

Merge is a software system which allows a user to run DOS/Windows 3.1x on SCO UNIX, in an Intel 8086 virtual machine.Merge was originally developed to run DOS under UNIX System V Release 2 on an AT&T 6300+ personal computer....
, and in Linux
Linux

Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed by anyone under the terms of the GNU GPL license...
 through dosemu
DOSEMU

DOSEMU, alternatively rendered dosemu, is a compatibility layer software package that enables MS-DOS systems, DOS clones such as FreeDOS, and DOS software to run under Linux on x86-based PCs ....
.

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.

most common problem by running 8086 code from protected mode is memory addressing which is totally different between protected mode
Protected mode

In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units ....
 and real mode
Real mode

Real mode, also called real address mode, is an operating mode of 80286 and later x86-compatible Central processing unit. Real mode is characterized by a 20 bit segmented memory address space , direct software access to BIOS routines and peripheral hardware, and no concept of memory protection or computer multitasking at the hardware le...
. As mentioned, by working under VM86 mode the segmentation mechanism returns to work just like under real mode, but the paging
Paging

In computer operating systems that have their main memory divided into page , paging is a transfer of pages between main memory and an auxiliary store, such as hard disk drive....
 mechanism is still active, and it is transparent to the real mode code, thus memory protection
Memory protection

Memory protection is a way to control memory usage on a computer, and is core to virtually every modern operating system. The main purpose of memory protection is to prevent a process running on an operating system from accessing memory beyond that allocated to it....
 is still applicable, and so is the isolation of the address space.

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.






Discussion
Ask a question about 'Virtual 8086 mode'
Start a new discussion about 'Virtual 8086 mode'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In the 80386 microprocessor
Microprocessor

A microprocessor incorporates most or all of the functions of a central processing unit on a single integrated circuit . The first microprocessors emerged in the early 1970s and were used for electronic calculators, using Binary-coded decimal arithmetic on 4-bit Word ....
 and later, Virtual 8086 mode, also called virtual real mode or VM86, allows the execution of real mode
Real mode

Real mode, also called real address mode, is an operating mode of 80286 and later x86-compatible Central processing unit. Real mode is characterized by a 20 bit segmented memory address space , direct software access to BIOS routines and peripheral hardware, and no concept of memory protection or computer multitasking at the hardware le...
 applications that are incapable of running
Protected mode

In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units ....
 directly in protected mode
Protected mode

In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units ....
.

VM86 mode uses a segmentation scheme identical to that of real mode (for compatibility reasons), and also uses 21-bit
Bit

A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
 addressing — resulting in linear addressing — so it is subject to paging
Paging

In computer operating systems that have their main memory divided into page , paging is a transfer of pages between main memory and an auxiliary store, such as hard disk drive....
.

Usage

It is used to execute DOS
DOS

DOS, short for "Disk Operating System", is a shorthand term for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions Windows 95, Windows 98, and Windows Me....
 programs in Microsoft Windows/386, Windows 3.x
Windows 3.1x

Windows 3.1x is a line of operating systems produced by Microsoft for use on personal computers. The line began with Windows 3.1, which was released in March 1992 as a successor to Windows 3.0....
, Windows 9x
Windows 9x

Windows 9x is the family of Microsoft Windows operating systems that comprises the hybrid 16/32-bit Windows versions: Windows 95, Windows 98, which were produced in the 1990s, and often also Windows Me, which was produced in 2000....
/Me
Windows Me

Windows Millennium Edition, or Windows Me , is a hybrid 16-bit/32-bit graphical operating system released on 14 September 2000 by Microsoft....
, and OS/2
OS/2

OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "IBM Personal System/2 " line of second-generation personal computers....
 2.x and later through Virtual DOS machine
Virtual DOS machine

Virtual DOS machine is Microsoft's technology that allows running legacy MS-DOS and Windows 3.1x programs on Intel 80386 or higher computers when there is already another operating system running and controlling the hardware....
s, in SCO UNIX through Merge
Merge (software)

Merge is a software system which allows a user to run DOS/Windows 3.1x on SCO UNIX, in an Intel 8086 virtual machine.Merge was originally developed to run DOS under UNIX System V Release 2 on an AT&T 6300+ personal computer....
, and in Linux
Linux

Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed by anyone under the terms of the GNU GPL license...
 through dosemu
DOSEMU

DOSEMU, alternatively rendered dosemu, is a compatibility layer software package that enables MS-DOS systems, DOS clones such as FreeDOS, and DOS software to run under Linux on x86-based PCs ....
.

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 between protected mode
Protected mode

In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units ....
 and real mode
Real mode

Real mode, also called real address mode, is an operating mode of 80286 and later x86-compatible Central processing unit. Real mode is characterized by a 20 bit segmented memory address space , direct software access to BIOS routines and peripheral hardware, and no concept of memory protection or computer multitasking at the hardware le...
. As mentioned, by working under VM86 mode the segmentation mechanism returns to work just like under real mode, but the paging
Paging

In computer operating systems that have their main memory divided into page , paging is a transfer of pages between main memory and an auxiliary store, such as hard disk drive....
 mechanism is still active, and it is transparent to the real mode code, thus memory protection
Memory protection

Memory protection is a way to control memory usage on a computer, and is core to virtually every modern operating system. The main purpose of memory protection is to prevent a process running on an operating system from accessing memory beyond that allocated to it....
 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
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
 and DOSEMU
DOSEMU

DOSEMU, alternatively rendered dosemu, is a compatibility layer software package that enables MS-DOS systems, DOS clones such as FreeDOS, and DOS software to run under Linux on x86-based PCs ....
 for Linux
Linux

Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed by anyone under the terms of the GNU GPL license...
 systems.

64-bit support


Support for Virtual 8086 mode is not available in x86-64 Long Mode
Long mode

In the x86-64 computer architecture, long mode is the mode where a 64-bit application can access the 64-bit instructions and registers, while 32-bit and 16-bit programs are executed in a compatibility sub-mode....
, although it is still present on 64-bit capable processors running in 32-bit protected mode. The removal of this sub-mode means that 16-bit compatibility must be rewritten or removed from 64-bit operating systems. For example, DOS and 16-bit Windows application support is not present in x64 editions of Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
, necessitating the use of 3rd party emulation software such as DOSBox
DOSBox

DOSBox is an emulator which emulates an IBM PC compatible computer running MS-DOS. It is intended especially for use with old Personal computer game....
.

See also

  • IA-32
    IA-32

    IA-32 , often generically called x86 or x86-32, is the instruction set architecture of Intel's most commercially successful microprocessors....
  • x86 architecture
    X86 architecture

    The generic term x86 refers to the most commercially successful instruction set architecture in the history of personal computing. It derived from the model numbers, ending in "86", of the first few processor generations Backward compatibility with the original Intel 8086....
  • x86 assembly language
    X86 assembly language

    x86 assembly language is the family of backwards-compatible assembly languages for the x86 class of processors, which includes Intel's Pentium series and AMD's Athlon series....