Files
2024-02-19 00:25:23 -05:00

112 lines
5.4 KiB
HTML

Programs that use DPMI services are called DPMI clients. Generally,
DPMI clients fall into one of two categories:<p>
<ul>
<li> DOS Extenders which use DPMI services as building blocks for a
more extensive interface that is exported to application programs running under their control;<p>
<li> Application programs that call DPMI directly.<p>
</ul>
In the near term, most client programs will need to be able to run in
several different environments, each providing a different interface
and range of services. It is recommended that clients test for the
existence of such environments in the following order:<p>
<ul>
<li> DOS Protected Mode Interface (DPMI)-compatible host;<p>
<li> Virtual Control Program Interface (VCPI)-compatible server;<p>
<li> eXtended Memory Specification (XMS)-compatible driver;<p>
<li> <i>Top-Down memory allocation</i> (See Appendix A: Glossary) or
bottom-up (VDISK-compatible) memory allocation.<p>
</ul>
Figure 2 on page 21 illustrates a typical DPMI client configuration,
consisting of a DOS Extender and a protected-mode application. The
application code relies on the DOS Extender functions and APIs. The
DOS Extender contains separate modules for each possible environment,
and code to implement those services that are lacking in a particular
environment. <p>
Existing DOS extenders support APIs that differ from the Int 31h
interface. Usually, DOS extenders use an Int 21h multiplex for their
extended APIs. Extenders that support DPMI will need to initialize
differently when they are run under DPMI environments. They will need
to enter protected mode using the DPMI real to protected mode entry
point, install their own API handlers, and then load the DOS extended
application program. <p>
<b>Figure 2.</b> An example of a DPMI client consisting of a DOS
Extender and a protected-mode application. The client should be able
to run in the presence of DPMI, VCPI, or XMS environments or in the
absence of all three.
<pre>
+----------------------------------------------------------+
| |
| +----------------------------------------------------+ |
| | | |
| | Application Code | |
| | | |
| +----------------------------------------------------+ |
| |
| +----------------------------------------------------+ |
| | Extender Base (including APIs) | |
| | -------------------------------------------------- | |
| | DPMI | |
| | client | |
| +------------+ | |
| | VCPI | |
| | client | |
| +------------+ | |
| | XMS | |
| | client | |
| +------------+ | |
| | Top-down | |
| | client | |
| +-------------+ |
| |
+----------------------------------------------------------+
+------------+
| |
| |
| |------------+
| | |
| DPMI | |
| host | VCPI |------------+
| | | |
| | | |
| |------------| XMS |-------------+
| | EMS | | Top-down |
| | | | (Int 15h) |
+----------------------------------------------------+
+----------------------------------------------------+
| |
| Operating System (e.g. DOS) |
| |
+----------------------------------------------------+
</pre>
<hr>
<img src="/icons/menu.sm.gif"><a href="ch4.1.html">Client Initialization</a><br>
<img src="/icons/menu.sm.gif"><a href="ch4.2.html">Client Termination</a><br>
<img src="/icons/menu.sm.gif"><a href="ch4.3.html">Stacks and Mode Switching</a><br>
<img src="/icons/menu.sm.gif"><a href="ch4.4.html">Handling Interrupts</a><br>
<img src="/icons/menu.sm.gif"><a href="ch4.5.html">Handling CPU Exceptions</a><br>
<img src="/icons/menu.sm.gif"><a href="ch4.6.html">Using Real-Mode Callbacks</a><br>
<img src="/icons/menu.sm.gif"><a href="ch4.7.html">Using Shared Memory</a><br>
<img src="/icons/menu.sm.gif"><a href="ch4.8.html">Writing Resident Service Providers</a><br>