Virtual DOS Environments
Many DPMI implementations are simulated "virtual DOS"
sessions. In other words, the DOS interface and environment
presented to the program are not actually the native
interface of the operating system. Hardware interrupts,
I/O, and processor exceptions will be virtualized by the
operating system. This means, for example, that a DPMI
program may receive a simulated keyboard interrupt and read
simulated I/O from the keyboard controller ports.
In these environments, actual hardware interrupts will be
handled by the operating system. The physical interrupts
will be invisible to the DPMI application program. If the
operating system so chooses, it may reflect a virtual
interrupt to the DPMI program. The DPMI program does not
need to know, nor should it care, if this is the case. From
the program's point of view, the interrupt looks exactly
like a "real" interrupt. The operating system will also
virtualize I/O to the interrupt controller ports and any
other simulated devices.
There are basically three levels of virtualization that DPMI
implementations can provide:
No Virtualization
In general, stand-alone single tasking DPMI implementations
will not virtualize any hardware devices. These hose
extension programs will execute as standard DOS real mode
drivers or programs. Extenders which use the services
provided by these DPMI host drivers will translate protected
mode DOS calls to real mode DOS calls. Normally these
extenders will invoke DPMI services to return the processor
to real mode (instead of virtual 8086 mode) when calling
DOS.
Partial Virtualization
Some environments that execute under DOS will virtualize
hardware devices, provide virtual memory, or provide other
services that require virtualization of some hardware
devices. Under these environments, DPMI applications will
always run at a non-privileged ring (usually ring 3). Some
or all hardware interrupts will be virtualized, some or all
I/O will be virtualized, and virtual memory may be
supported. Under these implementations, page locking
services usually must be used to lock interrupt and
exception handling code.
Complete Virtualization
These environments provide a completely simulated DOS
environment. The native operating system is something other
than MS-DOS. Under these implementations of DPMI, all
devices will be virtualized to some extent. Normally, page
locking services will be ignored by these implementations
since all physical device interrupt and I/O handling will be
performed by the operating system. Programs will always run
at a non-privileged ring.