| DOS Protected Mode Interface | |
|---|---|
| Abbreviation | DPMI |
| Status | Published |
| Year started | 1989; 37 years ago (1989) |
| Organization | DPMI Committee |
| Domain | Application programming interfaces |
Incomputing, theDOS Protected Mode Interface (DPMI) is a specification introduced in 1989 which allows aDOS program to run inprotected mode, giving access to many features of the new PC processors of the time not available inreal mode. It was initially developed byMicrosoft forWindows 3.0, although Microsoft later turned control of the specification over to an industry committee with open membership.[1][2] Almost all modernDOS extenders are based on DPMI and allow DOS programs to address all memory available in the PC and to run in protected mode (mostly inring 3, least privileged).[3]
DPMI stands for DOS Protected Mode Interface.It is anAPI that allows a program to run inprotected mode on 80286 series and later processors, and do thecalls toreal mode without having to set up these CPU modes manually. DPMI also provides the functions for managingvarious resources, notablymemory. This allows the DPMI-enabled programs to work inmulti-tasking OSes,allowing an OS kernel to distribute such resources between multiple applications. DPMI provides only the functionality thatneeds to be implemented insupervisor mode. It can bethought of as a single-taskingmicrokernel. The rest of the functionality is available to DPMI-enabled programsvia the calls to real-modeDOS andBIOS services, allowing the DPMI API itself to remain mostly independent of DOS.Things that make DPMI API DOS-specific, are just 3 functions for managing DOS memory, and the letter "D" in the "DPMI" acronym.
A DPMI service can be 16-bit, 32-bit, or "universal" and is called theDPMI kernel,DPMI host, orDPMI server. It is provided either by the host operating system (virtual DPMI host) or by aDOS extender (real DPMI host). The DPMI kernel can be a part of a DOS extender such as inDOS/4GW orDOS/32A, or separate, likeCWSDPMI orHDPMI.
The primary use of DPMI API is to allowDOS extenders to provide the host-OS-agnostic environment.DOS extender checks the presence of a DPMI kernel, and installs its own only if the one was not installed already. This allowsDOS-extended programs to run either in a multitasking OS that provides its own DPMI kernel, or directlyunderbare-metal DOS, in which case DOS extender uses its own DPMI kernel. Windows 3.x and 9x'suser-modekernels are built with a DOS extender, so they fully rely on a DPMI API that is provided by Windows's ring-0 kernel.
The first DPMI specification drafts were published in 1989 by Microsoft'sRalph Lipe.[4][1] While based on a prototypical version of DPMI forWindows 3.0 in 386 enhanced mode, several features of this implementation were removed from the official specification, including a feature namedMS-DOS Extensions[5] orDOS API translation that had been proposed by Ralph Lipe in the original drafts.[6] Most of it was implementing DOS and BIOS interfaces (due to this history some INT 21h APIs like 4Ch have to be implemented by all DPMI implementations). DPMI version 0.9 was published in 1990 by the newly formedDPMI 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.[1] 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.[5][1] This undocumented full nature of DPMI has become known as "true DPMI" in the industry.[7] The DPMI standard was not the only effort to overcome the shortcomings of theVCPI specification. At the same time that Microsoft developed DPMI for Windows 3.0, another industry alliance includingIntel's Software Focus Group,[8][1]Lotus,[8]Digital Research,Interactive Systems and others developed a specification namedExtended VCPI (XVCPI) to make the memory management and multitasking capabilities of the 386 available for extended DOS applications.[8][1][9]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.[8][1]
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 (and not many DPMI hosts did).
While DPMI is tailored to run extended DOS application software in protected mode and extended memory,[10] it is not particularly well suited for resident system extensions. Another specification namedDPMS,[10] developed byDigital 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 conventionalmemory footprint down to smallstubs. This is also supported byHelix 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-bitAPI and new memory management/addressing capabilities. For example, theOS/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"[5] and reports support for DPMI 0.9,[11] DPMI version 1.0 was never implemented inMicrosoft Windows, so most programs and DOS extenders were mostly only written for version 0.9. Few extenders, however, implement "true DPMI".
Beta versions ofQualitas386MAX implemented "true DPMI" and could run Windows' KRNL386.EXE from the command line, but it was claimed that was disabled in the released product in an internal email.[5] However, DPMIONE (by Bob Smith based on the 386MAX code) can do it. CurrentlyDPMIONE and386MAX is also the only DPMI host which supports DPMI 1.0 completely (e.g. uncommitted memory) and they are the main supporter of DPMI 1.0.[12]
The KRNL386.SYS (aka "MultiMAX") ofDR DOS "Panther" and"StarTrek", which has been under development since 1991,[nb 1] and theEMM386.EXE memory managers ofNovell DOS 7,[10]Caldera OpenDOS andDR-DOS 7.02 and higher have built-in support for DPMI when loaded with the/DPMI[=ON] option. KRNL386.SYS even had a command line option/VER=0.9|1.0 to provide support for either DPMI 1.0 or 0.9.[13] DOS API translation was referred to as "called interrupt 21 from protected mode".Multiuser DOS,System Manager andREAL/32 support DPMI as well.
The most famous separate DPMI kernel is probablyCWSDPMI; it supports DPMI 0.9, but no undocumented "DOS API translation".Another variant called PMODE by "TRAN" akaThomas Pytel was popular with 32-bit programmers during thedemo scene of the 1990s.Many games used DOS/4GW, which was developed byRational Systems as a subset ofDOS/4G and was distributed with theWatcom C compiler.
HDPMI (part ofHX 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:
[…] The creators of theVCPI were well aware of its limitations and were already hard at work on a second generation specification calledExtended VCPI (XVCPI), whenMicrosoft barged onto the scene with the beta-test versions ofWindows 3.0 and its DPMI. For a few months it appeared that the fledglingDOS extender market would fragment into two mutually exclusive directions […] Microsoft turned control of the DPMI specification over to an industry committee with open membership, and the backers of the XVCPI effort decided to join forces behind the DPMI. […] Microsoft agreed to delete the portions of the DPMI that crossed into DOS extender territory - specifically, direct support of the DOS andROM BIOS interrupts inprotected mode. Consequently, DPMI, Version 0.9, the first public version, released by the DPMI Committee in May 1990, defines only the low-level or building-block functions […] Naturally, the higher level or DOS extender interface of Windows 3.0 still exists, but it has receded into the twilight zone of undocumented functionality. Undocumented, but hardly unusable […]
[…] [Ralph Lipe:] I think, they're checked intoWin386 project. In the root MSDOS.DOC (look at all the .DOC files in the root) […] NO! This is an extremely sensitive matter since it basically tells […]ISVs (AKADR-DOS andIBM) how to run standard modeWindows. You need to clear it withBradSi[lverberg] before distributing it. [Greg Lowney:]SoftNet makes alimulator. They read in theC7 manual that you can run C7 dos-extended if your limulator supports the MS-DOS extensions to the DPMI specification. So […] they called us to get a spec on exactly what those extensions are. Apparently they are not documented. […] They are not that complicated, mostly just what MS-DOS and BIOS calls we map for the application, andQualitas had no trouble reverse engineering them. (The new386MAX was, in beta, able to run KRNL386 from the command line, but I believe they disabled that feature in their final product to avoid stepping on our feet. 386MAX does, of course, support C7.) […] Ralph, was the spec distributed to the members of the DPMI committee? […] [Dave Cole:] We should absolutely NOT document this. […]
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 virtualization 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.