- DOS Protected Mode Interface
-
In computing, the DOS Protected Mode Interface (DPMI) 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. It was initially developed by Microsoft for Windows 3.0, although Microsoft later turned control of the specification over to an industry committee with open membership.[1] Almost all DOS extenders are based on DPMI and allow DOS programs to address all memory available in the PC and to run in protected mode (mostly in ring 3, least privileged).
Contents
Overview
DPMI allows a program to run in protected mode on the 80x86 series processors and make calls back to the operating system running in "unprotected" mode. For example, an MS-DOS program can "turn on" protected mode, but still make calls back to DOS for service (say, via the INT 21h standard DOS service interrupt). The most important reason for doing this is to allow protected mode programs to function under DOS, whose kernel used 16-bit real mode throughout its commercial life. Because MS-DOS (as a standalone operating system) was never updated for 32 bits, nor enabled 24- or 32-bit addressing, DPMI served as a "patch" to allow advanced protected mode programs to run on the stable MS-DOS platform. DPMI can be thought of as a "translator" that takes (for example) protected mode DOS calls and translates the registers to and from real and protected mode, including taking 16-bit segmented addresses and translating them to a suitable protected mode format.
DPMI also allows, for some time, 32-bit programs to run under Windows 3.x, since Windows itself was 16-bit. This capability remains today in a 32-bit Windows "DOS box" all the way to the Windows 7 operating system for backwards compatibility reasons (although unofficially deprecated).
Unfortunately, DPMI constitutes the only officially supported method to run protected mode DOS programs in most DOS-compatible multitasking operating systems. While Windows has long had native support for 32-bit programs, the many MS-DOS compatible systems that still exist must typically use DPMI to provide protected mode services or risk being incompatible. Systems such as FreeDOS still have a place in embedded systems programming, where their simplicity and their low implementation and resource costs, due to the abundance of API documentation and compiler tools, are important.
A DPMI service can be 16-bit, 32-bit, or "universal" and is called the DPMI kernel, DPMI host, or DPMI server. It is provided either by the host operating system (virtual DPMI host) or by a DOS extender (real DPMI host). The DPMI kernel can be part of a DOS extender such as in DOS/4GW or DOS/32A, or separate, like CWSDPMI or HDPMI.
History
The first DPMI specification drafts were published in 1989. Version 0.9 was published in 1990 by the DPMI Committee, and it was again extended in 1991 with version 1.0. An additional feature called "True DPMI" or "DOS API translation" was proposed by Ralph Lipe in the version 0.9 drafts, but never became part of the official specification (even not with 1.0); nevertheless, Windows implements this undocumented "True DPMI" nature. The official DPMI specification is available from Intel Literature Sales as well as online.
Note that the DPMI "method" is specific to MS-DOS and the IBM-PC. Other computer types were upgraded from 16-bit to 32-bit, and the advanced program support was provided by upgrading the operating system with a new 32 bit "API" and new memory management/addressing capabilities. For example, the OS/2 core system supports 32-bit programs, and can be run without the GUI. The DPMI solution appears to be mainly needed to address third party need to get DOS protected mode programs running stably on Windows 3.x before the dominant operating system vendor, Microsoft, could or would address the future of 32-bit Windows. In addition, Microsoft didn't see the answer to the 32-bit transition as a 32-bit DOS, but rather a 32-bit Windows with a completely different (and incompatible) API.
DPMI is tailored to run extended DOS application software in protected mode and extended memory, but it is not particularly well suited for resident system extensions. Another specification named DPMS specifically addresses requirements to easily relocate modified DOS driver software into extended memory and run them in protected mode, thereby reducing their conventional memory footprint downto small stubs.
Compatibility
While Windows 3.0 implements "true DPMI" and reports support for DPMI 0.9,[2] DPMI version 1.0 was never implemented in Microsoft Windows, so most programs and DOS extenders were mostly only written for version 0.9. Few extenders, however, implement "true DPMI".
The most famous separate DPMI kernel is probably CWSDPMI; it supports DPMI 0.9, but no undocumented "DOS API translation". Another variant called PMODE by "TRAN" aka Thomas Pytel was popular with 32-bit programmers during the demo scene of the 1990s. Many games used DOS/4GW, which was developed by Rational Systems as a subset of DOS/4G and was distributed with the Watcom C compiler.
HDPMI (part of HX DOS Extender) provides "DOS API translation" and almost complete DPMI 1.0 implementation.
Currently DPMIONE (formerly part of 386MAX) is the only standalone DPMI host which supports DPMI 1.0 completely (e.g. uncommitted memory).
DPMI Committee
The DPMI 1.0 Committee met between 1989 through 1991 and consisted of 12 groups:
- Borland International (Borland C, Turbo Pascal)
- IBM Corporation (PC-DOS, OS/2)
- AI Architects/Ergo Computer Solutions/Eclipse Computer Solutions/Ergo Computing (OS/286, OS/386 DOS extenders)
- Intelligent Graphics Corporation (VM/386 multi-user DOS)
- Intel Corporation (286, 386, 486 microprocessors)
- Locus Computing Corporation (Merge)
- Lotus Development Corporation (Lotus 1-2-3)
- Microsoft Corporation (MS-DOS, Microsoft Windows)
- Phar Lap Software (286|DOS, 386|DOS, TNT)
- Phoenix Technologies (Phoenix BIOS, PMate, PForCe, Plink-86)
- Quarterdeck Office Systems (QEMM, DesqView)
- Rational Systems/Tenberry Software (DOS/16M, DOS/4G, DOS/4GW DOS extenders)
See also
- Virtual Control Program Interface (VCPI)
- DOS Protected Mode Services (DPMS)
Notes
- ^ Duncan, Ray (1992). Extending DOS: A Programmer's Guide to Protected-Mode DOS (2nd ed. ed.). Addison-Wesley. pp. 433–436. ISBN 0-201-56798-9.
- ^ "FILE: Windows Int 21h and NetBIOS Support for DPMI (MSKB65128)". Knowledge Base. Microsoft. August 4, 2004. http://support.microsoft.com/kb/65128. Retrieved 2008-10-05.
References
- DPMI Committee (26 July 1990). DOS Protected Mode Interface (DPMI) Specification: Version 0.9.
- DPMI Committee (12 March 1991). DOS Protected Mode Interface (DPMI) Specification: Version 1.0PDF (269 KiB)
External links
- DPMI Specification provided by Delorie software
- DPMI Specification provided by Tenberry
- CWSDPMI download
- HX DOS-Extender containing HDPMI (HXRT.ZIP package)
- DPMIONE Documentation File
This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL.
Categories:- DOS memory management
- DOS extenders
Wikimedia Foundation. 2010.