home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 12
/
CD_ASCQ_12_0294.iso
/
vrac
/
maxupper.zip
/
MAXUPPER.ART
< prev
Wrap
Text File
|
1994-01-02
|
14KB
|
236 lines
How to Get Maximum Upper Memory with MS-DOS Memory Management
-------------------------------------------------------------
by Lou A. Moccia
(PCA Lou of the DOS Forum on America Online)
12/10/93
The MS-DOS memory management system is good, but sometimes just not good
enough. Before running out to get a better memory management package like
Quarterdeck QEMM, Qualitas 386Max, or Helix NetRoom -- which can cost more
than a DOS upgrade itself -- this article will present ways to configure
the MS-DOS 5.0, 6.x, and Windows 3.1 EMM386.EXE memory manager to help you
get the most Upper memory possible. In most cases, those who are currently
unable to load everything they need into Upper memory on 386 or better
computers will benefit greatly from this information.
Unfortunately, MS-DOS doesn't provide memory management for 286 or lower
computers, other than Extended (XMS) memory services via the HIMEM.SYS
driver (and in most cases, it only works for a system with more than 1 meg
of memory installed). There's not much you can do on a 286 without the use
of Upper memory, which is where you could load device drivers and TSRs
high, out of conventional memory. There is hope, though! A few good
shareware Upper memory managers that support a lot of 286 systems do exist,
the best being LastByte, MemKit, UMB_DRVR, and UMM (all of which are
available online). Popular commercial offerings that support some 286
systems include Quarterdeck QRAM, Qualitas MOVE'EM, and Helix NetRoom.
If the following information doesn't help you load everything you need into
Upper memory, or one of the EMM386 configuration settings does not work on
your computer, then your only options are the following: Invest in another
memory management package (mentioned above); load only the device drivers
and TSRs that you absolutely need; or live with the reduced conventional
memory, but use a multi-config setup for running those huge applications or
games.
Now on with the show... The MS-DOS memory management system consists of
three parts:
First is the HIMEM.SYS device driver. HIMEM.SYS provides access to the
computer's Extended memory, which is that above 1 meg. HIMEM.SYS makes the
physical Extended memory accessible as XMS memory to programs that are
designed to take advantage of it. (XMS is short for "eXtended Memory
Specification"; XMS memory and Extended memory generally refer to the same
thing these days, but they are technically different.) HIMEM.SYS also
creates the High Memory Area (HMA) from the first 64K of Extended memory,
which DOS can use for loading its own kernel into and free up close to 50K
of conventional memory (which is that below 640K and being the most
important to programs). For the HMA to be available on most systems, there
must be at least 64K of Extended memory above 1 meg in the computer;
computers with only 1 meg of total system memory usually will not be able
to take advantage of loading DOS into the HMA.
Second is the EMM386.EXE device driver, which provides access to Upper
memory and/or Expanded (EMS) memory. Upper memory is what EMM386.EXE
creates from the areas of Reserved memory between 640K and 1 meg that are
not occupied by any ROM BIOS. Expanded (or EMS, short for "Expanded Memory
Specification") memory is a special type of memory in a computer, a
standard for extra memory that came long before XMS. On 386 or better
systems, EMM386.EXE simulates EMS memory from the XMS memory provided by
HIMEM.SYS. That's one reason why EMM386.EXE requires that HIMEM.SYS be
loaded first in CONFIG.SYS to work.
Third is the line DOS=HIGH,UMB in CONFIG.SYS. The UMB part is necessary
for DOS to be able to access the Upper memory provided by EMM386.EXE. The
HIGH part isn't really required, but it does perform a very important
function in that it frees up close to 50K of conventional memory by moving
the DOS kernel into the HMA created by HIMEM.SYS -- Its use is highly
recommended! Note that you can have separate DOS=HIGH and DOS=UMB lines if
you want (something MS-DOS 6 MemMaker likes to do), but combining them as
DOS=HIGH,UMB is a bit more tidy and it is one less line for DOS to process
at bootup.
So, lines similar to the following must exist in CONFIG.SYS for DOS to
manage the memory in the computer:
DOS=HIGH,UMB
DEVICE=HIMEM.SYS
DEVICE=EMM386.EXE
HIMEM.SYS must be the first of any DEVICE lines to load in CONFIG.SYS, and
EMM386.EXE must always load directly after HIMEM.SYS (in normal setups).
By the way, it actually doesn't matter where lines like DOS=HIGH,UMB,
FILES, BUFFERS, etc. appear in CONFIG.SYS; the only order that matters to
DOS is that of DEVICE and DEVICEHIGH lines. Note that the path to
HIMEM.SYS and EMM386.EXE is not shown above, since that of course varies
per setup and depends on whether you're using MS-DOS 5.0, 6.x, or Windows
3.1. The MS-DOS 6.2 versions of HIMEM.SYS and EMM386.EXE are the newest,
the MS-DOS 6.0 versions are older, the Windows 3.1 versions are older
still, and the MS-DOS 5.0 versions are the oldest. Even if you have
Windows 3.1 installed, always use the newest versions of HIMEM.SYS and
EMM386.EXE since they contain fixes and enhancements over previous versions
and are meant to replace them.
Now EMM386.EXE must be specially configured to get what we want: Maximum
Upper memory. To do this, one of the following EMM386.EXE lines is to be
used:
1) For Upper memory only, no EMS memory support:
* MS-DOS 5.0, 6.x, or Windows 3.1:
DEVICE=EMM386.EXE NOEMS I=B000-B7FF I=C800-F7FF
* MS-DOS 6.x only alternative:
DEVICE=EMM386.EXE NOEMS I=B000-B7FF I=C800-EFFF HIGHSCAN
This EMM386.EXE line is used when you want Upper memory only, and don't
need EMS memory support for DOS programs, which is specified by the NOEMS
parameter. You gain an extra 64K of Upper memory for loading things high
when not using EMS memory support.
2) For both Upper memory and EMS memory support:
* MS-DOS 5.0 or Windows 3.1:
DEVICE=EMM386.EXE [memory] RAM FRAME=C800 I=B000-B7FF I=D800-F7FF
* MS-DOS 6.x only alternatives:
DEVICE=EMM386.EXE MIN=0 RAM FRAME=C800 I=B000-B7FF I=D800-F7FF
or
DEVICE=EMM386.EXE MIN=0 RAM FRAME=C800 I=B000-B7FF I=D800-EFFF HIGHSCAN
This EMM386.EXE line is used when you need both Upper memory and EMS memory
support for DOS programs, which is specified by the RAM parameter. With
the MS-DOS 5.0 or Windows 3.1 EMM386.EXE, you must specify a value for the
amount of EMS memory you wish to have available to DOS programs if you want
more than the default of 256K. With MS-DOS 6.x, a number no longer has to
be specified to set the amount of EMS memory, because its EMM386.EXE will
dynamically allocate as much EMS memory as a program requests, and then
release it back to XMS memory when the program is done. Using the MIN=0
parameter means to not permanently reserve any EMS memory from the XMS
memory pool (otherwise the default is 256K reserved), thereby making the
largest amount of XMS memory available when EMS is not actually in use.
(This is just like how Quarterdeck QEMM has been working all these years!)
The following explains the parameters common to both EMM386.EXE lines:
The I=B000-B7FF parameter tells EMM386.EXE to convert the area of Reserved
memory that is normally for a monochrome video adapter into Upper memory.
This is perfectly safe to do if you do not use monochrome, and gains 32K
more Upper memory. The only major problems this may cause are when using
special high-resolution video modes or monochrome emulation modes of
certain SuperVGA video adapters; and with Windows 3.1, depending on the
Windows video driver used. The video mode problem will vary greatly with
the ton of video cards out there, but it is quite rare. The Windows
problem can be solved by using the MONOUMB.386 driver available from
Microsoft or included with MS-DOS 6.x, which involves adding the line
DEVICE=MONOUMB.386 under the [386Enh] section of the SYSTEM.INI file in the
Windows directory (either copy the MONOUMB.386 file to the Windows System
directory, or supply the full path to the MONOUMB.386 on the DEVICE line).
The I=C800-F7FF parameter (or alternate I=C800-EFFF HIGHSCAN parameters for
MS-DOS 6.x only; HIGHSCAN is really the same as I=F000-F7FF) converts the
largest free area of Reserved memory normally empty on most systems (with
one hard disk controller, no special expansion cards, and that are not IBM
PS/2s) into Upper memory. If the RAM parameter is being used, then D800 is
used instead of C800 because of the 64K EMS Page Frame required in Upper
memory for EMS memory support. The EMS Page Frame is placed at the lowest
free area by the FRAME=C800 parameter so the largest free area of Upper
memory is created. Either of these settings is the most common, but it
will of course differ per system. Some things to note about this memory
range:
- Including the F000-F7FF area (or using HIGHSCAN with MS-DOS 6.x) converts
the first half of the System ROM BIOS into Upper memory. This gains an
extra 32K of Upper memory, but unfortunately it causes problems on quite a
few systems. For example, many system will exhibit erratic floppy drive
behavior or plain old system lockups at some point. In my experience, I've
found it necessary with a 1990 AMI BIOS to use F6FF instead of F7FF (or
HIGHSCAN) to avoid floppy drive problems in certain DOS programs and in
Windows; however, F7FF (and HIGHSCAN) works fine with a Pheonix BIOS on
another system I use. You will just have to test it out on your system.
Some less-compatible systems may not like Upper memory in the System ROM
BIOS area at all.
- Adapter cards like secondary IDE hard disk controllers and SCSI
controllers may use 8K or more for their own ROM starting at the C800
address.
- Network interface cards may place their RAM buffers in the D000-DFFF
area.
- IBM PS/2 computers use the E000-EFFF range for their Advanced BIOS. Some
computers (such as Epsons) use this range for the VGA BIOS instead of the
normal C000-C7FF range.
To avoid memory conflicts, your best bet would be to first examine the
Reserved memory area for the spaces that do not contain ROM. This way you
can see if multiple I= parameters must be used instead of one big range,
and what would be the best range for the 64K EMS Page Frame (if using EMS
memory support). Such a utility to do this is called MSD (Microsoft
Diagnostics) and comes with Windows 3.1, MS-DOS 6.x, and most other
Microsoft products. There is also a utility from PC Magazine called
UMASCAN that displays a nice map of the Reserved memory area.
There is one more trick for MS-DOS 6.x users. Using the EMM386.EXE
parameter NOHI will prevent EMM386.EXE from taking 4K of Reserved memory
for its own code. That 4K will then take away from free conventional
memory, however if you have a device driver or TSR that requires just a
couple more K to load resident in Upper memory, then that trade off is well
worth it. I had to do this myself in order to fit SHARE into Upper memory;
EMM386.EXE now takes up 4K more conventional memory, but the 17K SHARE
driver fits into Upper memory now.
After you have configured EMM386.EXE for maximum Upper memory, you should
optimize the loading order of your device drivers and TSRs so hopefully all
of them fit into Upper memory now.
The easiest way to do this with MS-DOS 6.x is to run MemMaker in its Custom
mode, and then if necessary change the EMM386.EXE line back to the way you
configured it for maximum Upper memory. Since MemMaker puts a size value
(the /L parameter) on each device driver and TSR load line, you can easily
reorder them to load the ones with the largest size values first since they
require the most free Upper memory to initialize in before going resident.
Usually MemMaker does this reordering for you, but not always for the best.
If you are not using MS-DOS 6.x, then optimizing the loading order of your
device drivers and TSRs is a more involved trial-and-error deal. You first
have to check memory usage with the MEM /C command and note what device
driver or TSR is not loading into Upper memory. Then move the line that
loads that device driver or TSR higher up in CONFIG.SYS or AUTOEXEC.BAT.
Reboot and check with MEM /C again. Keep trying if necessary until you
hopefully get everything to load into Upper memory. Remember that no other
device driver should be loaded before HIMEM.SYS and EMM386.EXE in
CONFIG.SYS (in normal setups).
If you use a certain device driver or TSR that must load after another one
to work properly, then you can't always optimize the loading order of them.
An example of this is the new SmartDrive 5.0 included with MS-DOS 6.2,
which can now cache a CD-ROM drive. In order to cache a CD-ROM drive,
SmartDrive must be loaded after the MSCDEX.EXE driver. Since MSCDEX.EXE
must be loaded first, and most load it into Upper memory, SmartDrive may
not be able to completely fit into Upper memory anymore (depending on what
else has been loaded into Upper memory already).
Hopefully the information discussed here will help you load everything you
need to load into Upper memory, without having to spend more on a third-
party memory management package!