Learn about the technologies behind the Internet with The TCP/IP Guide!|
NOTE: Using robot software to mass-download the site degrades the server and is prohibited. See here for more.
Find The PC Guide helpful? Please consider a donation to The PC Guide Tip Jar. Visa/MC/Paypal accepted.
|View over 750 of my fine art photos any time for free at DesktopScenes.com!|
Upper Memory Blocks (UMBs)
Those parts of the upper memory area that are not used by ROM or for video RAM are generally available for use by other programs. These are called upper memory blocks or UMBs. They cannot typically be used by regular programs, since they are too small and since regular code is supposed to be run in conventional memory. However, they are ideal for loading memory-resident programs and drivers.
To make UMBs available for drivers requires a driver program to provide access to them. In a DOS environment, the driver used is EMM386.EXE, which is loaded in the CONFIG.SYS file. When this driver is loaded including either the "RAM" or "NOEMS" parameters, the areas of open memory in the UMA are made available for use by drivers and memory-resident programs. A driver in CONFIG.SYS can be told to load into the UMA by specifying it using "DEVICEHIGH=" instead of "DEVICE=". A program in the AUTOEXEC.BAT file can be loaded into the UMA using "LOADHIGH" or "LH" at the front of the command line. See the section on optimizing conventional memory for more details.
Note: Despite the name
"LOADHIGH", this commands loads into the upper memory area, not the high
By default, EMM386.EXE selects certain areas for use as UMBs, and other areas that it considers reserved. It will usually allow the use of unused portions of the UMA between C8000h and EFFFFh; it assumes A0000-BFFFFh is used for video memory, C0000-C7FFFh for the VGA BIOS ROM, and F0000-FFFFFh by the system BIOS ROM. If you are using an adapter that puts its ROM into one of the areas that EMM386 normally uses, you should tell EMM386 to leave it alone by using the "X" parameter. For example, if you are using a device that uses addresses D8000-D9FFF, put "X=D800-D9FF" as a parameter to EMM386. (The last digit is left off).
Similarly, if there is an area that EMM386 normally reserves and you are sure you aren't using it, you can tell EMM386 to add it back into the UMB pool. The best example of this is the monochrome text mode video RAM. In modern systems with modern software, this area is never used. When displaying monochrome text the color text mode is used and a white or gray color is just used for the text instead. Unless you are using a very old DOS program that makes use of text mode (a few do), you can reclaim this 32 KB block for use by EMM386 by specifying "I=B000-B7FF" as a parameter to EMM386.
Because of the differing locations of ROMs, the UMBs that EMM386 makes available aren't always contiguous. However, a program cannot be loaded in two pieces; it must go into a single UMB. This means that some UMBs can be wasted; if you have a 16 KB program you are trying to load high and you have two 8 KB UMBs left, the program cannot be loaded high. Sometimes changing the order that drivers are specified in the AUTOEXEC.BAT file can allow better use of the UMBs.
Finally, unless you really need to use EMS memory, you should specify the "NOEMS" parameter with EMM386.EXE. Using the "RAM" parameter sets up EMS emulation and this means that 64 KB worth of UMA is spent on the EMS page frame, which means it isn't available for use as UMBs. 64 KB is a substantial chunk of the free memory in the UMA.
Warning: ROM shadowing should
be disabled in the memory vicinity where EMM386 is using the UMA for UMBs, or problems
Next: ROM Shadowing