MS-DOS Extenders Used in Microsoft Development ToolsID: Q123667
|
A number of Microsoft compilers, assemblers, and linkers use a DOS extender to gain access to memory beyond conventional memory. The LINK.EXE, BSCNAME.EXE, and CV.EXE programs that ship with Microsoft C/C++ version 7.0 and MASM version 6.1 have a built-in 16-bit DOS extender that can work with DPMI, VCPI, and XMS memory. The compiler that comes with Microsoft C/C++ version 7.0 uses a 32-bit DOS extender that only works with DPMI memory. Other compilers, assemblers, and utilities use a 32-bit DOS extender that will work with DPMI, VCPI, and XMS memory. This article describes these DOS extenders and memory managers.
When a DOS extender accesses memory, it goes through an extended memory
manager to ask for extended memory. This prevents the DOS extender from
conflicting with another program that is using extended memory.
Windows and OS/2 version 2.0 have extended memory managers built into their
virtual machines (VM). If you are not using Windows or OS/2 version 2.0,
you can use extended memory managers such as HIMEM, EMM386, 386MAX, and
QEMM. These memory managers provide three different types of extended
memory. The three types are: XMS (provided by HIMEM), VCPI (provided by
EMM386 and older versions of 386MAX and QEMM), and DPMI (provided by
everything else).
You can have your 16-bit program run in conventional memory and access data
in extended memory through the memory manager, but this is tedious because
the memory has to be swapped back and forth between conventional and
extended memory, and only data can be stored in the extended memory. In
addition, the program has to be written to do this swapping of conventional
and extended memory. You can picture a program that uses extended memory,
but does not use a DOS extender, to work like this:
-------------
| program |
-------------
V V
-------- ----------------
| MS-DOS | | memory manager |
-------- ----------------
NOTE: The program accesses MS-DOS and the memory manager directly,
but the program doesn't run in extended memory.
-------------
| program |
-------------
V
-------------------
| MS-DOS extender |
-------------------
V V
-------- ----------------
| MS-DOS | | memory manager |
-------- ----------------
NOTE: The program goes through the DOS extender for everything,
and the program runs in extended memory.
-------------
| program |
-------------
V
--------------------------
| DOSX16 |
--------------------------
V V
V <<< ------
V V | DPMI |
V <<-------- ------
V V | VCPI |
-------- ----- ------
| MS-DOS | | XMS |
-------- -----
The C/C++ version 7.0 compiler uses a 32-bit DOS extender that it loads
from MS32KRNL.DLL. This MS-DOS extender is referred to as DOSX32. Because
32-bit programs can't run on MS-DOS directly, you have to load the MS-DOS
extender to run the compiler. The DOSX32 DOS extender will only work
with a DPMI memory manager, so you have to load a DPMI memory manager. You
could picture the interaction between the program, DOSX32, memory manager,
and MS-DOS like this:
-------------
| program |
-------------
V
---------------------
| DOSX32 |
---------------------
V V
-------- ------
| MS-DOS | | DPMI |
-------- ------
The compilers included with Visual C++ for Windows and Fortran
Powerstation, the assemblers included with MASM version 6.1 and later, and
some of the other utilities in these products use a 32-bit DOS extender
that it loads from DOSXNT.EXE. This DOS extender is referred to as DOSXNT.
Because 32-bit programs can't run on MS-DOS directly, you have to load the
DOS extender to run the assembler. Unlike DOSX32, the DOSXNT DOS extender
will work with a DPMI, VCPI, or XMS memory manager. Also unlike DOSX16, in
cases where a VCPI memory manager is present but there is no page frame
available, DOSXNT is still capable of accessing extended memory. You could
picture the interaction between the program, DOSXNT, memory manager, and MS-
DOS like this:
-------------
| program |
-------------
V
-------------------------
| DOSXNT |
-------------------------
V V
V <<< ------
V V | DPMI |
V <<-------------
V V | VCPI |
-------- ------------
| MS-DOS | | XMS |
-------- -----
Additional query words: kbinf 6.00 6.10 7.00 6.11 1.00 1.00a 1.50
Keywords : kb16bitonly
Version :
Platform :
Issue type :
Last Reviewed: July 29, 1999