
==============UPPER MEMORY BLOCK (UMB) SUPPORT================

WHAT IS A UMB ------------------------------------------------
Upper Memory Blocks (UMB's) are blocks of memory in the address space 
640K to 1Meg.  MS-DOS 5.0 supports creation and utilization of UMB's to 
load device drivers and TSR's above 640K on computers with 80386 and 
greater processors and at least 350K of available extended memory.

WHAT IS DESCRIBED IN THIS TEXT? ----------------------------------------

This text describes:

*       How to load device drivers and TSR's which ship with MS-DOS 5.0 
	into UMB's.
*       Optimizing UMB usage
*       Troubleshooting
*       Hints on how to load some networks into UMB's

ENABLING MS-DOS 5.0 UMB SUPPORT-----------------------------------------

NOTE:   As stated above, an 80386 or greater processor with at least 350K 
of available extended memory is required in order to use MS-DOS 
5.0 UMB support (although some 3-rd party utilities will allow you to utilize
UMB support on other systems; DOS can utilise the 3-rd party drivers so long
as the driver supports the XMS Allocate UMB call).  Also, the following text
assumes that you are not using a 3-rd party memory manager - If you are
using a 3-rd party memory manager, see the section entitled "Using MS-DOS 5.0
UMB's with 3-rd party memory managers" below.

To utilize MS-DOS 5.0 UMB support, the following steps are required:

1)  Assure you have sufficient XMS memory available to use UMB's.  Use
    the MEM command. If MEM doesn't report that you have at least 350K of
    available XMS memory, you will need to free some XMS memory. If you are
    using a RAMDRIVE or an EMS memory emulator, you can free some extended
    memory by reducing the amount of memory used by the RAM drive or memory
    manager.

    Also, note what size is reported by MEM for the largest executable
    program size.  You can use this information to see how much additional
    memory you get after enabling UMB support.

2)  Create a MS-DOS boot disk and save copies of your AUTOEXEC.BAT and
    CONFIG.SYS:

		a) Insert a disk in drive A: 
		b) If the disk is not already formatted,
			FORMAT A: /S
		   If the disk is already formatted:
			SYS A:
                c) Copy C:\CONFIG.SYS C:\CONFIG.SAV
                d) Copy C:\AUTOEXEC.SYS C:\AUTOEXEC.SAV

3)  Assure that HIMEM.SYS is installed (eg check that there is a
    DEVICE= line in the CONFIG.SYS which specifies HIMEM.SYS).  Note that if
    there is not a line the config.sys which says DOS=HIGH, you can achieve
    more memory savings by adding the line DOS=HIGH to the config. sys.  This
    will cause most of MS-DOS to load into the High Memory Area immediately
    above 1Meg.

4)  Instruct MS-DOS to enable UMB support by adding the line DOS=UMB to the
    CONFIG.SYS (DOS=HIGH,UMB or DOS=LOW,UMB will also work).

5)  Load the UMB provider (EMM386.EXE).

    If you are already using EMM386.EXE (eg if there is a line DEVICE= which
    specifies EMM386.EXE in your CONFIG.SYS):

        You probably have applications which utilize the LIM memory provided
        by EMM386.  In this case, you need to instruct EMM386 to support both
        UMB's and LIM memory by adding the word RAM to the DEVICE= line.  For
        example, if the line to load EMM386.EXE is:

		DEVICE=C:\DOS\EMM386.EXE 1024

		You would change the line to be:

		DEVICE=C:\DOS\EMM386.EXE 1024 RAM

    If you are NOT already using EMM386.EXE:

        You need to add a line to the CONFIG.SYS, immediately after  HIMEM.
        SYS, to install EMM386.  Since you do not need the LIM features of
        EMM386, you can get more upper memory blocks by specifying the NOEMS
        option.  Assuming that the MS-DOS 5.0 EMM386.EXE file is in C:\DOS,
        then you need to add the line:

	DEVICE=C:\DOS\EMM386.EXE NOEMS

	to your CONFIG.SYS.

NOTE:   If you are using a PS/2 with a Token Ring network, you will need
        to instruct EMM386.EXE to exclude some portions of memory from  being
        used as UMB's.  See the NETWORKS.TXT file for more details.  Future
        versions of EMM386 will avoid these problems automatically.


6)  For each of the device drivers (loaded in your CONFIG.SYS with a
    DEVICE= line), which is safe to load into a UMB (see below), do the
    following:

	a)      Assure that the DEVICE= line is after the DEVICE= line for 
                EMM386.EXE
	b)      Change the DEVICE= line which is used to load the following 
                device drivers to be DEVICEHIGH= in the config.sys.

    The following device drivers which are shipped with MS-DOS 5.0 are safe
    to load into UMB's:

	EGA.SYS DISPLAY.SYS     ANSI.SYS
	RAMDRIVE.SYS    SMARTDRV.SYS    DRIVER.SYS
	PRINTER.SYS

7)  For each TSR which is loaded in your AUTOEXEC.BAT and is safe to
    load into a UMB, add the word LOADHIGH before the TSR.  For example, if
    you have:

		c:\dos\doskey

    Change it to:

		LOADHIGH c:\dos\doskey

    You can use LH instead of LOADHIGH if you prefer (they are equivalent).
    The following TSR's which ship with MS-DOS 5.0 are safe to load high:

              DOSKEY.COM      DOSSHELL.COM    KEYB.COM
              GRAPHICS.COM    NLSFUNC.EXE     MODE.COM
              SHARE.EXE       PRINT.EXE       APPEND.EXE


8)  Reboot your computer (press the CTRL-ALT-DEL keys all at the same time).

    Watch the display as your computer is rebooting and assure that there are
    no messages saying something failed or could not be loaded.  If things do
    not appear to work correctly (eg strange error messages or system hangs),
    see the "TROUBLESHOOOTING" Section below.  Note that problems may become
    apparent after sytem startup is complete.  If you experience random
    hangs, try disabling UMB's (comment out EMM386 line in CONFIG.SYS; or
    remove the RAM keyword from the EMM386 line if you still need the EMS
    support).If the hangs no longer occur, it probably means that you have a
    conflict with either a program not working well in an UMB or with a UMB
    clashing with hardware, such as a network.  See the TROUBLESHOOTING
    section for information on how to work around this.

    You may also want to use the DEVICEHIGH and LOADHIGH commands to load
    programs which are not shipped with MS-DOS 5.0 high; use the same steps
    as outlined above - note that some of these programs may not work when
    loaded high. You can use the MEM command to see how much memory you now
    have available.  If you are using a network, be sure to see the sections
    below on how to load networks into UMB's to save even more memory.

TROUBLESHOOTING --------------------------------------------------------

If you see a message indicating that something is not working correctly, 
edit the appropriate startup file (CONFIG.SYS or AUTOEXEC.BAT)  and 
change the DEVICEHIGH to DEVICE (CONFIG.SYS) or remove the LOADHIGH 
(AUTOEXEC.BAT) for that program (this will cause the program to be 
loaded low).  Reboot your computer to assure that the problem is fixed.

If your system hangs after rebooting, note the messages which are 
printed before it hangs.  Use this information to try to identify the 
driver or program which is causing the problem.  Using the a boot disk 
(if you followed the UMB setup procedures outlined in above, you will 
have already created a boot disk), try moving drivers low one at a time 
(and rebooting) until the system doesn't hang.

Following is a list of potential problems:

*   Device drivers which grow during initialization.  DOS will assure
    that there is at least as much memory in the UMB as the size of the
    device driver file.  However, if the device driver grows larger than its
    file size during initialization, this can cause problems.  If you suspect
    this is the problem, use the SIZE option on the DEVICEHIGH line to
    specify the required size for the device driver.  The size must be
    specified in HEX.  The line should be in the form:

		DEVICEHIGH SIZE=hhhh path

    where hhhh is a hexadecimal number.  You can determine the final size of
    a device driver with the MEM /DEBUG or MEM /PROGRAM command.  However,
    some device drivers may grow and then shrink before finishing
    inititalization.  There is no easy way to determine the necessary size
    for this type of device driver.

*   Programs which make assumptions about memory available above them.
    Some programs assume that there is always memory above them (up to  a 64K
    boundary for example).  These programs may have trouble when loaded into
    TSR.  Work around is to load them low.

*   Programs which get confused by addresses >640K.  Some programs get
    confused when they see an address >640K.  These programs must be loaded
    low.

*   Programs/Hardware which cause RAM to appear after EMM386 has done
    its ROM/RAM scan.  Some hardware/software maps memory into reserved
    address space when software is loaded.  Since EMM386 has already done it'
    s ROM/RAM scan and has determined that there is no memory there, EMM386
    will be mapping a UMB into the address.  When the other program causes
    other memory to be mapped to the same address, problems ensue.  To work
    around this, utilize the X= option on EMM386 to exclude specific regions
    from consideration for UMBs.  For example:

            DEVICE=C:\DOS\EMM386.EXE NOEMS X=D800-DFFF

    This line causes EMM386 to exclude the region from segment D800 to DFFF.

Other problems:

Problem:    I think I have setup my system for UMB's, but when I use MEM /D,
            It appears that nothing is loaded into UMB's.

What to check:  
    1)      Ensure that you have DOS=UMB in config.sys.
    2)      Ensure that EMM386 is loaded with UMB support (run
            EMM386 from the command line and see what it says for
            the "Starting Upper Memory Address"). Note that MEM will
            not report memory above 640K when run under windows 3.0
            enhanced mode.  If No UMB support is available, assure
            that you specified either NOEMS or RAM when EMM386 is
            loaded (CONFIG.SYS).
    3)      Ensure that you specified DEVICEHIGH for device
            drivers and put LOADHIGH (or LH) in front of the programs and TSR's.
    4)      Ensure that the EMM386.EXE line is after the HIMEM.SYS
            line in the config.sys
    5)      For device drivers, ensure that the device driver line
            in the CONFIG.SYS file is after the EMM386 line.

Problem:    I have a device driver or TSR whose size appears to be small
            enough to fit into an available UMB, yet it is still loaded low.

What to check:
    1)      Look at the file size of the device driver.  Some
            device drivers are bigger during initialization and then shrink.
            MS-DOS will require that the there be at least as much space in
            the UMB as the file size of the device driver, before attempting
            to load it into an UMB.

Problem:    My system hangs intermittently.


What to do: Try commenting out the EMM386 line in your CONFIG.SYS
            (add REM before the DEVICE=) and see if the problem persists.  If
            it does not persist, then there is a problem with UMB's.  Try
            commenting out each devicehigh and loadhigh until the problem
            quits happening.  When the problem quits happening, try adding
            back the other Loadhigh's and devicehigh's (the ones which had no
            effect on the problem when commented out).

            One sign of a problem is if a program or driver has a smaller
            size when loaded into an UMB then when it is loaded low.  This
            may mean that the program has tried to grow beyond its allocated
            UMB. You can check with the MEM /P command, loading the driver or
            program first low, then high.


EXAMINING UMBS---------------------------------------------------------

You can determine what programs and TSR's are loaded into UMB's by first 
using the EMM386 command to see where UMB's start, and then using the 
MEM/DEBUG (or MEM/Program) command to see how the UMB's are being utilized.

If you run EMM386.EXE from the command line, it will display something 
similar to the following:

        MICROSOFT Expanded Memory Manager 386  Version 4.20.06X
        (C) Copyright Microsoft Corporation 1986, 1990

        Expanded memory services unavailable.

          Total upper memory available  . . . . . .     0 KB
          Largest Upper Memory Block available  . .     0 KB
          Upper memory starting address . . . . . .  C800 H

        EMM386 Active.

The "Upper memory starting address" is the first segment in which UMB's 
are located.  Utilize MEM/DEBUG to show memory usage. You will see 
something like (note: you can make the output stop after each page by 
using MEM/DEBUG|MORE):


        Address     Name          Size       Type
        -------     --------     ------     ------
        000000                   000400     Interrupt Vector
        000400                   000100     ROM Communication Area
        000500                   000200     DOS Communication Area

        000700      IO           000A80     System Data
                        CON                   System Device Driver
                        AUX                   System Device Driver
                        PRN                   System Device Driver

       <.. removed lines here to shorten output ..>

        01A990      MSDOS        085650     -- Free --
        09FFF0      MSDOS        028010     System Program

        0C8010      MSDOS        000130     -- Free --
        0C8150      MSDOS        000AE0     -- Free --
        0C8C40      XNSBIOS      000120     Environment
        0C8D70      XNSBIOS      002610     Program
        0CB390      SESSION      000120     Environment
        0CB4C0      PRTSC        000120     Environment
        0CB5F0      PRTSC        000320     Program
        0CB920      DOSKEY       000FE0     Program
        0CC910      MIRROR       001990     Program
        0CE2B0      MOUSE        003830     Program
        0D1AF0      MSDOS        0064E0     -- Free --
        0D7FE0      MSDOS        008020     System Program

        0E0010      IO           001500     System Data
                      RAMDRIVE   0004A0      DEVICE=
                        D:                    Installed Device Driver
                      ANSI       001040      DEVICE=
                        CON                   Installed Device Driver
        0E1520      SESSION      000410     Program
        0E1940      REDIR        0093E0     Program
        0EAD30      MSDOS        0052C0     -- Free --


          656384 bytes total conventional memory
          655360 bytes available to MS-DOS
          625664 largest executable program size

         4194304 bytes total contiguous extended memory
               0 bytes available contiguous extended memory
         3124224 bytes available XMS memory
                 MS-DOS resident in High Memory Area


Given the upper memory starting segment of C800, reported by EMM386, you 
can examine the MEM/DEBUG output for any address greater than or equal 
to C8000.  Anything with "-- Free --" in the type column is available 
UMB memory. Anything with a name other than MSDOS is a program or device 
driver which is running in a UMB.  In the example above XNSBIOS, 
XNSBIOS, SESSION, PRTSC, DOSKEY, MIRROR, MOUSE, RAMDRIVE, ANSI, SESSION, 
and REDIR are all running in UMB's.

The size is in Hexadecimal.  In the example above, there are free UMB's 
at 0C8010 (size:130h) , 0C8150 (size:AE0h), 0D1AF0 (size:64E0h), and 
OEAD30 (size:52C0h).  If you are unfamiliar with Hex numbers, you can 
get a rough approximation of the size of the block in K as follows:

    (Multiply 10,000 digit by 16) + (Multiply 1,000 digit by 4) + (Divide
    100 digit by 400) = K.

Thus, in the example above, the UMB at location OEAD30, size 52C0, is 
(5*4)+(2/4)=20.5K.


OPTIMIZING UMB USAGE ---------------------------------------------------

Optmizing UMB usage under MS-DOS 5.0 can be tricky and non-intuitive.
You have two ways to control how UMBs are utilized:

*       Load order
*       What you load high

If you have sufficient UMB space to load all your device drivers and 
programs high, optimization is easy: simply load them all high.  If you 
do not have sufficient space to load everything high, then it is 
considerably harder.  You will need to utilize the EMM386 and MEM/DEBUG 
commands to see what UMB's you have available and then decide which ones 
to load high.  The previous section describes how to determine which 
programs and device drivers are loaded into UMB's, as well as how to 
determine which UMB's are available for loading of additional programs.

Device drivers are loaded into the largest available UMB at the time
the device driver is loaded.  Then the free UMB is reduced in size by the
amount of space required by the device driver.  Thus, if you have a big
network file which is started in the autoexec.bat, you may wish to not load
some smaller device drivers high in config.sys since they may result in
the UMB being reduced in size enough so that it cannot load the large
network file high.  It may take some trial and error to achieve the
most optimal solution.

Loading Networks into UMB's --------------------------------------------

Network programs tend to use a lot of lower memory.  If you have 
sufficient space for the programs in UMB's, you can achieve substantial 
memory savings.  The following sections describe how to load some of the 
major networks into UMB's.  If your network is not listed here, please 
contact your network vendor for information on how to load the network 
into a UMB.

If you are not sure which network you are using, see the NETWORKS.TXT 
file which was copied to the same directory as this file.

Note: it is assumed in all of the following sections that you have 
completed the steps outlined in the "ENABLING MS-DOS 5.0 UMB SUPPORT" 
section.


MS-NET BASED networks --------------------------------------------------

Most MS net based redirectors are loaded with the NET command.  Look in 
your AUTOEXEC.BAT file (or other file which you use to start the 
network) for a command similar to:

    NET START <other stuff...>

where <other stuff...> indicates that there is other text following 
START which we don't care about.  Add the word LOADHIGH to beginning of 
the line:

    LOADHIGH NET START <other stuff...>

Now reboot your computer and watch to assure that the network loads 
without problem. You can use the MEM command to see how much memory you 
now have available.


LANMAN 1.X/2.X BASED REDIRECTORS----------------------------------------

These redirectors come in two varieties: BASIC and ENHANCED. If you 
start the network with the command "NET START WORKSTATION", then you are 
running the enhanced version.  If you start the redirector with a 
command similar to "NET START RDR", then you are running the BASIC 
version.  Look in your AUTOEXEC.BAT (or other file which you use to 
start the network) to see which command is used.

LM 1.x/2.x BASIC REDIRECTORS
These redirectors will often fit into a UMB.  To load them high, simply 
add the word LOADHIGH in front of the NET START:

    LOADHIGH NET START <other stuff...>

Now reboot your computer and watch to assure that the network loads 
without problem. You can use the MEM command to see how much memory you 
now have available.

LANMAN 1.X/2.X ENHANCED REDIRECTORS-------------------------------------

Best memory savings with LM enhanced redirectors (2.0b and earlier) is 
achieved by instructing the network to use LIM memory

1)  Use the RAM option on EMM386 to specify that both UMB and EMS
    memory be provided (Step 5 in the "ENABLING MS-DOS 5.0 UMB SUPPORT"
    section above).

2)  Locate the LANMAN.INI file:

        C:
        CD \
        DIR /S /B LANMAN.INI

    If more than one LANMAN.INI file is found, use the one which appears
    first in the PATH (use the PATH command to see the path).

3)  Edit the LANMAN.INI file.  For example, if the file is C:\LM.DOS,
    then use:

        EDIT C:\LM.DOS\LANMAN.INI

    This will invoke the MS-DOS 5.0 editor.

4)  Use the search command to find the LIM option (ALT-S means hold
    down the ALT key while pressing S):

        ALT-S F

    You will see a dialog box asking to "Find What".  Type LIM and press enter.

5)  If the line has a semicolon (;) at the beginning, remove the
    semicolon.  Assure that the line now says:

        LIM = YES

Loading Novell Networks into UMB's -------------------------------------

When you start your network, specify LOADHIGH before the novell startup 
command.  For example, if you are using NET5.EXE to start novell, add 
Loadhigh before NET5.

Using MS-DOS 5.0 UMB's with 3-rd party memory managers------------------

If you are already using a 3-rd party memory manager, you may prefer to 
let it handle loading of device drivers and TSR's into UMB's.  However, 
if you wish to use the MS-DOS 5.0 LOADHIGH and DEVICEHIGH commands to 
load programs into UMB's, you will need to make the following changes:

1)      Add DOS=UMB
2)      Replace the commands which the 3-rd party tool uses to load device 
        drivers and utilities high with the MS-DOS 5.0 DEVICEHIGH and LOADHIGH

Windows 3.0 and MS-DOS 5.0 UMB Support ---------------------------------

MS-DOS 5.0 UMB support works great with windows 3.0, but programs must 
be loaded high before starting Windows.
