Lloyd Robert Borrett

Follow Lloyd on Twitter Friend Lloyd on Facebook Connect with Lloyd on LinkedIn Follow Lloyd on Pinterest

Memory As DOS Sees It

by Lloyd Borrett
Technical Cornucopia, May–June 1989

DOS was designed to only be able to see the 1 MByte memory address range supported by the Intel 8088 and 8086 microprocessor chips. Most PC based systems provide us with 640 KBytes of memory for DOS and our applications, and reserve the remaining 384 KBytes of addressable space for video memory, the system BIOS ROMs, disk controllers, etc...

To allow DOS programs to use more than 1 MByte of memory we must employ a technique for swapping parts of a larger memory space into the 1 Mbyte area DOS can actually see. We must change the contents of this memory frequently and efficiently so that DOS will appear to be working with much more than 1 MByte of data and code.

The ideal arrangement would be if we could treat the entire 1 MByte as a "window" area which could be rapidly changed to view different portions of a much larger "physical address space". In this way DOS programs could have access to the contents of this larger address space (say 16 MBytes) rather than just the contents of the 1 MByte space that it is normally restricted to.

There are two hardware mechanisms to perform this process — mapping and bank switching. There is also one software mechanism — overlays.

Software solutions


Overlaying is a slow, awkward process that requires data to be moved to and from a storage device such as a hard or floppy drive. Moving data is far from instantaneous and as a result this technique is impractical in any environment where constant changes are required to the content of the "DOS 1 MByte space".

EMS emulation

For completeness, we should add that another short lived software solution has come to the market - software emulation of EMS hardware on 8088 and 80286 based systems. Products such as Above Disk fall into this category. Even with EMS 3.2, this was a slow, and often impractical solution. With EEMS and EMS 4.0 it is even slower and should not be attempted.

Hardware solutions

With hardware solutions the process of memory swapping is much faster because we are no longer moving data and code; instead we are manipulating or switching the memory addresses and causing different portions of a large memory space (say 16 MBytes) to be viewed through the 1 MByte space that DOS recognizes.

Expanded memory through bank switching

This technique of bank switching is used by all the slot plug-in boards conforming to the EMS 3.2, EEMS and EMS 4.0 specifications. These include all the popular boards such as Intel Above Board, Hypertec Hyperam, and AST RAMpage.

Bank Switching is an old and rather crude technique for "switching" addresses. In its original form it used one bank of memory space ("DOS 1 MByte space" in our case) to serve as a "window" for switching in other banks, one at a time, from an endless string of these banks that are located externally. Externally in this context means the memory is not located in the address space of the computer but rather in I/O space -—which is not as readily accessible or efficient.

Some computers like PC's and XT's (using 8088 or 8086 processors) have a 1 MByte address space. Other computers like ATs, IBM PS/2 Model 30-286 and up (using 286 and 386 processors) have at least a 16 MByte address space — but the "DOS 1 MByte space" remains restricted to the first of these 16 MBytes (referred to as "Conventional Memory" and the upper 15 MBytes (called "Extended Memory") is not accessible through bank switching.

As a result, these computers may be purchased with a few megabytes of memory chips installed into their 16 MByte memory space but at most only 640 Kbytes is populated into the first megabyte and the rest is wasted unless memory management is added to the systems. In fact, for the most efficient operation of EEMS 3.2 or EMS 4.0 specifications, it is best if none of the initial 640 Kbytes of conventional memory is used!

This is why advanced multitasking systems like DESQview recommend that you depopulate or otherwise disable the memory you get with your computer. On PS/2 models 50 & 60 for example, you must disable and waste the entire megabyte that comes with the basic machine for optimum performance.

Expanded memory through mapping

This mapping technique requires a memory management unit and is only provided for 286 based IBM and compatible computers with the All Chargecard. It is automatically available on 386 based computers and has also been provided for many years on mainframes and minicomputers.

With mapping it is possible to map memory "out" as well as "in". As a result, there is no need to disable Conventional memory as in the case of bank switching. You get to use all of your 640 KBytes with EEMS and EMS 4.0 and still run efficiently.

Further you can map memory from any address in the machine's natural 16 MByte space. This results in full use of Extended as well as Conventional memory and no need to add the more expensive and less accessible Expanded memory for I/O space.

Larger conventional memory through mapping

The mapping technique provided by the All Chargecard can also be used to increase the Conventional Memory by using space in the 384 KBytes reserved area above 640 Kbytes.

Most of the "DOS 1 MByte space" can now be used rather than being limited to 640 KBytes. There are two methods of using this extra memory space.

  • Static — With the static method, we do not move the 640 KByte barrier, but map Extended Memory into the 640 KByte to 960 KByte region and manage things automatically through the ALLEMM4.SYS driver (provided with the All Chargecard). Now you can load FILES, BUFFERS, Device Drivers, TSRs, Last Drive, COM and EXE files above the 640 KByte barrier out of the way, freeing up DOS space.
  • Dynamic — With the Dynamic method, we map out everything above 640 KBytes, providing 960 KBytes of contiguous DOS space. The down side is that having moved the video we must tell programs that write direct to video that it has been moved and so these programs must be patched using the ALLPREP utility.

Memory mapping in use

In one example of the use of the All Chargecard's mapping abilities we installed one in an AT compatible system with a Colour Graphics Adapter (CGA), 640 KBytes of conventional memory and 384 KBytes of extended memory.

The CGA adapter uses the memory area B800 to BFFF as a video buffer. We were able to lift the 640 KBytes limit to 736 KBytes by the "forefilling" of memory up to the start of the video buffer. (Note: This is not possible with VGA or EGA video adapters. Mono or Hercules adapters allow the DOS limit to be increased to 704 KBytes.)

Then we were able to use the memory area E000 to EFFF to "Shadow" the systems ROM BIOS for improved speed. Finally we were able to use 100 KBytes of high memory for programs that would normally sit in conventional memory. This included, FILES=127, BUFFERS=99, ANSI.SYS, LASTDRIVE=G:, DOSEDIT2 and BTRIEVE.

We were left with 30 Kbytes of high memory and 32 KBytes of extended memory still unused. But most importantly CHKDSK was now reporting 736 KBytes of total memory and 666 KBytes free. We were able to run a program that required more than 640 KBytes of contiguous conventional memory with room to spare!

Networking and memory mapping

With many network systems requiring 60 to 200 KBytes of conventional memory for network drivers, memory space is often a limited resource on network workstations. The memory mapping abilities of the All Chargecard allows 80286 based systems to load some network device drivers, and other drivers, as well as TSRs up into the high memory area and thus increase the amount of conventional memory available to DOS applications.

For many people this will greatly enhance their ability to use and benefit from a network installation.

Memory mapping and 386 based systems

Memory mapping is automatically available on 386 based computers, but a memory manager is required to enable us to make use of this feature. Programs such as DESQview QEMM 386 and Qualitas 386max are memory managers for 386 based systems with extended memory.

These programs let us take maximum advantage of the 386 systems memory mapping abilities. If you already own a 386 based system with extended memory and don't use a program such as QEMM 386 or 386max you are not fully exploiting the power of your system.

You should not install an EMS board in a 386 system. Almost all EMS boards use the 16 bit data bus. Thus accessing this memory will be much slower than accessing a 386 system's 32 bit memory. Instead, install more 32 bit memory on the 386 system's motherboard or on a 32 bit expansion card. This extended memory can then be managed and used as expanded memory by QEMM 386 or 386max.


Currently many of us are asking DOS to do much more than it was intended to manage, and we are encountering problems doing so. Eventually, OS/2 will solve these problems, after all that is its main purpose.

Meanwhile, we are faced with the need to make the most of what is available. For users of 386 and 386SX based systems all that is required is 32 bit extended memory and a suitable memory manager program.

For those of us who need to make the most of existing 286 based systems, extended memory and the All Chargecard with its ability to add a "386 like" memory management unit should be considered.

Unfortunately there is no easy solution always guaranteed to work. What is needed is the knowledge and understanding to be able to try appropriate solutions.

Last modified: Saturday, 15 October 2011


home | about | weird mob | computing | interests | insight
Copyright © 1995-2018 Lloyd Borrett. All rights reserved.  ::  www.borrett.id.au
mob 0418 170 044  ::  tel +61 3 5904 9005  ::  email lloyd@borrett.id.au  ::  skype lloyd_borrett
twitter @borrett  ::  facebook lloyd.borrett  ::  linkedin lloydborrett