## Virtual Device Driver Reference for OS/2

[prev][next][parent][TOC]

### Virtual DOS Protect-Mode Extender Device Driver

The virtual DOS protect-mode extender device driver (VDPX) provides address translation from protect mode to V86 mode for DOS protect-mode interface ( DPMI) applications. This translation is necessary because DPMI applications run in protect mode but issue interrupt requests, which can be handled in V86 mode, to perform various system services. When running in protect mode, the application is using selectors instead of segments. Therefore, any data buffers in the protect-mode memory address space (above 1MB) must be copied into a region of memory within the V86 address space.

The vdpx registers the DOS setting DPMI_DOS_API, which controls whether the VDPX is active or not. If the user selects:

Enabled The VDPX always translates the interrupts it supports from protect mode to V86 mode.

Auto The application must first issue the following INT 2Fh in protect mode to begin the translation:

         ENTRY     AX = 168Ah
                   DS:(E)SI points to the ASCIIZ
                      string "MS-DOS"
         EXIT      If VDPX fails initialization:
                      AL = 0x8A

Note: MS-DOS is a trademark of Microsoft Corporation.

Disabled The VDPX does not perform any address translation.

DPMI applications can provide their own translation services. Therefore, it might be unnecessary for the VDPX to perform any address translation.

The VDPX translates various interrupts from protect mode to V86 mode, including INT 10h, 15h, 21h, 25h, 26h, 2Ah, 33h, and 5Ch. The VDPX translates most of the commonly-used functions for these interrupts. After the virtual device driver translates the interrupt, the V86-mode interrupt service routine (or the virtual device driver, if it has hooked the interrupt) handles the interrupt request. After issuing the interrupt in V86 mode, the VDPX ensures that any data returned from the V86 service is copied into the data area originally passed in by the DPMI application. The registers and flags returned by the V86-mode handler (other than mode- sensitive registers such as segment registers) are returned to the DPMI application.