Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Virtual DOS machine
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=={{anchor|NTVDM|NTDOS}}Windows NTVDM== [[File:Command.com Win10.png|thumb|[[COMMAND.COM]] running in the NTVDM of [[Windows 10]]]] 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.1x|Windows 3.x]]) environment is called {{mono|ntvdm.exe}}.<ref name="Schulman_1994_Undocumented-DOS"/> In order to execute DOS programs, NTVDM loads {{mono|[[NTIO.SYS]]}} which in turn loads {{mono|[[NTDOS.SYS]]}}, which executes a modified {{mono|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 {{mono|[[IO.SYS]]}}, {{mono|[[MSDOS.SYS]]}} and {{mono|[[COMMAND.COM]]}}<ref name="Schulman_1994_Undocumented-DOS"/> with all hard-wired assumptions on the [[FAT file system]] removed and using the [[invalid opcode]] 0xC4 0xC4 to [[BIOS operation|bop]] down into the 32-bit NTVDM to handle the requests.<ref name="Schulman_1994_Undocumented-DOS"/> Originally, NTDOS reported a DOS version of 30.00 to programs,<ref name="Schulman_1994_Undocumented-DOS"/> but this was soon changed to report a version of 5.00 at {{code|2=asm|1=INT 21h/AH=30h}} and 5.50 at {{code|2=asm|1=INT 21h/AX=3306h}} to allow more programs to run unmodified.<ref name="Schulman_1994_Undocumented-DOS"/> 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. 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.<ref name="Microsoft_27"/> The 32-bit [[Windows on Windows|WoW]] translation layer [[thunk]]s 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. {{mono|wowexec.exe}} is the emulation layer that emulates 16-bit Windows. [[Windows XP]] added [[Sound Blaster]] 2.0 emulation.<ref name="itPro_2002"/> 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 [[Object Linking and Embedding|OLE]], [[Dynamic Data Exchange|DDE]] and [[named pipe]]s. Since virtual 8086 mode is not available on non-[[x86]]-based processors (more specifically, [[MIPS architecture|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]].<ref name="Schulman_1994_Undocumented-DOS"/> Up to [[Windows NT 3.51]], only 80286 emulation is available. With [[Windows NT 4.0]], [[Intel 80486|486]] emulation was added.<ref name="Microsoft_2006"/> 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 computing|32-bit]] processors. ===Commands=== The following [[command (computing)|commands]] are part of the Windows XP MS-DOS subsystem.<ref name="Microsoft_490895"/> {{div col|colwidth=9em}} * [[APPEND (DOS command)|APPEND]] * [[DEBUG (DOS command)|DEBUG]] * [[MS-DOS Editor|EDIT]] * [[Edlin|EDLIN]] * [[EXE2BIN]] * [[FASTOPEN]] * [[FORCEDOS]] * [[GRAPHICS (DOS command)|GRAPHICS]] * [[LOADFIX (DOS command)|LOADFIX]] * [[LOADHIGH (DOS command)|LOADHIGH (LH)]] * [[MEM (DOS command)|MEM]] * [[NLSFUNC (DOS command)|NLSFUNC]] * [[VER (DOS command)|SETVER]] * [[SHARE (DOS command)|SHARE]] {{div col end}} ===Security issue=== 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 [[Superuser|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.<ref name="Microsoft_MS10-015"/> Ormandy published a [[Exploit (computer security)|proof-of-concept exploit]] for the vulnerability.<ref name="Ormandy_2010"/> 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.<ref name="inquirer"/><ref name="technet"/> Once the Microsoft security patches had been applied to the affected operating systems the VDM could be safely reenabled.<ref group="nb" name="VDMReg"/> ===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.<ref name="XPVDM bug"/> 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.<ref name="XPVDM bug"/> 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 |date=April 2010}}. 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=== 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]].<ref name="Intel_2013_Arch-Ref"/> NTVDM is not supported on x86-64 editions of Windows,<ref name="Klein_2008"/> including DOS programs,<ref name="Microsoft_2007_Limitations"/> because NTVDM uses VM86 CPU mode instead of the Local Descriptor Table in order to enable 16βbits segment required for addressing.<ref name="modify_ldt"/> 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. {{anchor|x64alt}}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,<ref name="dosEx64"/> 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 (software)|Wine]] (see the section on WineVDM below).<ref name="Otvdm"/>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)