     MS-DOS (6.xx/7.00) UPPER MEMORY MAPPING + REGIONS (EMM386.EXE v4.45/4.95)

                        (Courtesy of Mr. Dale F. Ogden)


This is Mr. Dale F. Ogden's detailed answer to my questions about MS-DOS upper
memory regions management and upper memory mapping. Here it goes:

Greetings:

Beyond the first 640K of conventional memory (0000h-9FFFh), in the Upper Memory
areas, there are various types of information stored in ROM BIOS that depend upon
the type of installed hardware. There are also areas reserved by the system for
specific purposes:
- A000 to AFFF: VGA graphics.
- B000 to B7FF: monochrome text (this region is usually available for loading TSRs
and drivers "high" into UMBs).
- B800 to BFFF: VGA Text.
- C000 to C7FF: accelerated video cards.
- C800 to EFFF: much of this region is available to create the page frame for EMS
memory or to load TSR programs and drivers. Somewhere in that region there will be
ROM for the hard drives and likely for other hardware, too.
- F000 to FFFF: usually cluttered with ROM (the floppies use this area) and most is
not available for loading stuff; however, some of this area may be available.
- the first 64K beyond 1MB (from 10000 to 10FFF) is referred to as the high memory
area (HMA) that is addressable within by DOS as a result of the segmented memory
scheme used to allow a 16-bit processor to address more than 64 kilobytes of memory
(2^16=64K). Starting with MS-DOS 5.0, a large portion of the resident portion of
MS-DOS is stored in the HMA, including, in some cases, Microsoft mouse drivers.
- beyond that is extended memory which, since the '386, can be "mapped" to wherever
you want it to be.
Memory managers, like HIMEM.SYS, QEMM386, use command line parameters to load TSRs
and drivers into specific regions of upper memory. Those regions are defined not by
specific addresses, but by available regions. The region B000 to B7FF (32K) is the
first available region or UMB (upper memory block) on my system. From CB00 to DBFF
(68K) is the second available region and the EMS page frame is stored from DC00 to
EBFF (64K). Each system is likely to be somewhat different. 
HiMem.Sys is the most conservative of all the memory managers in that it uses only
areas not needed by anything else. Third-party memory managers usually are more
agressive (but almost infinitely configurable) and recover memory used by ROMs that
might only be needed at BOOT. In addition, certain technologies developed by the
vendors of third-party memory managers (QEMM's "Stealth" and NetRoom's "Cloaking"),
allow upper memory to be used for multiple purposes, but of course, not at the same
time. The memory manager controls which functions has access to the memory at any
particular time and swaps the other information to extended (XMS) or expanded (EMS)
memory.
The regions are not defined by any particular addresses. When DOS loads something in
upper memory, it looks for available UMBs. Without a switch, it would load it into
the first available UMB. The switch causes it to load it in the designated available
UMB. The purpose of this is to efficiently use the memory. TSRs and Drivers usually
must be loaded into contiguous blocks of memory, so you want to load larger TSRs
into larger UMBs and smaller UMBs into smaller UMBs.
The actual addresses of those regions depend upon your system.
The utilities that come with QEMM (Manifest) and the other third-party utilities are
more useful than MSD and make it easier to analyze what is happening with memory.
The documentation that comes with QEMM is as good as any textbook in describing what
is going on with conventional and extended memory, UMBs, HMA, EMS, XMS, VCPI, and
QDPMI. There are also articles about optimizing memory usage in the Microsoft
Knowledge Base.
If your goal is to maximize conventional memory (you now have 623K which seems
adequate for almost any purpose, I've never seen anything need for more than 619K
to run, and 634K is the maximum possible with a VGA video card), invest in QEMM,
but that seems a high price to pay for potentially only 11K of RAM.

Hope I've been helpful.

Dale F. Ogden