MSDOS Introduction
Copyright B Brown, 1988-2000. All rights reserved.

Home Page

prev page next page


MSDOS MEMORY TYPES
With advances in hardware design and the increased memory available in newer machines (PC=640K, AT286=16MB, 386/486=4GB), MSDOS has come under threat.

MSDOS is still restricted by the old limitations of the 8086 processor of using 640K of memory for running MSDOS programs. MSDOS has not been re- written to keep pace with developing hardware, and as each new version of MSDOS has appeared, it has remained backward compatible with old machines (ie, still runs on a PC with 640K of memory).

Certain add-on features have appeared to patch MSDOS into recognising the extra RAM available in newer 286/386 machines. They are called memory managers, and make available the extra memory in a number of different ways, primarily as disk cache and ram drives.

There are a number of different memory areas which MSDOS manuals refer to. The following is a discussion of them.


Conventional Memory
The original 8086 processor had a memory limit of 1MB, the first half being reserved for use by MSDOS (0-640K), the second half for use by peripheral cards like video cards, network cards, the ROM BIOS program and the XT hard disk controller card.


Expanded memory
When the 80286 processor was developed, its maximum address range was 16MB of RAM. As MSDOS still imposed the 640K limit for running programs, several companies developed a memory manager for using the area between 640K and 1MB for storing programs and data.

The idea was copied from the CP/M operating system, and is based on bank switching techniques. A free block (normally about 64k) of memory space not being used by a peripheral card is found between 640K and 1MB. Access and control of this block is under a memory manager device driver program.

Within this memory block, many 16K blocks of RAM were provided on an expansion card which plugs into a free expansion slot on the computer motherboard. Under software control, up to 4 of these 16K banks was visible at any one time. By switching in and out these 16K blocks of RAM, it could appear as though there was a large amount of memory available, all accessed through this expanded memory window.

This became known as the LIM EMS standard (expanded memory system), and many modern programs like lotus 123, Quattro Pro, Borland C++ and others support this standard. With the advent of the 386/486 computer, it has the ability to simulate expanded memory using a device driver, and does not need a special card to do this. Expanded memory is available for all processor types from the 8086 PC to the 486DX PC.


Extended Memory
With the advent of the 286/386/486 processor based systems, it was possible for the processor to access larger RAM sizes. MSDOS stiill imposed the 640K limit for DOS applications however, in an effort to maintain backward compatibility with previous machines (like the PC and XT).

The extra memory available was from 1MB upwards, to a limit of 16MB for 286 machines, and 4GB for 386/486DX machines. Because the 8086 processor was limited to 1MB of memory, the designers of the 286/386/486 processors introduced a new way of accessing this extra memory. In effect, they designed two processors inside a single chip.

The first processor looked and behaved like a standard 8086, whilst the other acted as a super improved chip with extra functions and larger memory capability. The default mode of operation is a standard 8086, but a special software instruction can switch the chip into the new advanced mode. MSDOS remember, is written in the old 8086 instructions, so it cannot take advantage of the super improved chip and its extra functionality.

With the 286-486 chip acting as a PC (default), accessing memory is called real mode (<1MB), whilst the new 286/386/486 way is called protected mode.

Extended memory is ONLY accessible in protected mode. This special mode of operation occurs when the chip is switched to act as a 286-486. Several operating systems have been written to take advantage of this mode, and thus access to the larger amounts of memory available. Examples are Windows 3.1 and OS/2.

Extended memory can only be accessed on 286-486 processor based machines running in protected mode of operation with more than 1MB of RAM.


Upper Memory Blocks
MSDOS uses the lower 640K of memory for application programs. In a PC based computer, the remaining 640K below 1MB is reserved for system use, examples being the ROM BIOS and peripherals like networking and hard disk cards.

Peripheral cards often have memory on board, like video cards which have memory which hold the screen image, and a small ROM which hooks itself into the ROM BIOS to provide support for special displays (VGA display cards are a good example).

When the 286-486 computers were designed, intelligent support chips were added to provide sophisticated memory manipulation and management. These are called the AT Chip Set, now common on virtually all PC based computers.

As computers have advanced, so has memory chip capacity. In the original PC's, one memory chip held 64K by one bit. Today, one chip can hold 4M bits. When the AT computers were released, 1MB of RAM was provided on the motherboard. The AT chip set provided for mapping 640K of this memory into the lower 1MB space for use by MSDOS, and about 384K as extended memory.

As memory chips expanded in size, it became common for 2MB or 4MB of memory to be fitted to motherboards. This complicated remapping the unused memory from the first 1MB (640K used by MSDOS), so software was developed to remap the unused memory into the address space between 640K and 1MB reserved for peripheral devices.

How much unused space is available depends upon the types and numbers of peripheral cards installed in the computer system. It can range from as little as 8K to 128K of unused space. This is called the Upper Memory Area.

With the release of MSDOS 5.0, upper memory blocks became an integral part and is used for transferring device drivers into the upper memory, freeing up more conventional memory for MSDOS based applications. MSDOS provides an Upper Memory device driver (EMM386.EXE), which manages the memory area as a series of blocks, allocated under the control of MSDOS. This is available only for 386 or better computers.


The High Memory Area
When Microsoft Windows v3.0 was released, people suddenly found they had an extra 64K of memory available for running applications. This was a trick which exploited a design flaw in 286 or better processors.

It was found that the first 64K of extended memory above 1MB was actually accessible in real mode, and therefor could be accessed by MSDOS. This is known as the high memory area, and is a maximum of 64K in size.

With MSDOS 5.0, it is possible to load the DOS shell into the high memory area, freeing up more conventional memory for DOS based applications. This is done by adding the following statements into the config.sys file.


	REM load high memory and extended memory manager
	device=himem.sys
	REM load dos into high memory area
	dos=high