DOS Protected Mode Interface - Overview

Overview

DPMI allows a program to run in protected mode on 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.

Read more about this topic:  DOS Protected Mode Interface