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 new PC processors of the time 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. Almost all modern 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).
DPMI allows a program to run in protected mode on 80286 series and later processors and make calls back to the operating system running in Real Mode. For example, a 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 10 operating system (32-bit editions only) for backwards compatibility reasons (although unofficially deprecated).
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 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.
The first DPMI specification drafts were published in 1989 by Microsoft's Ralph Lipe. While based on a prototypical version of DPMI for Windows 3.0 in 386 enhanced mode, several features of this implemention were removed from the official specification, including a feature named DOS API translation that had still been proposed by Ralph Lipe in the original drafts. DPMI version 0.9 was published in 1990 by the newly formed DPMI Committee. The version number 0.9 of the resulting specification was chosen to reflect the stripped down nature and incomplete status of the standard the members of the DPMI Committee could agree upon. While Windows reports DPMI version 0.9 for compatibility, it actually implements the other parts as well, since they present a vital part of the system. This undocumented full nature of DPMI has become known as "true DPMI" in the industry. The DPMI standard was not the only effort to overcome the shortcomings of the VCPI specification. At the same time that Microsoft developed DPMI for Windows 3.0, another industry alliance including Intel's Software Focus Group, Lotus, Digital Research, Interactive Systems and others developed a specification named Extended VCPI (XVCPI) to make the memory management and multitasking capabilities of the 386 available for extended DOS applications. When it turned out that Microsoft's DPMI proposal addressed a number of similar issues and was supported by Windows, these efforts led to the creation of the DPMI Committee in February 1990 during a meeting at Intel in Santa Clara.
In 1991, the DPMI Committee revised DPMI to version 1.0 in order to incorporate a number of clarifications and extensions, but it still did not include the missing "true DPMI" bits implemented in Windows. In fact, "true DPMI" never became part of the official DPMI specification, and Windows likewise never implemented the DPMI 1.0 extensions.
While DPMI is tailored to run extended DOS application software in protected mode and extended memory, it is not particularly well suited for resident system extensions. Another specification named DPMS, developed by Digital Research / Novell around 1992, 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. This is also supported by Helix Cloaking.
The DPMI "method" is specific to 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.
While Windows 3.0 implements "true DPMI" and reports support for DPMI 0.9, 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 KRNL386.SYS of DR DOS "StarTrek" and the EMM386.EXE memory managers of Novell DOS 7, Caldera OpenDOS and DR-DOS 7.02 and higher have built-in support for DPMI when loaded with the
/DPMI[=ON] option. Multiuser DOS, System Manager and REAL/32 support DPMI as well.
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.
The DPMI 1.0 Committee met between 1990 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 (DOS|286, DOS|386, TNT)
- Phoenix Technologies (Phoenix BIOS, PMate, PForCe, Plink-86)
- Quarterdeck Office Systems (QEMM, DESQview, DESQview/X)
- Rational Systems/Tenberry Software (DOS/16M, DOS/4G, DOS/4GW DOS extenders)
- Virtual Control Program Interface (VCPI)
- DOS Protected Mode Services (DPMS)
- Helix Cloaking
- Multiuser DOS Federation
- Duncan, Ray (1991-02-12). "Power Programming - An Introduction to the DOS Protected Mode Interface". PC Magazine: 367–371. Retrieved 2016-05-21.
- Duncan, Ray; Petzold, Charles; Schulman, Andrew; Baker, M. Steven; Nelson, Ross P.; Davis, Stephen R.; Moote, Robert (1992). Extending DOS: A Programmer's Guide to Protected-Mode DOS. 2 (2nd ed.). Addison-Wesley Publishing Company, Inc. pp. 433–436. ISBN 0-201-56798-9.
- Schmit, Michael L. (1995). Pentium Processor Optimization Tools (1 ed.). Cambridge, MA, USA: Academic Press, Inc. (AP Professional). ISBN 0-12-627230-1.
- Microsoft (Fall 1989), DOS Protected Mode Interface Specification, Revision Prerelease 0.04 (Prerelease ed.)
- Microsoft (1990-10-31). Sokolov, Michael, ed. "MS-DOS API EXTENSIONS FOR DPMI HOSTS Version Pre-Release 0.02" (Annotated retyped preliminary ed.) (published 1999-04-08). Retrieved 2016-05-23.
- Microsoft (1999-04-08) . Sokolov, Michael, ed. "DOS PROTECTED MODE INTERFACE (DPMI) - SPECIFICATION Protected Mode API For DOS Extended Applications" (Annotated incompletely reconstructed ed.). Retrieved 2016-05-23.
- Wurthmann, Gerold; Wopperer, Bernhard; Wiesböck, Johann (1991). "Die DPMI-Spezifikation - Eine Einführung" [An introduction to the DPMI specification]. Vorträge und Begleittexte zum 2. Entwicklerforum: PC-Architektur, 17. September 1991, München [Presentations and supplemental material for the second developer forum on PC architecture on 17 September 1991, Munich] (book) (in German) (1st ed.). Munich, Germany: Markt & Technik Verlag Aktiengesellschaft. p. 223.
- The DPMI Committee (1991-03-12). DOS Protected Mode Interface (DPMI) Specification - Version 1.0 - Application Program Interface (API) for Protected Mode DOS Applications (PDF) (PDF). 1.0. Intel. pp. 4–5. Intel order code 240977-001. Archived from the original (PDF) on 2013-05-31. Retrieved 2013-05-24.
The initial DPMI prototype was developed by Microsoft for Windows version 3.0, with input from Lotus Corporation and Rational Systems, as part of a general effort to enhance Windows' performance by allowing the Windows kernel to run in extended memory. In parallel, Intel was working with manufacturers of multitasking environments, EMS emulators, and DOS extenders to ensure that an extended VCPI specification could fully utilize the 80386's virtualitation and protection features. In February 1990, the parties involved in the above activities agreed to form the DPMI Committee and formulate an industry-wide standard for protected-mode DOS applications. The Committee released the first public DPMI Specification, Version 0.9 in May 1990.
- "FILE: Windows Int 21h and NetBIOS Support for DPMI (MS KB65128)". Knowledge Base. Microsoft. 2004-08-04. Retrieved 2016-05-21.
- An Introduction To The DOS Protected Mode Interface - White Paper. Intel. 1993. Intel order code 240787-003. (22 pages)
- DOS Protected Mode Interface (DPMI) Specification - Protected Mode API For DOS Extended Applications - Version 0.9. Intel. 1990-07-26. Archived from the original on 2012-04-25. (112 pages)
- The DPMI Committee (1991-03-12). DOS Protected Mode Interface (DPMI) Specification - Version 1.0 - Application Program Interface (API) for Protected Mode DOS Applications (PDF). Intel. Intel order code 240977-001. Archived from the original (PDF) on 2013-05-31. Retrieved 2013-05-31. (160 pages)
- Sokolov, Michael (1998-04-26). "Some history on DPMI". Archived from the original on 2016-05-22.  
- "DOS Protected Mode Interface (DPMI) Specification - Protected Mode API For DOS Extended Applications - Version 0.9" (HTML converted ed.). Tenberry Software, Inc. 1998 [1990-07-26]. Archived from the original on 2016-05-21.
- "DPMI 1.0 Programming API Specfication" (HTML converted ed.). DJ Delorie. April 1996 . Archived from the original on 2016-05-21.
- Sandmann, Charles W. "CWSDPMI". Archived from the original on 2015-11-16.
- Japheth. "HX DOS Extender". Archived from the original on 2014-10-13.
- Smith, Bob. "DPMIONE Documentation File Version 0.91". Archived from the original on 2016-05-21.