Virtual DOS machine

from Wikipedia, the free encyclopedia

The Virtual DOS Machine ( VDM ) is a virtual machine that is included in some operating systems in the Microsoft Windows NT family to ensure compatibility with older software developed for MS-DOS .

functionality

Based on ntvdm.exe, a virtual DOS machine largely simulates a DOS environment, some PC hardware components (e.g. processor in real mode , Intel 8253/8254 PIT , CGA / EGA / VGA - / PC-BIOS ), as well as common DOS memory addressing interfaces ( EMS / XMS / DPMI ) for programs that were not designed for the Win32 API but are programmed for the INT-21h interface or direct hardware access. Most DOS programs can be executed under Windows via this emulation layer. The programs appear to be on a DOS machine, but they have no direct contact with the Windows operating system resources or hardware. Requirements for the operating system (e.g. reading or writing files) are translated into the corresponding Windows functions by the virtual DOS machine. Machine instructions that are not allowed under Windows (these lead to exceptions ), but would be unprotected in DOS, are intercepted and then either emulated or translated (e.g. the int , in / out , cli / sti , hold instructions), or still prevented (e.g. direct access to data carriers). Multiple instances of a Virtual DOS Machine can be executed. This means that several virtual DOS machines can run simultaneously on a Windows operating system. Using special wrapper functions, it is possible to access the content of the VDM from Windows.

The Virtual DOS Machine takes advantage of the Virtual 8086 mode of x86 processors to run DOS programs. However, since the virtual 86 mode no longer works if the processor has already been switched to the 64-bit long mode , NTVDM is no longer supplied with 64-bit versions of Windows. The DOSEMU virtual DOS environment developed for Linux shares this fate. Alternatives to NTVDM (as well as DOSEMU) are either emulators, virtual machines or interpreters.

With the help of an emulator , in which an entire PC including the processor is simulated in software, DOS programs can be executed not only on Windows, but also on a variety of other operating systems and computer architectures . One example of this is Bochs , but virtual machines such as QEMU , Virtual PC , VirtualBox and VMware can also be used to virtualize or emulate DOS. Because a complete PC is emulated or virtualized, a DOS operating system must first be installed in the virtualized environment. FreeDOS is under the GPL and is therefore freely available (open source and free of charge), but an existing or purchased MS-DOS or a compatible operating system can also be used. DOS drivers are also required so that certain functions such as audio output can be used. Because emulation is also very complex, an emulated DOS usually runs a lot slower than the native operating system. In the case of virtualization, parts of the emulated hardware are also executed natively, which has a speed advantage.

An alternative to NTVDM, which is less complex for the user, is an interpreter, such as B. DOSBox , because there is no need to install a compatible DOS operating system. In addition, DOSBox offers a multitude of other options for controlling the environment in which a DOS program runs, and it does not require any drivers for emulated hardware. DOSBox emulates an Intel processor ( i386 , i486 or Pentium ) on non-x86 hardware , but virtualizes most x86 instructions when it runs on an x86 processor. Components such as the sound card, however, are emulated in both cases. A driver is not necessary because its functions are also provided by the virtual DOS environment.

See also

literature

  • Andrew S. Tanenbaum, Modern Operating Systems , Pearson Studium Verlag 2003, ISBN 3-8273-7019-1

Individual evidence

  1. http://support.amd.com/TechDocs/24593.pdf "AMD64 Architecture Programmer's Manual - Volume 2: System Programming", page 11 ff.