Virtual DOS machine
Encyclopedia
Virtual DOS machine is Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

's technology that allows running legacy DOS
DOS
DOS, short for "Disk Operating System", is an acronym 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 95, 98, and Millennium Edition.Related...

 and 16-bit Windows
Windows 3.1x
Windows 3.1x is a series of 16-bit operating systems produced by Microsoft for use on personal computers. The series began with Windows 3.1, which was first sold during March 1992 as a successor to Windows 3.0...

 programs on Intel 80386
Intel 80386
The Intel 80386, also known as the i386, or just 386, was a 32-bit microprocessor introduced by Intel in 1985. The first versions had 275,000 transistors and were used as the central processing unit of many workstations and high-end personal computers of the time...

 or higher computers when there is already another operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

 running and controlling the hardware.

Overview

Virtual DOS machines rely on the virtual 8086 mode
Virtual 8086 mode
In the 80386 microprocessor and later, virtual 8086 mode allows the execution of real mode applications that are incapable of running directly in protected mode while the processor is running a protected mode operating system.VM86 mode uses a segmentation scheme identical to that of real mode In...

 of the Intel 80386 processor, which allows real mode
Real mode
Real mode, also called real address mode, is an operating mode of 80286 and later x86-compatible CPUs. Real mode is characterized by a 20 bit segmented memory address space and unlimited direct software access to all memory, I/O addresses and peripheral hardware...

 8086 software to run in a controlled environment by catching and forwarding to the normal operating system (as exception
Exception handling
Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of exceptions, special conditions that change the normal flow of program execution....

s) all operations which involve accessing protected hardware. The operating system can then perform an emulation and resume the execution of the DOS software.

VDMs generally also implement support for running 16-
16-bit
-16-bit architecture:The HP BPC, introduced in 1975, was the world's first 16-bit microprocessor. Prominent 16-bit processors include the PDP-11, Intel 8086, Intel 80286 and the WDC 65C816. The Intel 8088 was program-compatible with the Intel 8086, and was 16-bit in that its registers were 16...

 and 32-bit
32-bit
The range of integer values that can be stored in 32 bits is 0 through 4,294,967,295. Hence, a processor with 32-bit memory addresses can directly access 4 GB of byte-addressable memory....

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

 software (DOS extender
DOS extender
A DOS extender is a computer software program which enables software to run under a protected mode environment even though the host operating system is only capable of operating in real mode....

s), which has to conform to the DOS Protected Mode Interface
DOS Protected Mode Interface
In computing, the DOS Protected Mode Interface is a specification introduced in 1989 which allows a DOS program to run in protected mode, giving access to many features of the processor not available in real mode...

.

When a DOS program running inside a VDM needs to access a peripheral, Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 will either allow this directly (rarely), or will present the DOS program with a Virtual Device Driver which emulates the hardware using operating system functions. A VDM will systematically have emulations for the Intel 8259A interrupt
Interrupt
In computing, an interrupt is an asynchronous signal indicating the need for attention or a synchronous event in software indicating the need for a change in execution....

 controllers, the 8254 timer chips, the 8237 DMA, etc.

NTVDM

The NTVDM is present in all 32-bit NT
Windows NT
Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...

-based Windows versions. Up to Windows NT 3.51, only 80286 emulation was available. With Windows NT 4.0, 486 emulation was added. 16-bit applications all run in their own thread within a single preemptively multithreaded 32-bit NTVDM process. The 16-bit processes are by default cooperatively multitasked with respect to each other, unless the "Run in separate memory space" option is checked in the Run box or the application's shortcut file. NTVDM emulates BIOS calls and tables as well as the Windows 3.1 kernel and 16-bit API stubs. The 32-bit WoW
Windows on Windows
In computing, Windows on Windows - commonly referred to by its acronym WOW or WoW - is a software component of 32-bit versions of the Microsoft Windows NT family of operating systems that provides limited support for running legacy Win16 applications - applications written for Windows 3.x...

 translation layer thunks 16-bit API routines. 32-bit DOS emulation is present for DOS Protected Mode Interface
DOS Protected Mode Interface
In computing, the DOS Protected Mode Interface is a specification introduced in 1989 which allows a DOS program to run in protected mode, giving access to many features of the processor not available in real mode...

 (DPMI) and 32-bit memory access. This layer converts the necessary extended and expanded memory calls for DOS functions into Windows NT memory calls. Wowexec.exe is the emulation layer that emulates 16-bit Windows. Windows XP added Sound Blaster
Sound Blaster
The Sound Blaster family of sound cards was the de facto standard for consumer audio on the IBM PC compatible system platform, until the widespread transition to Microsoft Windows 95, which standardized the programming interface at application level , and the evolution in PC design led to onboard...

 2.0 emulation . 16-bit virtual device drivers and DOS
DOS
DOS, short for "Disk Operating System", is an acronym 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 95, 98, and Millennium Edition.Related...

 block device drivers (e.g., RAM disks) are not supported. Inter-process communication
Inter-process communication
In computing, Inter-process communication is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for message passing, synchronization, shared...

 with other subsystems can take place through OLE, DDE and named pipes.

History

VDMs appeared with Windows/386 2.1 and are present in all subsequent 32-bit versions of Windows. In the Windows NT
Windows NT
Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...

 family, they are, however, relegated to running DOS and Windows 3.x
Windows 3.1x
Windows 3.1x is a series of 16-bit operating systems produced by Microsoft for use on personal computers. The series began with Windows 3.1, which was first sold during March 1992 as a successor to Windows 3.0...

 programs and no longer participate in the implementation of the Windows API
Windows API
The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces available in the Microsoft Windows operating systems. It was formerly called the Win32 API; however, the name "Windows API" more accurately reflects its roots in 16-bit Windows and its support on...

. The Windows NT executable which is used to handle a single DOS (and Windows 3.x) environment is called ntvdm.exe. The DOS environment implemented in NTVDM is based on MS-DOS
MS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...

 Version 5.0 even in the newest releases of Windows; many additional MS-DOS functions and commands introduced in MS-DOS Versions 6.x and in Windows 9x
Windows 9x
Windows 9x is a generic term referring to a series of Microsoft Windows computer operating systems produced since 1995, which were based on the original and later modified Windows 95 kernel...

 are missing.

VDMs were also used in 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 "Personal System/2 " line of second-generation personal...

 2.0 and later. OS/2 VDMs are considerably more powerful than NTVDM, e.g., block devices are supported, and various DOS versions can be booted into a OS/2 VDM. Seamless integration of Windows 3.1
Windows 3.1x
Windows 3.1x is a series of 16-bit operating systems produced by Microsoft for use on personal computers. The series began with Windows 3.1, which was first sold during March 1992 as a successor to Windows 3.0...

 and later Win32s
Win32s
Win32s is a 32-bit application runtime environment for the Microsoft Windows 3.1 and 3.11 operating systems. It allowed some 32-bit applications to run on the 16-bit operating system using call thunks.- Concept and Characteristics :...

 applications in OS/2 is a concept similar to the seamless integration of XP mode based on Windows Virtual PC
Windows Virtual PC
Windows Virtual PC is a virtualization program for Microsoft Windows. In July 2006 Microsoft released the Windows-hosted version as a free product...

 in Windows 7. A redirector in a "guest" VDM or NTVDM allows access on the disks of the OS/2 or NT "host". Applications in a "guest" can use named pipes for communication with their "host".

Similar to Windows 3.x 386 Enhanced Mode in architecture, EMM386 3.xx of Novell DOS 7, Caldera OpenDOS 7.01, DR-DOS
DR-DOS
DR-DOS is an MS-DOS-compatible operating system for IBM PC-compatible personal computers, originally developed by Gary Kildall's Digital Research and derived from Concurrent PC DOS 6.0, which was an advanced successor of CP/M-86...

 7.02 (and later) also utilizes VDMs to support pre-emptive multitasking of multiple DOS applications, when the EMM386 /MULTI option is used. This component has been under development at Digital Research
Digital Research
Digital Research, Inc. was the company created by Dr. Gary Kildall to market and develop his CP/M operating system and related products. It was the first large software company in the microcomputer world...

 / Novell
Novell
Novell, Inc. is a multinational software and services company. It is a wholly owned subsidiary of The Attachmate Group. It specializes in network operating systems, such as Novell NetWare; systems management solutions, such as Novell ZENworks; and collaboration solutions, such as Novell Groupwise...

 since (at least) 1991 under the codename "Vladivar" (originally a separate device driver KRNL386.SYS instead of a module of EMM386). While primarily developed for the next major version of DR DOS, released as Novell DOS 7 in 1994, it was also utilized in the never released "Star Trek
Star Trek project
Star Trek was the code name given to a prototype project at Apple Computer and Novell during 1992 and 1993. The project was named after the Star Trek science fiction franchise with the slogan "To boldly go where no Mac has gone before."...

" project in 1992/1993.

Wine
Wine (software)
Wine is a free software application that aims to allow computer programs written for Microsoft Windows to run on Unix-like operating systems. Wine also provides a software library, known as Winelib, against which developers can compile Windows applications to help port them to Unix-like...

 also includes a VDM, which it utilizes for running Win16 and DOS applications. Wine's VDM is compatible with both 32-bit and 64-bit operating systems. However, due to utilization of long mode
Long mode
In the x86-64 computer architecture, long mode is the mode where a 64-bit application can access 64-bit instructions and registers...

, 16bit applications did not run on 64bit Linux kernel
Linux kernel
The Linux kernel is an operating system kernel used by the Linux family of Unix-like operating systems. It is one of the most prominent examples of free and open source software....

.

Security issue

In January 2010, Google
Google
Google Inc. is an American multinational public corporation invested in Internet search, cloud computing, and advertising technologies. Google hosts and develops a number of Internet-based services and products, and generates profit primarily from advertising through its AdWords program...

 security researcher Tavis Ormandy revealed a serious security flaw in Windows NT's VDM implementation that allowed unprivileged users to escalate their privileges to SYSTEM
Superuser
On many computer operating systems, the superuser is a special user account used for system administration. Depending on the operating system, the actual name of this account might be: root, administrator or supervisor....

 level, noted as applicable to the security of all versions of the Windows NT kernel since 1993. This included all 32-bit versions of Windows NT, 2000, XP, Server 2003, Vista, Server 2008, and Windows 7. Ormandy did publish a proof-of-concept exploit
Exploit (computer security)
An exploit is a piece of software, a chunk of data, or sequence of commands that takes advantage of a bug, glitch or vulnerability in order to cause unintended or unanticipated behavior to occur on computer software, hardware, or something electronic...

 for the vulnerability. Prior to Microsoft's release of a security patch, the workaround for this issue was to turn off 16-bit application support, which prevented older programs (those written for DOS and Windows 3.1) from running. 64-bit versions of Windows were not affected since they do not include the NTVDM subsystem.

Limitations

A limitation exists in the Windows XP 16-bit subsystem (but not in earlier versions of Windows NT) because of the raised per session limit for GDI objects which causes GDI handles to be shifted to the right by two bits, when converting them from 32 to 16 bits. As a result, the actual handle cannot be larger than 14 bits and consequently 16-bit applications that happen to be served a handle larger than 16384 by the GDI system crash and terminate with an error message.

In an x86-64
X86-64
x86-64 is an extension of the x86 instruction set. It supports vastly larger virtual and physical address spaces than are possible on x86, thereby allowing programmers to conveniently work with much larger data sets. x86-64 also provides 64-bit general purpose registers and numerous other...

 CPU, virtual 8086 mode is available as a sub-mode only in its legacy mode (for running 16- and 32-bit operating systems), not in the native, 64-bit long mode
Long mode
In the x86-64 computer architecture, long mode is the mode where a 64-bit application can access 64-bit instructions and registers...

. Rather than update the NTVDM to correctly work on 64bit versions of Windows, Microsoft choose to no longer include it thus versions of Windows NT for 64-bit
64-bit
64-bit is a word size that defines certain classes of computer architecture, buses, memory and CPUs, and by extension the software that runs on them. 64-bit CPUs have existed in supercomputers since the 1970s and in RISC-based workstations and servers since the early 1990s...

 architectures (x86-64
X86-64
x86-64 is an extension of the x86 instruction set. It supports vastly larger virtual and physical address spaces than are possible on x86, thereby allowing programmers to conveniently work with much larger data sets. x86-64 also provides 64-bit general purpose registers and numerous other...

 and IA-64) are unable to run DOS or 16-bit Windows applications. The only possibility to run them is to use Windows XP Mode or other virtualization
Virtualization
Virtualization, in computing, is the creation of a virtual version of something, such as a hardware platform, operating system, a storage device or network resources....

 software.

In general, VDM and similar technologies do not satisfactorily run many older DOS programs on today's computers. Emulation is only provided for the most basic peripherals, often implemented incompletely. For example, sound emulation in NTVDM is very limited. NT-family versions of Windows only update the real screen a few times per second when a DOS program writes to it, and they do not emulate higher resolution graphics modes. Because software mostly runs native at the speed of the host CPU, all timing loops will expire prematurely. This either makes a game run much too fast or causes the software not even to notice the emulated hardware peripherals, because it does not wait long enough for an answer.

See also

  • Comparison of platform virtual machines
  • List of Microsoft Windows components
  • Hypervisor
    Hypervisor
    In computing, a hypervisor, also called virtual machine manager , is one of many hardware virtualization techniques that allow multiple operating systems, termed guests, to run concurrently on a host computer. It is so named because it is conceptually one level higher than a supervisory program...

  • Windows on Windows
    Windows on Windows
    In computing, Windows on Windows - commonly referred to by its acronym WOW or WoW - is a software component of 32-bit versions of the Microsoft Windows NT family of operating systems that provides limited support for running legacy Win16 applications - applications written for Windows 3.x...

  • 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 ....

    , similar purpose compatibility layer
    Compatibility layer
    A compatibility layer is a term that refers to components that allow for non-native support of components.In software engineering, a compatibility layer allows binaries for a legacy or foreign system to run on a host system. This translates system calls for the foreign system into native system...

     for Linux
    Linux
    Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

  • DOSBox
    DOSBox
    DOSBox is emulator software that emulates an IBM PC compatible computer running MS-DOS. It is intended especially for use with old PC games. DOSBox is free software....

    , solves many issues of the Virtual DOS Machine by emulating software and hardware features of DOS.
  • Merge (software)
    Merge (software)
    Merge is a software system which allows a user to run DOS/Windows 3.1 on SCO UNIX, in an 8086 virtual machine.Merge was originally developed to run DOS under UNIX System V Release 2 on an AT&T 6300+ personal computer...

  • VP/ix

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK