Lably
Skip to content

DOS Protected Mode Interface

DOS specification

  • 6 min read
  • 2 chapters

Related on Lably

Through Computing, DOS and Computer memory

Overview

DPMI stands for DOS Protected Mode Interface. It is an API that allows a program to run in protected mode on 80286 series and later processors, and do the calls to real mode without having to set up these CPU modes manually. DPMI also provides the functions for managing various resources, notably memory. This allows the DPMI-enabled programs to work in multi-tasking OSes, allowing an OS kernel to distribute such resources between multiple applications. DPMI provides only the functionality that needs to be implemented in supervisor mode. It can be thought of as a single-tasking microkernel. The rest of the functionality is available to DPMI-enabled programs via the calls to real-mode DOS and BIOS 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 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 a part of a DOS extender such as in DOS/4GW or DOS/32A, or separate, like CWSDPMI or HDPMI.

The primary use of DPMI API is to allow DOS 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 allows DOS-extended programs to run either in a multitasking OS that provides its own DPMI kernel, or directly under bare-metal DOS, in which case DOS extender uses its own DPMI kernel. Windows 3.x and 9x's user-mode kernels are built with a DOS extender, so they fully rely on a DPMI API that is provided by Windows's ring-0 kernel.

Sign in to keep reading

One more chapter is free with a Lably account.

More in Computing and communication