DOS applications
can require large amounts of memory. Some programs will not function without at
least 580k or more conventional memory. This guide describes the tools and
techniques available to the Systems Administrator to maximize the memory available in REAL/32 for applications.
Memory
Areas
By far the most
critical part of conventional memory is the area above the 640k boundary and
below 1Mb. This is the Upper Memory
area. This area can be occupied by: the video card, plug-in hardware, drivers
and the System BIOS as well as the Operating System and can therefore get
overcrowded.
If there is not
enough room in the Upper Memory Area, drivers and parts of the Operating System
may overflow into the areas below 640k. The result of which is a reduction in
the Transient Program Area (TPA) i.e.
the amount of memory available for applications.
In order stop this
from happening it is necessary to optimize the Upper Memory area.
Figure 1
below, shows the layout and location of the Upper Memory Area in relation to the
memory used by DOS applications i.e.
the TPA.
Figure
1
Memory Layout
Monitoring
TPA
REAL/32 is supplied
with a number of tools to determine the amount of memory available to
applications.
MEM
This program can be
run from the command line to report the maximum TPA available. A typical mem
/a report looks something like this:
Banked
windows : 608k
Non-banked
windows : 2k E31F -> E3A5
End of TPA
: B000h
Total free memory
: 9560k
Dos
Free Memory : 592k
LIM emulation
: NO
DPMI/XMS memory
: 4096k
Ldt
Entries : 4096
Max Linear : 131072k
Windows mode
: Standard
Upper Memory Blocks:
0123
4567 89AB CDEF
-------------------
C000
AAAA AAAA AAAA AAAA
D000
AAAA AAAA DDAA
AAAA
E000
EEEE AAAA AAAA AAAA
F000
AAAA AAAA
ROM found at C000-C7FF
The significant
items in this example are DOS Free Memory,
End of TPA and Banked
Windows.
The DOS
Free Memory reports the memory available for a DOS program. If you have
loaded any TSR programs before running your application this provides a more
accurate reflection of the memory available than Banked
windows.
The Top
of TPA is the ceiling for DOS programs: the highest memory address the
application can access. This figure is reported in hexadecimal. Normally it
should be 0A000h on the main screen or graphics workstations. On dumb terminals
and mono screens it should be 0B000h.
On the main screen
and graphics workstations you can switch support for graphics off and on by
using the vga.exe command described
later.
The figure for Banked
Window is the maximum TPA available before TSRs are loaded. This is the
figure you are likely to need to maximize.
Monitor this figure if you reconfigure your system, or add more drivers or
hardware.
Analysing Upper Memory
MEM
/U
Using the /u
option with mem you can determine which of the upper memory blocks are available
for use as memory. A typical upper memory block report may be as follows:
Upper Memory Blocks:
0123
4567 89AB CDEF
-------------------
C000
AAAA AAAA AAAA AAAA
D000
AAAA AAAA DDAA
AAAA
E000
EEEE AAAA AAAA AAAA
F000
AAAA AAAA
Upper memory is
reported in a hexadecimal table format with each 4k block represented by either
an A, D or E.
A highlighted block
(bold in the example) may be used as
memory. A non-highlighted block may not be used as memory.
o
‘A’ represents a block which is set for Autoscan. This means the operating
system will do its best to determine whether a block may be used as memory.
‘A’s can be either highlighted or not depending on the outcome of the
Autoscan test.
In this example
blocks C000 to C7FF are set for non-highlighted ‘A’s. Autoscan has detected
a VGA card at this address.
o
‘D’ represents a block which is Disabled: not used as memory. By definition
no ‘D’ blocks will be highlighted.
In this example
memory blocks D800 and D900 are actually disabled designated by a ‘D’. Some
multiport cards such as the MAXpeed card can use upper memory blocks for their
own purposes. Systems with other memory mapped devices installed may also
require blocks to be disabled in this way.
o
‘E’ is a block set as Enabled for use as memory. ‘E’s will always be
highlighted. The example show blocks E000 to E3FF as highlighted ‘E’. This
memory area can therefore be accessed as memory.
‘D’ and ‘E’
are normally used to override the results of the Autoscan test, see below.
You can use the
REAL/32 setup to change the settings
of the upper memory blocks. This will be discussed later.
MEM
/E
Another
tool for analyzing
the useful blocks of upper memory usage is mem
/e. This option provides information
about the upper memory blocks which have not
been accessed by the system since boot up.
A
report from mem /e looks something
like this:
Upper
Memory Blocks:
0123 4567 89AB CDEF
-------------------
C000
AAAa aaaa AAAA AAAA
D000
AAAA AAAA DDAA
AAAA
E000
EEEE aaaa aaaa AAAa
F000
AAAA aaaa
Blocks
which have never been accessed are displayed by lower case letters.
Some
areas of upper memory are used by the system BIOS during the boot process. They
are never used once the computer is running. These areas are in effect
redundant.
REAL/32
keeps track of the access to all upper memory areas. Blocks which are never used are potential candidates for use
by the operating system.
By
using the upper memory block Enable option in setup you can override the Autoscan test and force the unused areas
to be used as memory. Enabling
memory blocks is discussed in more detail later in this chapter.
Warning.
Some memory blocks are only accessed occasionally. For instance if you rarely
access the system floppy drives, the BIOS area which the controls floppy
drives may be denoted by a lowercase “not-accessed” character in the mem
/e report. If you enable this area and subsequently access the floppy
drive the system may behave unpredictably. You are strongly advised to run and
use your system without a reboot
for a long period (a week or more) before enabling memory blocks denoted by a
lowercase (not-accessed) character.
Optimizing
Memory
Contiguous Upper Memory
You can use the
tools described above to analyze
how the memory is used in your machine. Armed with this information
it is possible to consider optimizing memory usage.
The rule of thumb
to follow when maximizing upper
memory is to achieve the largest blocks of contiguous
memory possible.
Taking the above mem
reports from the previous section as examples, note that the areas D800 and D900
are disabled denoted by a ‘D’. This area is probably used for a multiport
card. This area dissects two upper memory areas C800 - D7FF and DA00 - E3FF. A
more efficient use of memory would be to move the multiport card to a lower
address, say, C800. This would leave a contiguous area of usable memory from
CA00 through to E3FF:
Upper Memory Blocks:
0123
4567 89AB CDEF
-------------------
C000
AAAA AAAA DDAA AAAA
D000
AAAA AAAA AAAA AAAA
E000
EEEE AAAA AAAA AAAA
F000
AAAA AAAA
The potential for
moving blocks of memory around like this is dependent on the plug-in hardware.
Most multiport cards and network cards can be reconfigured to use different
memory addresses. Consult your hardware documentation for more information on
how to do this.
The example above
shows the ‘D’ blocks moving as well. This must be done using the REAL/32 setup.
The method is described in the following section.
Maximizing
Memory
This section
describes the systems administration options to maximize available memory.
64k
more for non-graphics applications
If you run mem
on a text terminal such as the Wyse 60/120 you will see a Top
of TPA reading as 0B000h. This is because terminals are not capable of VGA
graphics. Hence the 64k of memory normally used by a VGA card between 0A000h and
0B000h can be used by DOS text mode applications.
On a text terminal
you can get a maximum of 672k of TPA whilst on the main VGA screen or on a
MAXpeed graphics terminal you normally see only 608k.
Not all programs
will use graphics mode even if it is available. For this reason a utility called
vga.exe
is supplied with REAL/32 to switch off graphics mode on the main screen
or MAXStations thus freeing 64k of video memory for use by the application.
The syntax for this
utility is a follows:
VGA OFF
; Switch off graphics capability
VGA ON
; Switch on graphics capability
With VGA graphics
disabled a text mode only application will act as if it were running on a text
terminal. It will also receive the same amount of memory.
MCONFIG.SYS
Options
There are three
keywords supported during the mconfig.sys
processing which allow you to make best use of your memory.
o
HIDEVICE
This has the same
function as the device= keyword and
applies to loading device drivers such as imsnwdrv.sys.
Using HIDEVICE the driver will be loaded into upper memory rather than taking up
conventional memory. For example:
HIDEVICE=C:\REAL32\DRIVERS\IMSNWDRV.SYS
o
HIINSTALL
This has the same
function as the install= command. It
applies to loading Terminate and Stay Resident (TSR) programs such as keyb.com
into upper memory. For example:
HIINSTALL=C:\REAL32\BIN\keyb.uk
o
SIZE
Care must be
exercised when loading drivers and TSRs into upper memory with HIDEVICE and
HIINSTALL. The programs you are loading may increase their memory requirements
during execution. This can cause unpredictable side effects and may crash your
system.
One method of
avoiding this problem is to allocate enough memory for the driver or TSR before
it is loaded. You may do this using the size
keyword. For example:
HIINSTALL=SIZE=4000 C:\REAL32\BIN\TSR.COM
or
HIDEVICE=SIZE=4096 C:\REAL32\DRIVERS\DRIVER.SYS
The parameter
associated with size is the number of
bytes to allocate for a particular driver.
There is no easy
way of determining by how much a driver or TSR may grow during execution.
However, you may compare the TPA before and after loading the program using the
normal device or install keywords. The difference between the two will give you a
fair indication of the size parameter
required.
Using
REAL/32 SETUP to improve memory
The REAL/32 setup.exe
program gives a number of options to maximize TPA and use of upper memory.
o
Enable B100 for use as upper memory
This option can be
found on the first page of the Memory menu. It can only be used if you have a
VGA card. Enable this option and REAL/32 will use 28k of memory from B100h to B7FFh for part of the operating
system which would normally occupy upper memory. On systems where memory is
tight this extra memory may allow another driver to be placed in upper memory
using HIDEVICE or HIINSTALL thus improving TPA.
o
All upper memory blocks set to Autoscan
This option is
found on the first page of the Memory menu in setup.
Set this to YES, save the settings and reboot. During boot-up REAL/32 will then
scan all upper memory blocks for usable memory. This is the first step in
optimizing your memory. After you have done this it is possible to analyze
the upper memory usage before the optimizing process begins.
o Set All Blocks / Individual Blocks
It is possible to
set each 4k page of upper memory individually. To do this you should set the
option “All upper memory blocks to Autoscan” described above to NO then
accept current settings and continue. The next page allows you to set all of
upper memory to either Autoscan, Disabled, or Enabled. You are advised to use
the Autoscan option. You may alternatively change individual blocks by
progressing to the next screen which may look something like the example below:
Upper Memory
(768k-832k) is currently set as follows:
C000-C0FF [Autoscan]
(Disabled) C800-C8FF [...
C100-C1FF [Autoscan]
(Disabled) C900-C9FF [
C200-C2FF [Autoscan]
(Disabled) CA00-CAFF [
.
.
.
.
.
.
C700-C7FF [Autoscan]
(Disabled) CF00-CFFF [
[] Accept current
settings and continue
By using the arrow
keys and space bar it is possible to set each block for either Autoscan,
Disabled or Enabled. The setting in curved brackets () is the result of the
Autoscan test during last boot.
Network Stack Issues
The biggest cause of DOS memory loss is network stacks.
Single stack / Imsterm remote IPX server
If you just require one network stack to be loaded ( For the IMSTerm remote
IPX / Axel TCP terminal drivers then you can load the card drivers in a single
session and remove them from MCONFIG.SYS.
To-do this create a batch file which loads all of the appropriate components. This
batch file is STARTNW.BAT for starting the IMSTerm remote IPX driver.
C:\NWCLIENT\LSL.COM
C:\NWCLIENT\NE2000.COM
C:\NWCLIENT\IPXODI.COM
C:\REAL32\BIN\NWSTART.EXE
Then make a amendment to your autoexec.bat to run the server process/ Batch
file.
if "%1"=="1" STARTNW.BAT
The line above within AUTOEXEC.BAT will run the NWSTART process on the
first virtual console of the main screen.
Multiple stack / Imsterm remote IPX server
A safe method of moving network card driver code into upper memory is to use
the size command with HIINSTALL.
to HIINSTALL LSL within MCONFIG.SYS ( With a default installation ) :
HIINSTALL = SIZE = 8000 C:\NWCLIENT\LSL.COM
Note : If you are using SETUP.EXE before 7.91 you will have to re-edit
this line after using SETUP.EXE.