DPMI Services

The following is a brief outline of the DPMI services. For details regarding invocation of DPMI services from an application via INT 31h, please refer to the DPMI 0.9 Specification.

DPMI provides six main classes of services:

  • Local Descriptor Table management

  • Memory management

  • Page management

  • Interrupt management

  • Translation

  • Debug watchpoint.

    Each of these services is briefly described in the following sections.

    Note that DPMI services are normally never called by an application program itself, but are intended to be used by DOS extenders which request DPMI services on an application's behalf.

    LDT Descriptor Management Services

    The LDT descriptor management service provides interfaces for allocating, freeing, and creating protected mode descriptors in the current task's Local Descriptor Table (LDT). Access to the Global Descriptor Table is not provided, so that the DPMI server can protect itself from protected mode applications and isolate these applications from one another.

    DOS Memory Management Services

    The DOS memory management services provided an interface from protected mode applications to real mode INT 21h functions which are used to allocate, free and resize memory blocks. These services allow a protected mode applications to use memory below 640KB, to exchange data with DOS, ROM BIOS device drivers, TSRs and other real mode programs which are incapable of accessing data in extended memory.

    Extended Memory Management Services

    The extended memory management services are used to allocate, free and resize memory blocks above the 1MB boundary. If the DPMI server is an 80386 or 80486 control program and paging is enabled, the extended memory blocks are always allocated in units of 4KB.

    Page Management Services

    Under DPMI implementations which support virtual memory, applications may discard memory blocks or may not access them for long periods of time, in which case the memory block's contents may be swapped out to disk. In certain circumstances, such as interrupt handling code, this swapping must be disabled and the appropriate pages locked in physical memory. The page management services allow pages to be individually locked or unlocked.

    Interrupt Management Services

    These services allow protected mode applications to intercept real and protected mode interrupts and hook processor exceptions. Certain services allow a protected mode program to intercept hardware or software interrupts which occur in real mode or protected mode, or to install handlers for processor exceptions. Other interrupt services permit a process to enable or disable its own servicing or hardware interrupts without affecting the interrupt status of the entire system. DPMI accomplishes this by maintaining a virtual interrupt flag on a per-process basis.

    Translation Services

    The translation services permit control to be passed between operating modes. A protected mode program may transfer control to a real mode routine using a simulated far call or a simulated interrupt. Translation services also allow a protected mode program to declare a real mode callback, or entry point which can be invoked by the a real mode program.

    Debug Watchpoint Services

    The 80386 processor supports special registers that are used for debugging. Since the instructions to modify these registers can only be executed by code running at privilege level zero, protected mode debugging tools running in DPMI environments cannot modify the registers directly. These services provide mechanisms for setting and clearing debug watchpoints and detecting when a watchpoint has caused a fault.


    [Back: DPMI Hosts and Clients]
    [Next: DOS Extenders]