Classic Computer Magazine Archive COMPUTE! ISSUE 167 / AUGUST 1994 / PAGE 12

Elephantine memory. (using 384K upper memory) (Introdos) (Column)
by Tony Roberts

Upper memory is a 384K area of RAM that lies just beyond the first 640K in your machine. Back in the old days, this area was reserved. Video adapters were allowed to use that space, and the system was allowed to copy parts of its ROM to that area. This arrangement provided a boost in system performance because RAM is generally faster than ROM. Because the system and video programs are so frequently accessed, it makes sense to put them where they can be found most readily.

As it turns out, though, not all of the 384K upper memory area is used by the system. There are areas of free space in that 384K known as upper memory blocks. With the right hardware and software (a 386 or higher running DOS 5 or higher), you can use some of the extra space for DOS, your favorite TSR programs, or your network software.

Most of today's computers are set up to take advantage of the extra space in high memory. The result is a less cramped conventional memory area, which makes it easier to run large DOS applications and to make use of more TSR programs. If your system is set up this way, you'll see commands such as DEVICE=HI-MEM.SYS, DEVICE=EMM386-.EXE NOEMS, DOS=UMB, and DOS=HIGH in your CONFIG.SYS file.

The HIMEM.SYS line provides access to the upper memory blocks and to other extended memory. DOS=UMB tells DOS that it should be aware of the presence of upper memory blocks, and DOS=HIGH tells DOS to load some of itself into those upper memory blocks. Finally, the EMM386 line activates the DEVICEHIGH and LOADHIGH commands with which you instruct your device drivers and TSRs to load themselves into upper memory if possible. The NOEMS parameter indicates that you're using only extended memory and not expanded memory. If you have applications that require expanded memory, that parameter should be omitted.

The upper memory area is partially used by your system's hardware. Usually, your system is able to figure out what is in use. Sometimes, however, it decides that a certain area is unused and makes it available as an upper memory block when, in fact, some hardware is counting on access to that memory.

This is the dreaded upper memory conflict, and it results in erratic system behavior, crashes, reboots, and GPFs if you're using Windows. At this point, you must figure out where the conflict is occurring and eliminate it.

First, perform a clean boot of your computer. To do this in DOS 6 and above, reboot and press F5 when the Starting MS-DOS message appears. Next, run the Microsoft Diagnostic utility by entering msd at the command prompt.

MSD provides detailed technical information about your computer and its setup. If you explore the options, you'll learn a lot about your computer. But right now, press M. The screen that appears shows you a map of your system's upper memory area.

There's a legend at the top of the screen that explains the codes in the memory map. Scroll through the map and find any areas marked as ROM or RAM, and make a note of the starting and ending addresses of those areas.

Next, exit the MSD utility, open CONFIG.SYS, and edit the EMM386 line to exclude those areas that you identiied as being in use. Here's an example: DEVICE=EMM386-.EXE NOEMS X=B800-C7FF X=D800-DBFF.

Save the CONFIG.SYS and restart the computer, and the conflict should be resolved. If not, your system may include hardware that MSD is unable to identify. This is the case with the scanner on my system. MSD identified the range of memory from D000 to D3FF as possibly available, but as it turned out, that's the memory the scanner uses. So adding an X=D000-D3FF exclusion to the EMM386 line in CONFIG.SYS solved the problem.

If the memory confict still exists and your hardware documentation provides no clue as to what range of memory it might be using, you can go through a troubleshooting procedure to narrow down where it might be occurring.

First, edit the EMM386 line to exclude the whole upper memory range: X=A000-F7FF. If that solves the problem, shrink the range by specifying X=C000-F7FF. If the problem recurs, it follows that the conflict exists in the A000-BFFF range. Test this theory by specifying X=A000-BFFF and rebooting. If the memory conflict is gone, you can start narrowing the excluded range to A000-AFFF or B000-BFFF to further isolate the affected area.

Keep narrowing the excluded range until you find the smallest possible area to exclude that still permits your computer to operate properly. Once you've done this, you'll have resolved your upper memory conflict, and you'll have preserved the most possible memory for your applications.

Before going through all of this experimentation, though, be sure to make backup copies of your system files so you'll be able to return to your starting point if necessary.