Difference between revisions of "Virtual DOS Machine"

From Computer History Wiki
Jump to: navigation, search
(Virtual 86 mode expanded: my indents have fallen and they cannot get up.)
Line 3: Line 3:
 
<blockquote>The purpose of a virtual-8086 task is to form a "Virtual machine" for running programs written for the 8086 processor. A complete virtual machine cosists of a 386 DX microprocessor hardware and system software. The emulation of an 8086 processor is the result of software using hardware:</Blockquote>
 
<blockquote>The purpose of a virtual-8086 task is to form a "Virtual machine" for running programs written for the 8086 processor. A complete virtual machine cosists of a 386 DX microprocessor hardware and system software. The emulation of an 8086 processor is the result of software using hardware:</Blockquote>
  
<blockquote><blockquote>*The hardware provides a virtual set of registers (through the TSS), a virtual memory space ( the first megabyte of the linear address space of the task), and a directly executes all instructions which deal with these registers and with this address space.  
+
<blockquote><blockquote>•The hardware provides a virtual set of registers (through the TSS), a virtual[ized] memory space (the first megabyte of the linear address space of the task), and a directly executes all instructions which deal with these registers and with this address space. </blockquote></blockquote>
  
<blockquote>*</blockquote></blockquote></blockquote>
+
<blockquote><blockquote>•The software controls the external interfaces of the virtual machine (I/O, interrupts and exceptions in a manner consistent with the larger envrionment in which it runs. In the case of I/O. software can choose either to emulate I/O instructions or to let the hardware execute them directly without software intervention.</blockquote></blockquote>
  
 +
<blockquote>Software which supports virtual 8086 machines is called a virtual-8086 monitor. [http://www.bitsavers.org/components/intel/80386/230985-003_386DX_Microprocessor_Programmers_Reference_Manual_1990.pdf Intel 386 DX Microprocessor programmers reference manual ]<blockquote>
  
 
To use virtual 8086 mode, an [[operating system]] sets up a virtual 8086 mode monitor, which is a program that manages the [[real mode]] [[program]] and emulates or filters access to system hardware and software resources. The monitor must run at privilege level 0 and in [[protected mode]]. Only the 8086 program runs in VM86 mode and at privilege level 3. When the real-mode program attempts to do things like access certain I/O ports to use hardware devices or access certain regions in its memory space, the CPU [[trap]]s these events and calls the V86 monitor, which examines what the real mode program is trying to do and either acts as a proxy to interface with the hardware, emulates the intended function the real-mode program was trying to access, or terminates the real-mode program if it is trying to do something that cannot either be allowed or be adequately supported (such as [[bootstrap|reboot]] the machine, set a [[video display]] into a mode that is not supported by the hardware and is not emulated, or write over operating system code).
 
To use virtual 8086 mode, an [[operating system]] sets up a virtual 8086 mode monitor, which is a program that manages the [[real mode]] [[program]] and emulates or filters access to system hardware and software resources. The monitor must run at privilege level 0 and in [[protected mode]]. Only the 8086 program runs in VM86 mode and at privilege level 3. When the real-mode program attempts to do things like access certain I/O ports to use hardware devices or access certain regions in its memory space, the CPU [[trap]]s these events and calls the V86 monitor, which examines what the real mode program is trying to do and either acts as a proxy to interface with the hardware, emulates the intended function the real-mode program was trying to access, or terminates the real-mode program if it is trying to do something that cannot either be allowed or be adequately supported (such as [[bootstrap|reboot]] the machine, set a [[video display]] into a mode that is not supported by the hardware and is not emulated, or write over operating system code).
  
The V86 monitor can also deny permission gently by emulating the failure of a requested operation—for example, it can make a [[disk]] drive always appear not ready when in fact it has not even checked the drive but simply will not permit the real-mode program to access it. Also, the V86 monitor can do things like map [[main memory]] [[virtual memory|page]]s, intercept calls and [[interrupt]]s, and preempt the real-mode program, allowing real-mode programs to be multitasked like protected-mode programs. By intercepting the hardware and software I/O of the real-mode program and tracking the state that the V86 program expects, it can allow multiple programs to share the same hardware without interfering with each other. So V86 mode provides a way for real-mode programs designed for a [[single-tasking]] environment (like DOS) to run concurrently in a [[multi-tasking]] environment.  
+
The V86 monitor can also deny permission gently by emulating the failure of a requested operation—for example, it can make a [[disk]] drive always appear not ready when in fact it has not even checked the drive but simply will not permit the real-mode program to access it. Also, the V86 monitor can do things like map [[main memory]] [[virtual memory|page]]s, intercept calls and [[interrupt]]s, and preempt the real-mode program, allowing real-mode programs to be multi-tasked like protected-mode programs. By intercepting the hardware and software I/O of the real-mode program and tracking the state that the V86 program expects, it can allow multiple programs to share the same hardware without interfering with each other. So V86 mode provides a way for real-mode programs designed for a [[single-tasking]] environment (like DOS) to run concurrently in a [[multi-tasking]] environment.  
  
 
A strange side effect of the early implementation of V86 mode was that if [[virtual memory|paging]] was off, the [[MS-DOS|DOS]] prompt would run in protected mode, and if paging was on, the DOS prompt would run as a virtual-86 machine mode task. There was a utility to test which mode the DOS prompt was running in.
 
A strange side effect of the early implementation of V86 mode was that if [[virtual memory|paging]] was off, the [[MS-DOS|DOS]] prompt would run in protected mode, and if paging was on, the DOS prompt would run as a virtual-86 machine mode task. There was a utility to test which mode the DOS prompt was running in.

Revision as of 23:15, 30 June 2020

A Virtual DOS Machine (VDM for short) is a term used by Microsoft to denote a Virtual-8086 task, a special execution envronment of the i386 CPU and later CPUs up to the Nehalem-C architecture that would create a virtual 8086 machine. The Westmere architecture and later, uses a cpu feature called VT-x ( Virtual execution ) and VT-d ( Virtual device )

The purpose of a virtual-8086 task is to form a "Virtual machine" for running programs written for the 8086 processor. A complete virtual machine cosists of a 386 DX microprocessor hardware and system software. The emulation of an 8086 processor is the result of software using hardware:
•The hardware provides a virtual set of registers (through the TSS), a virtual[ized] memory space (the first megabyte of the linear address space of the task), and a directly executes all instructions which deal with these registers and with this address space.
•The software controls the external interfaces of the virtual machine (I/O, interrupts and exceptions in a manner consistent with the larger envrionment in which it runs. In the case of I/O. software can choose either to emulate I/O instructions or to let the hardware execute them directly without software intervention.
Software which supports virtual 8086 machines is called a virtual-8086 monitor. Intel 386 DX Microprocessor programmers reference manual

To use virtual 8086 mode, an operating system sets up a virtual 8086 mode monitor, which is a program that manages the real mode program and emulates or filters access to system hardware and software resources. The monitor must run at privilege level 0 and in protected mode. Only the 8086 program runs in VM86 mode and at privilege level 3. When the real-mode program attempts to do things like access certain I/O ports to use hardware devices or access certain regions in its memory space, the CPU traps these events and calls the V86 monitor, which examines what the real mode program is trying to do and either acts as a proxy to interface with the hardware, emulates the intended function the real-mode program was trying to access, or terminates the real-mode program if it is trying to do something that cannot either be allowed or be adequately supported (such as reboot the machine, set a video display into a mode that is not supported by the hardware and is not emulated, or write over operating system code).

The V86 monitor can also deny permission gently by emulating the failure of a requested operation—for example, it can make a disk drive always appear not ready when in fact it has not even checked the drive but simply will not permit the real-mode program to access it. Also, the V86 monitor can do things like map main memory pages, intercept calls and interrupts, and preempt the real-mode program, allowing real-mode programs to be multi-tasked like protected-mode programs. By intercepting the hardware and software I/O of the real-mode program and tracking the state that the V86 program expects, it can allow multiple programs to share the same hardware without interfering with each other. So V86 mode provides a way for real-mode programs designed for a single-tasking environment (like DOS) to run concurrently in a multi-tasking environment.

A strange side effect of the early implementation of V86 mode was that if paging was off, the DOS prompt would run in protected mode, and if paging was on, the DOS prompt would run as a virtual-86 machine mode task. There was a utility to test which mode the DOS prompt was running in.