Recent from talks
Contribute something
Nothing was collected or created yet.
Virtual DOS machine
View on WikipediaVirtual DOS machines (VDM) refer to a technology that allows running 16-bit/32-bit DOS and 16-bit Windows programs when there is already another operating system running and controlling the hardware.
Overview
[edit]Virtual DOS machines can operate either exclusively through typical software emulation methods (e.g. dynamic recompilation) or can rely on the virtual 8086 mode of the Intel 80386 processor, which allows real mode 8086 software to run in a controlled environment by catching all operations which involve accessing protected hardware and forwarding them to the normal operating system (as exceptions). The operating system can then perform an emulation and resume the execution of the DOS software.
VDMs generally also implement support for running 16-bit and 32-bit protected mode software (DOS extenders), which has to conform to the DOS Protected Mode Interface (DPMI).[1]
When a DOS program running inside a VDM needs to access a peripheral, Windows will either allow this directly (rarely), or will present the DOS program with a virtual device driver (VDD) which emulates the hardware using operating system functions. A VDM will systematically have emulations for the Intel 8259A interrupt controllers, the 8254 timer chips, the 8237 DMA controller, etc.[1]
Concurrent DOS 8086 emulation mode
[edit]In January 1985 Digital Research together with Intel previewed Concurrent DOS 286 1.0,[2] a version of Concurrent DOS capable of running real mode DOS programs in the 80286's protected mode.[2] The method devised on B-1 stepping processor chips, however, in May 1985 stopped working on the C-1 and subsequent processor steppings shortly before Digital Research was about to release the product. Although with the E-1 stepping Intel started to address the issues in August 1985, so that Digital Research's "8086 emulation mode" worked again utilizing the undocumented LOADALL processor instruction,[3][4] it was too slow to be practical. Microcode changes for the E-2 stepping improved the speed again.[5][6] This early implementation can be seen as a predecessor to actual virtual DOS machines.
Eventually, Concurrent DOS 286 was reworked from a potential desktop operating system to become FlexOS 286 for industrial use in 1986.[7][8] It was also licensed by IBM for their 4680 OS in 1986.[9][10]
When Intel's 80386 with its virtual 8086 mode became available (as samples since October 1985 and in quantities since June 1986), Digital Research switched to use this to run real mode DOS programs in virtual DOS machines in protected mode under Concurrent DOS 386 1.0 (February 1987)[11] and FlexOS 386 1.0 (June 1987).[12] However, the architecture of these multiuser multitasking protected mode operating systems was not DOS-based by themselves.
Concurrent DOS 386 was later developed to become Multiuser DOS (since 1991) and REAL/32 (since 1995). FlexOS 386 later became 4690 OS in 1993.
DOS-based VDMs
[edit]In contrast to these protected mode operating systems, DOS, by default, is a real-mode operating system, switching to protected mode and virtual 86 mode only on behalf of memory managers and DOS extenders in order to provide access to extended memory or map in memory into the first megabyte, which is accessible to normal DOS programs.
DOS-based VDMs appeared with Microsoft's Windows/386 2.01 in September 1987.[13] DOS-based virtual DOS machines were also present in Windows 3.0, 3.1x and Windows for Workgroups 3.1x running in 386 Enhanced Mode as well as in Windows 95, 98, 98 SE and ME. One of the characteristics of these solutions running on top of DOS is that the memory layout shown inside virtual DOS machines are virtual instances of the DOS system and DOS driver configuration run before the multitasker is loaded, and that requests which cannot be handled in protected mode are passed down into the system domain to be executed by the underlying DOS system.
Similar to Windows 3.x 386 Enhanced Mode in architecture, EMM386 3.xx of Novell DOS 7,[1][14] Caldera OpenDOS 7.01,[14][15] DR-DOS 7.02[16] (and later) also uses DOS-based VDMs to support pre-emptive multitasking of multiple DOS applications, when the EMM386 /MULTI option is used.[14][15][16] This component has been under development at Digital Research / Novell since 1991[nb 1] under the codename "Vladivar" (originally a separate device driver KRNL386.SYS[1][14] instead of a module of EMM386). While primarily developed for the next major version of DR DOS, released as Novell DOS 7 in 1994,[1][14] it was also used in the never released DR DOS "Panther" and "Star Trek" project in 1992/1993.
OS/2 MVDM
[edit]Multiple virtual DOS machines (MVDM) are used in OS/2 2.0 and later since 1992.[1][4] OS/2 MVDMs are considerably more powerful than NTVDM. For example, block devices are supported, and various DOS versions can be booted into an OS/2 MVDM.[17] While the OS/2 1.x DOS box was based on DOS 3.0, OS/2 2.x MVDMs emulate DOS 5.0.[1]
Seamless integration of Windows 3.1 and later Win32s applications in OS/2 is a concept looking similar on surface to the seamless integration of XP Mode based on Windows Virtual PC 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".[18]
Due to a technical limitation, DOS and 16-bit Windows applications under OS/2 were unable to see more than 2 GB of hard drive space;[19] this was fixed in ArcaOS 5.0.4.[20]
Windows NTVDM
[edit]
NTVDM is a system component of all IA-32 editions of the Windows NT family since 1993 with the release of Windows NT 3.1. It allows execution of 16-bit Windows and 16-bit / 32-bit DOS applications. The Windows NT 32-bit user-mode executable which forms the basis for a single DOS (or Windows 3.x) environment is called ntvdm.exe.[1]
In order to execute DOS programs, NTVDM loads NTIO.SYS which in turn loads NTDOS.SYS, which executes a modified COMMAND.COM in order to run the application that was passed to NTVDM as command-line argument. The 16-bit real-mode system files are stripped down derivations of their MS-DOS 5.0 equivalents IO.SYS, MSDOS.SYS and COMMAND.COM[1] with all hard-wired assumptions on the FAT file system removed and using the invalid opcode 0xC4 0xC4 to bop down into the 32-bit NTVDM to handle the requests.[1] Originally, NTDOS reported a DOS version of 30.00 to programs,[1] but this was soon changed to report a version of 5.00 at INT 21h/AH=30h and 5.50 at INT 21h/AX=3306h to allow more programs to run unmodified.[1] This holds true 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 are missing.
There was a well-known issue within NTVDM in Windows 2000, where the lack of the NT branding resulted in frequent crashes and instabilities, spurred by the 2-month-long debate between Bill Gates and Jim Allchin.[21]
16-bit Windows applications by default all run in their own thread within a single NTVDM process. Although NTVDM itself is a 32-bit process and pre-emptively multitasked with respect to the rest of the system, the 16-bit applications within it are cooperatively multitasked with respect to each other. When the "Run in separate memory space" option is checked in the Run box or the application's shortcut file, each 16-bit Windows application gets its own NTVDM process and is therefore pre-emptively multitasked with respect to other processes, including other 16-bit Windows applications. NTVDM emulates BIOS calls and tables as well as the Windows 3.1 kernel and 16-bit API stubs.[22] The 32-bit WoW translation layer thunks 16-bit API routines.
32-bit DOS emulation is present for DOS Protected Mode Interface (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 2.0 emulation.[23] 16-bit virtual device drivers and DOS block device drivers (e.g., RAM disks) are not supported. Inter-process communication with other subsystems can take place through OLE, DDE and named pipes.
Since virtual 8086 mode is not available on non-x86-based processors (more specifically, MIPS, DEC Alpha, and PowerPC) NTVDM is instead implemented as a full emulator in these versions of NT, using code licensed from Insignia's SoftPC.[1] Up to Windows NT 3.51, only 80286 emulation is available. With Windows NT 4.0, 486 emulation was added.[24]
NTVDM is not included with 64-bit versions of Windows or ARM32 based versions such as Windows RT or Windows 10 IoT Core. The last version of Windows to include the component is Windows 10, as Windows 11 dropped support for 32-bit processors.
Commands
[edit]The following 16-bit commands for MS-DOS subsystem are included with Windows XP.[18]
Security issue
[edit]In January 2010, Google 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 level, noted as applicable to the security of all x86 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.[25] Ormandy published a proof-of-concept exploit for the vulnerability.[26] 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 are not affected since the NTVDM subsystem is not included.[27][28] Once the Microsoft security patches had been applied to the affected operating systems the VDM could be safely reenabled.[nb 2]
Limitations
[edit]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.[29] 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.[29]
In general, VDM and similar technologies do not satisfactorily run most older DOS games on today's computers. Emulation is only provided for the most basic peripherals, often implemented incompletely[citation needed]. 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.
Absence in x64 and AArch64 architectures
[edit]In an x86-64 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.[30] NTVDM is not supported on x86-64 editions of Windows,[31] including DOS programs,[32] because NTVDM uses VM86 CPU mode instead of the Local Descriptor Table in order to enable 16‑bits segment required for addressing.[33] NTVDM is also unavailable on AArch64 (or ARM64) versions of Windows (such as Windows RT), because Microsoft did not release a full emulator for this incompatible instruction set like it did on previous incompatible architectures.
While NTVDM is not supported on x86-64 and AArch64 versions of Windows, they can still be run using virtualization software, such as Windows XP Mode in non-home versions of Windows 7 or VMware Workstation. Other methods include using ReactOS-derived NTVDM,[34] or OTVDM (WineVDM), a 16-bit Windows interpreter based on MAME's i386 emulation and the 16-bit portion of the popular Windows compatibility layer, Wine (see the section on WineVDM below).[35]
WineVDM
[edit]A VDM is included in Wine and CrossOver for Linux and Mac OS X, known as WineVDM (also known as OTVDM). It has also been ported to Windows itself, as 64-bit versions of Windows do not include the NTVDM subsystem (see above).[36][non-primary source needed]
See also
[edit]Notes
[edit]- ^ KRNL386.SYS of DR DOS "Panther" has copyright strings "1991,1992".
- ^ A disabled VDM could be reenabled by setting the corresponding registry key back to
"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat\VDMDisallowed"=dword:00000000.
References
[edit]- ^ a b c d e f g h i j k l m Schulman, Andrew; Brown, Ralf D.; Maxey, David; Michels, Raymond J.; Kyle, Jim (1994) [November 1993]. Undocumented DOS: A programmer's guide to reserved MS-DOS functions and data structures - expanded to include MS-DOS 6, Novell DOS and Windows 3.1 (2 ed.). Reading, Massachusetts: Addison Wesley. ISBN 0-201-63287-X. (xviii+856+vi pages, 3.5-inch floppy) Errata: [1][2]
- ^ a b "Concurrent DOS-286 Challenges Unix". BYTE Magazine. 10 (5): 375–377. May 1985. Archived from the original on 2018-09-14. Retrieved 2017-01-23. [3]
- ^ "Concurrent DOS 68K 1.2 - Developer Kit for Motorola VME/10 - Disk 2". 1986-08-06 [1986-04-08]. Retrieved 2018-09-13. (NB. This package also includes some header files from Concurrent DOS 286, including STRUCT.H explicitly mentioning LOADALL for "8086 emulation".)
- ^ a b Deitel, Harvey M.; Kogan, Michael S. (1992). The Design of OS/2. Addison-Wesley. ISBN 0-201-54889-5.
- ^ Foster, Edward (1985-05-13). "Super DOS awaits new 80286 – Concurrent DOS 286 – delayed until Intel upgrades chip – offers Xenix's power and IBM PC compatibility". InfoWorld. 7 (19). InfoWorld Media Group: 17–18. ISSN 0199-6649. Archived from the original on 2019-04-03. Retrieved 2019-04-03.
- ^ Foster, Edward (1985-08-26). "Intel shows new 80286 chip – Future of DRI's Concurrent DOS 286 still unclear after processor fixed". InfoWorld. 7 (34). InfoWorld Media Group: 21. ISSN 0199-6649. Archived from the original on 2019-04-03. Retrieved 2019-04-03.
- ^ FlexOS Supplement for Intel iAPX 286-based Computers (PDF). 1.3 (1 ed.). Digital Research, Inc. November 1986. Archived (PDF) from the original on 2019-04-03. Retrieved 2018-08-14.
- ^ CBR, ed. (1987-01-15). "Digital Research launches FlexOS 286 Real-Time Manufacturing Operating System". Computer Business Review. Archived from the original on 2013-01-18. Retrieved 2018-09-15.
- ^ Calvo, Melissa; Forbes, Jim (1986-02-10). "IBM to use a DRI operating system". InfoWorld . Archived from the original on 2019-04-03. Retrieved 2011-09-06.
- ^ "IBM selects Concurrent DOS-286 for PC AT retail system" (PDF). European Review (18). Digital Research: 1. March 1986. Archived (PDF) from the original on 2019-04-03. Retrieved 2018-09-15.
- ^ Weiss, Jiri (1987-02-16). "DRI To Release Multiuser 80386 Operating System". InfoWorld. 9 (7): 1, 8. Archived from the original on 2019-04-03. Retrieved 2017-01-22. [4]
- ^ CBR, ed. (1987-06-03). "Digital Research shows off Real-Time FlexOS 386". Computer Business Review. Archived from the original on 2013-06-28. Retrieved 2011-09-06.
- ^ Necasek, Michal (2011-05-21). "Windows/386 2.01". OS/2 Museum. Archived from the original on 2019-04-03. Retrieved 2019-04-02.
- ^ a b c d e Paul, Matthias R. (1997-07-30) [1994-05-01]. "NWDOS-TIPs — Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds". MPDOSTIP. Release 157 (in German) (3 ed.). Archived from the original on 2016-11-03. Retrieved 2014-09-06. (NB. NWDOSTIP.TXT is a comprehensive work on Novell DOS 7 and OpenDOS 7.01, including the description of many undocumented features and internals. It is part of the author's yet larger MPDOSTIP.ZIP collection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the NWDOSTIP.TXT file.) mpdostip.zip
- ^ a b OpenDOS Developer's Reference Series — OpenDOS Multitasking API Guide — Programmer's Guide. UK: Caldera, Inc. August 1997. Caldera Part No. 200-DOMG-004. Archived from the original on 2017-09-10. Retrieved 2016-11-02.
- ^ a b Caldera DR-DOS 7.02 User Guide. Caldera, Inc. 1998 [1993, 1997]. Archived from the original on 2016-11-05. Retrieved 2014-09-06.
- ^ "OS/2 Workplace Shell Configuration Techniques" (PDF). IBM redbook. 1994. pp. 68–80. Archived from the original (PDF) on 2012-03-20. Retrieved 2011-07-05.
- ^ a b "MS-DOS subsystem commands". Microsoft.
- ^ "Why can't my DOS and Win-OS/2 sessions see more than 2 GB of free space?". Arca Noae. Arca Noae, LLC. Archived from the original on 2021-07-07. Retrieved 2020-09-03.
- ^ "ArcaOS Release Notes". 2020-08-31 [2017-05-15]. Archived from the original on 2021-03-16. Retrieved 2020-09-03.
- ^ "Wayback Machine". windows.microsoft.com. Archived from the original on 2000-08-15. Retrieved 2026-01-10.
- ^ "Chapter 27 - Windows Compatibility and Migration". Windows NT 4.0 Resource Kit. Microsoft. 2014-02-20. Retrieved 2017-07-19.
- ^ Schulman, Jerold (2002-12-04). "How do I troubleshoot MS-DOS programs running on Windows XP?". ITPro Windows. Retrieved 2017-07-19.
- ^ "INFO: How Windows handles floating-point calculations". Microsoft Support. 2006-11-21. Archived from the original on 2013-02-24. Retrieved 2017-07-19.
- ^ "Microsoft Security Bulletin MS10-015 - Important: Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege (977165)". Security TechCenter. Microsoft. 2010-03-17. Retrieved 2012-11-02.
- ^ Ormandy, Tavis (2010-01-19). "Microsoft Windows NT #GP Trap Handler Allows Users to Switch Kernel Stack". CVE-2010-0232. Full-disclosure. Retrieved 2013-04-13.
- ^ Farrell, Nick (2010-01-20). "Ancient Windows flaw found after 17 years". The Inquirer. Incisive. Archived from the original on 2010-01-23. Retrieved 2010-01-21.
- ^ "Microsoft Security Advisory (979682): Vulnerability in Windows Kernel Could Allow Elevation of Privilege". TechNet. Microsoft. 2010-01-20. Retrieved 2010-01-21.
- ^ a b The "Win 16 Subsystem has insufficient resources to continue running" problem on Windows XP
- ^ Intel 64 and IA-32 Architectures Software Developer's Manual Combined Volumes: 1, 2A, 2B, 2C, 3A, 3B, and 3C (PDF) (PDF). Intel. June 2013 [1997]. 325462-047US. Retrieved 2013-07-02.
- ^ Klein, Helge (2008-03-11). "Windows x64 - All the Same Yet Very Different, Part 5: NTVDM, Services, WoW64". Retrieved 2013-07-21.
- ^ "List of limitations in 64-Bit Windows". Microsoft Corporation. 2007-10-11. Retrieved 2017-07-19.
- ^ "modify_ldt(2)". Linux Programmer's Manual. Retrieved 2019-07-21.
- ^ "NTVDM from ReactOS". GitHub. Retrieved 2018-11-03.
- ^ "Winevdm". GitHub. Retrieved 2019-07-21. Edward Mendelson's additional documentation
- ^ "Otya128/Winevdm". GitHub.
Further reading
[edit]- Pietrek, Matt (August 1998). "Under The Hood August 1998". Microsoft Systems Journal. Archived from the original on 2000-04-20 – via www.microsoft.com.
External links
[edit]- Virtual DOS Machine Structure
- Troubleshooting MS-DOS-based programs in Windows XP
- Troubleshooting an MS-DOS application which hangs the NTVDM subsystem in Windows XP and Windows Server 2003
- Troubleshooting MS-DOS-based serial communication programs in Windows 2000 and later
- NTVDM from ReactOS, the custom standalone variant of NTVDM by Michael Stamper (able to run windowed text mode MS-DOS software in 64 bit Windows NT systems, this NTVDM works by using the following syntax: ntvdm.exe program.exe, like start command in Windows.
- MS-DOS Player for Win32-x64, a Microsoft MS-DOS Emulator, runs many command line DOS programs like compilers or other tools, also packaged into one standalone executable file.
- vDOS, a DOS emulator designed for the running the more serious DOS apps (not games) on 64-bit NT systems (effectively a replacement for NTVDM on modern systems).
Virtual DOS machine
View on Grokipediantvdm.exe—for each 16-bit application, which isolates the legacy code to prevent interference with the host system's 32-bit processes and enhances security through protected mode execution.[2] In multi-session environments like Windows Terminal Server, multiple VDM instances can run concurrently, though they do not share code across sessions to maintain isolation, resulting in higher resource consumption compared to native 32-bit applications due to the translation overhead.[3] For 16-bit Windows (Win16) applications, VDM leverages Windows on Windows (WOW) layering to handle cooperative multitasking and message passing, simulating the original Windows 3.x environment while integrating with the Win32 API.[4]
Historically, VDM technology originated in IBM's OS/2 operating system with OS/2 2.0 in 1992 as a means to support DOS applications on protected-mode platforms, influencing Microsoft's implementation in Windows NT to address enterprise needs for legacy software compatibility.[5] Over time, its relevance diminished with the introduction of 64-bit Windows editions (lacking NTVDM support since Windows XP 64-bit in 2003), and as of 2025, following the end-of-life of Windows 10 on October 14, 2025, native NTVDM support is discontinued in actively supported Windows versions, though third-party emulators and workarounds persist for running DOS-era programs.[1] Key APIs like VDMEnumTaskWOWEx and process creation flags such as CREATE_SEPARATE_WOW_VDM enable developers to manage and debug VDM instances, underscoring its role in debugging and enumeration of 16-bit tasks.[4]
Overview
Definition and Purpose
A Virtual DOS Machine (VDM) is a virtualized environment that emulates the application programming interface (API) of MS-DOS or PC DOS, enabling 16-bit DOS applications to execute on 32-bit or higher architectures lacking native real-mode hardware support.[1][6] This emulation occurs within a protected-mode process, where the VDM provides a simulated DOS kernel and hardware abstraction layer, allowing legacy software to interact with system resources as if running on original 8086-based systems.[6] The primary purpose of a VDM is to ensure backward compatibility for legacy DOS software in modern multitasking operating systems, permitting these applications to run alongside native programs without requiring a full reboot into a separate DOS environment.[1] By isolating each DOS session in its own virtual address space—typically limited to 1 MB for the application while leveraging extended memory services—a VDM prevents crashes or faults in one DOS program from destabilizing the host system or other running applications.[6] This isolation enhances system stability and resource sharing in protected-mode environments.[7] At its core, a VDM relies on the virtual 8086 (V86) mode of x86 processors, introduced in the Intel 80386, which simulates real-mode execution within a protected-mode context.[7] In V86 mode, the processor sets the VM flag in the EFLAGS register to execute 8086-compatible instructions directly on a virtualized 1 MB address space, while trapping sensitive operations (such as interrupts and I/O) for emulation by the host operating system.[7] This hardware-assisted virtualization allows DOS applications to perform direct hardware access, such as video output or disk I/O, through virtual device drivers that mediate between the guest and host.[6] VDMs target legacy applications from the 1980s and 1990s that depend on real-mode operations, including text-based utilities for data processing, classic games requiring direct graphics hardware manipulation, and business software for accounting or inventory management.[1] Early precursors, such as Concurrent DOS, laid groundwork for this approach by introducing multitasking for DOS sessions on 286 processors.Historical Context
During the 1980s, MS-DOS dominated personal computing as the primary operating system for IBM PC compatibles, but it operated exclusively in real mode, severely limiting its capabilities to 640 kilobytes of conventional memory for applications and providing no native support for multitasking.[8] This constraint stemmed from the Intel 8088 processor's 20-bit addressing scheme, which allowed only 1 megabyte of total address space, with the upper 384 kilobytes reserved for system ROM, video memory, and expansion hardware to ensure hardware expandability.[8] As software demands grew for more memory-intensive and concurrent operations, these real-mode limitations became a significant barrier to advancing toward protected-mode operating systems capable of leveraging larger memory spaces and true multitasking.[9] The introduction of Intel's 80386 microprocessor in October 1985 marked a pivotal technological shift, enabling protected-mode execution with a 32-bit architecture that supported up to 4 gigabytes of physical memory and 64 terabytes of virtual memory through segmentation and paging.[10] Central to this was the processor's virtual 8086 mode, which allowed real-mode DOS code to run within isolated, protected environments under a multitasking host OS, trapping direct hardware accesses and interrupts to prevent system-wide instability.[11] This hardware foundation addressed the growing need for backward compatibility with the vast DOS software ecosystem while supporting the transition to more robust 32-bit operating systems.[11] In response to DOS's shortcomings, IBM and Microsoft initiated a joint development effort for OS/2 in 1985, culminating in the release of OS/2 1.0 in December 1987, which introduced basic DOS compatibility sessions on 80286 processors but supported only a single session at a time and suffered from poor integration due to the lack of advanced virtualization.[12] Early attempts to run DOS applications on these multitasking systems often resulted in crashes or required reboots, as DOS programs directly manipulated hardware without memory protection, risking corruption of the host environment and highlighting the need for virtualized isolation.[13] The partnership frayed by 1990 amid disputes over direction and licensing, leading Microsoft to pursue Windows NT independently, released in 1993, while IBM advanced OS/2 2.0 in 1992—both paths relying on 80386-enabled emulation to sustain 16-bit DOS application support amid the shift to protected-mode architectures.[13]Early Implementations
Concurrent DOS 8086 Emulation Mode
The 8086 Emulation Mode in Concurrent DOS, developed by Digital Research, enabled the execution of multiple real-mode DOS tasks within a multitasking operating system environment on Intel 80386 processors emulating an 8086/8088 environment, serving as an early mechanism for concurrent program operation without full hardware virtualization. This mode integrated PC-DOS and CP/M-86 compatibility, allowing users to run standard DOS applications alongside native Concurrent tasks through a dispatcher that managed processor time slices among active programs.[14] Released as part of Concurrent PC DOS 386 in late 1987, the emulation mode leveraged the Intel 80386 processor's capabilities to support up to four virtual consoles, each hosting an independent DOS session via time-sliced scheduling at intervals of approximately 1/60th of a second. It permitted expanded memory allocation beyond the conventional 640 KB limit of standard DOS systems, typically several megabytes per task when using compatible expanded memory boards such as those from AST, facilitating early multitasking on 386-based hardware. Device arbitration features prevented conflicts, such as simultaneous printer access, while background tasks like print spoolers operated without dedicating a console.[15][16] The mode utilized the 80386's Virtual 8086 mode to emulate real-mode tasks within a protected mode environment, providing isolation between tasks and reducing risks from faulty applications compared to pure real-mode operation, though direct hardware access could still cause issues. Programs bypassing BIOS calls, such as those writing directly to video memory, often failed to coexist properly in windows, leading to display conflicts or instability. As a precursor to more robust virtual DOS machines, it prioritized compatibility and basic concurrency over comprehensive fault tolerance.[14][15]DOS-Based Virtual DOS Machines
DOS-based virtual DOS machines represent early attempts to introduce multitasking capabilities directly within the MS-DOS and PC DOS environments, enabling users to run and switch between multiple DOS sessions or applications without full operating system overhauls. These extensions relied on software-based techniques to simulate virtualization, primarily through task switchers that suspended and resumed programs, bridging the gap from single-tasking DOS to more advanced systems like OS/2. Key examples include the Task Swapper utility in MS-DOS 5.0, released in 1991, which integrated with the MS-DOS Shell to allow loading and switching between up to 13 applications by swapping their memory images to disk or expanded memory.[17] Similarly, DR-DOS 6.0, released in 1991, incorporated TaskMAX, a terminate-and-stay-resident (TSR) program that supported switching among up to 20 tasks, including multiple instances of the same application or separate DOS command interpreters.[18] These tools operated on non-preemptive multitasking principles, where programs ran cooperatively until manually switched or interrupted, often using TSR mechanisms to remain in memory and hook into DOS interrupts for context switching. In MS-DOS 5.0's Task Swapper, users activated switching via hotkeys like Alt+Tab within the Shell, which froze the current task and loaded another from a swap file, optimizing for systems with limited RAM by leveraging expanded memory standards like EMS if available.[17] TaskMAX in DR-DOS extended this with enhanced memory management, moving tasks between conventional, expanded, and extended memory via XMS drivers, and supporting features like data copying between applications and customizable swap files for disk-based storage of inactive sessions.[18] This approach provided pseudo-virtualization by maintaining isolated task environments, though it was limited to software emulation without hardware support, prone to conflicts from incompatible TSRs or memory overlaps.[19] Microsoft's historical reluctance to fully integrate native multitasking into MS-DOS stemmed from challenges encountered in developing the multitasking variant of MS-DOS 4.0 in the mid-1980s, which supported preemptive tasking and shared memory but faced compatibility issues with existing software and lacked OEM adoption, leading to its abandonment in favor of the joint IBM-Microsoft OS/2 project.[20] As a result, MS-DOS 5.0's Task Swapper served as a lightweight, built-in solution reliant on third-party-like TSR techniques, while competitors like DR-DOS filled gaps with more robust tools such as TaskMAX until the shift to protected-mode operating systems.[21] These DOS-hosted innovations acted as precursors to true virtual DOS machines, demonstrating the feasibility of session isolation on real-mode kernels but highlighting the need for hardware virtualization in later implementations.OS/2 Implementation
Multiple Virtual DOS Machines (MVDM)
The Multiple Virtual DOS Machines (MVDM) subsystem debuted with OS/2 2.0 in March 1992, developed by IBM as a core component for running multiple DOS applications concurrently within a 32-bit protected-mode operating system. This represented a significant advancement over the single-session DOS Compatibility Box in earlier OS/2 versions, enabling isolated execution of legacy DOS software alongside native OS/2 and Windows applications without compromising system stability. MVDM leveraged the Intel 80386 processor's capabilities to provide a fully virtualized environment, marking IBM's independent evolution of the platform following the 1990 split from Microsoft.[22][13] At its core, each MVDM instance operates in a separate virtual 8086 (V86) mode, emulating an 8086/8088 environment within protected mode to ensure isolation between sessions and the host OS/2 kernel. This architecture uses protected-mode tasks for memory protection and per-VDM state management, preventing one DOS application from interfering with others or native processes. Sessions are preemptively multitasked by the OS/2 scheduler, supporting simultaneous execution in windowed or full-screen modes; within multi-application VDMs (MAVDMs), cooperative multitasking handles interactions among DOS programs. DOS interrupts are handled through software emulation via virtual device drivers like VPIC.SYS (Virtual Programmable Interrupt Controller), which translates hardware events and routes them at privilege level 3 for efficient processing.[23] MVDM integrates seamlessly with OS/2's Workplace Shell, allowing users to launch and manage DOS sessions as desktop objects with customizable settings via the DOS Settings dialog, such as video mode and memory allocation. Each session supports up to 630 KB of base memory in real mode, plus the 64 KB High Memory Area (HMA), Upper Memory Blocks (UMBs) from 640 KB to 1 MB, and extended memory via XMS 2.0 (up to system limits, often configured to 16 MB or more) and expanded memory via LIM EMS 4.0 (up to 32 MB). It emulates DOS APIs from versions 3.3 through 5.0, including all documented interrupts like INT 21h for services and INT 31h for DPMI 0.9 mode switching, while supporting terminate-and-stay-resident (TSR) programs and device drivers in UMBs. This preemptive design provided superior stability for DOS multitasking compared to Windows 3.1's cooperative model, where a hung application could disrupt the entire system.[23][22]Features and Capabilities
The Multiple Virtual DOS Machines (MVDM) subsystem in OS/2 offers core features that facilitate the execution of DOS applications alongside native OS/2 programs. It supports both full-screen and windowed DOS sessions, allowing users to switch modes for optimal interaction, such as using Alt+Home for toggling in certain configurations. Printer and serial port redirection enables DOS output to route through OS/2's spooler or virtual device drivers, integrating legacy printing and communication needs with the host system's resources. Clipboard sharing further bridges environments by permitting text and graphics exchange between VDMs, OS/2 Presentation Manager applications, and Windows sessions, with shortcuts like Ctrl+Esc for full-screen "Copy All" operations.[23] MVDM's capabilities extend to robust hardware emulation and resource access, supporting EGA and VGA graphics via virtual drivers like VVGA.SYS and VEGA.SYS, which ensure compatibility for graphical DOS software in both single-plane background modes and foreground displays. Sound is managed through OS/2's native audio drivers, including PC speaker access (limited to one VDM at a time via toggles like HW_NOSOUND) and CD-ROM audio support with VCDROM. Networking integration occurs via NDIS drivers and named pipes, enabling DOS applications to utilize OS/2's LAN resources, although exclusive adapter access may apply in multi-VDM scenarios. The system accommodates multiple concurrent VDMs through pre-emptive multitasking, with each session allocated isolated EMS and XMS memory objects, constrained primarily by overall system resources.[23][24] Unique to MVDM is its tight coupling with the Win-OS/2 environment, where 16-bit Windows applications execute in separate or shared VDMs for seamless desktop integration, often mandating VGA mode to leverage full graphical fidelity. This architecture provides enhanced crash isolation over traditional DOS extenders, as VDMs run in protected mode with dedicated memory spaces and page fault handling; a failure in one session impacts only that VDM, preserving system stability without risking the entire OS/2 kernel or other processes.[23]Windows NT Implementation
NTVDM Subsystem
The NT Virtual DOS Machine (NTVDM) was introduced in Windows NT 3.1 in 1993 as a user-mode subsystem that emulates the MS-DOS environment on the Windows NT kernel, enabling the execution of 16-bit DOS and Windows applications on 32-bit x86 systems.[1] This component serves as a compatibility layer, allowing legacy software to run without direct access to the underlying NT kernel, thereby maintaining system stability.[1] Technically, NTVDM relies on the VDM.EXE process to create an emulated DOS session and employs WOWEXEC.EXE to initiate 16-bit Windows applications through the Windows on Windows (WoW) layer, which translates 16-bit calls to 32-bit NT APIs.[1] It provides support for MS-DOS 5.0 APIs, ensuring broad compatibility with DOS-based programs while operating within isolated virtual machine instances.[1] NTVDM integrates seamlessly with the Windows NT security model, executing DOS applications under the invoking user's security context to enforce access controls and prevent unauthorized operations.[1] Available exclusively on x86 32-bit editions of the Windows NT family, it reflects Microsoft's post-OS/2 development priorities, where the NT kernel emphasized enterprise-level stability and portability over extensive consumer-oriented DOS extensions following the 1990 split with IBM.[25]Usage and Commands
In Windows NT environments, the NTVDM subsystem automatically launches the NTVDM.exe process as the host when a user executes a 16-bit DOS application, providing the necessary emulation layer for compatibility.[1] Manual invocation of NTVDM occurs by running COMMAND.COM from a Windows command prompt, which initiates a DOS session within the emulated environment.[26] The primary command for direct execution is NTVDM.exe followed by the target DOS executable, such asntvdm.exe c:\dos\app.exe, allowing standalone launch of DOS programs outside of automated subsystem triggers.[27] Environment configuration for each NTVDM instance is managed through CONFIG.NT and AUTOEXEC.NT files, located in the %SystemRoot%\System32 directory, which parallel traditional DOS CONFIG.SYS and AUTOEXEC.BAT files to set device drivers, paths, and variables like EMS memory allocation.[28] These files are processed upon NTVDM startup to tailor the virtual machine's setup for specific applications.[29]
For practical deployment, users can create shortcuts with the target path %windir%\system32\ntvdm.exe c:\dos\app.exe to streamline access to legacy DOS software, ensuring the application runs in a dedicated NTVDM session.[27] Batch files (.BAT) execute seamlessly within an active DOS prompt hosted by NTVDM, inheriting the configured environment from AUTOEXEC.NT.[28]
NTVDM integrates with 16-bit Windows applications through the Windows on Windows (WOW) layer, which operates within the same NTVDM process to enable Win16 program execution, often visualized as a "WOWBOX" subprocess in task management tools.[1] Console output redirection is supported via standard DOS devices like CON, directing text to the hosting Windows console window for interactive use.[26]
