Studying for the A+, Network+ or Security+ exams? Get over 2,600 pages of FREE study guides at CertiGuide.com!|
Join the PC homebuilding revolution! Read the all-new, FREE 200-page online guide: How to Build Your Own PC!
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.
|Take a virtual vacation any time at DesktopScenes.com - view my art photos online for FREE in either Flash or HTML!|
Expanded Memory (EMS)
In modern systems, the memory that is above 1 MB is used as extended memory (XMS). Extended memory is the most "natural" way to use memory beyond the first megabyte, because it can be addressed directly and efficiently. This is what is used by all protected-mode operating systems (including all versions of Microsoft Windows) and programs such as DOS games that use protected mode. There is, however, an older standard for accessing memory above 1 MB which is called expanded memory. It uses a protocol called the Expanded Memory Specification or EMS.
EMS was originally created to overcome the 1 MB addressing limitations of the first generation 8088 and 8086 CPUs. In the mid-80s, when these early systems were still in common use, many users became distressed that they were constantly running out of memory. This happened particularly when using large spreadsheets in Lotus 1-2-3, then probably the most popular application on the PC. However, there really was no easy way to make more memory available due to the 1 MB barrier.
To address this problem, a new standard was created by Lotus, Intel and Microsoft called the LIM EMS standard, where "LIM" of course is the initials of the companies involved. (I wonder how they ever agreed to get Microsoft to put its name last. I'll bet they couldn't pull that off today. ;^) ) To use EMS, a special adapter board was added to the PC containing additional memory and hardware switching circuits. The memory on the board was divided into 16 KB logical memory blocks, called pages or banks. Both of these terms are used in other contexts as well, so don't confuse them.
What the circuitry on the board does is to make use of a 64 KB block of real memory in the UMA, which is called the EMS Page Frame. This frame, or window, is normally located at addresses D0000-DFFFFh, and is capable of holding four 16 KB EMS pages. When the contents of a particular part of expanded memory is needed by the PC, it is switched into one of these areas, where it can be accessed by programs supporting the LIM specification. After changing the contents of a page, it is swapped out and a new one swapped in. Pages that have been swapped out cannot be seen by the program until they are swapped back in.
This concept is called bank-switched memory, and in a way is not all that different from virtual memory, except here the swapping isn't being done to disk but rather to other areas of memory. But here, a lot more swapping is being done than in virtual memory. Because of all the swapping, EMS is horribly inefficient. If you have 4 MB of EMS memory, you can only access 64 KB of it at a time, or 1.5%. This means a great deal of time is spent just shuffling memory around.
With the creation of newer processors that support extended memory above 1 MB, expanded memory is very obsolete. Note that EMS and XMS are physically different; an expanded memory card cannot be used as extended memory, and extended memory cannot be used directly as expanded memory. These EMS cards have been obsolete for over 10 years now and are rarely if ever seen except in left-over relics from the mid-80s. However, the software that uses them persists more stubbornly (of course).
Included in MS-DOS is a driver called EMM386.EXE that you can use in your CONFIG.SYS file to allocate a portion of extended memory to be used to emulate expanded memory, for programs that still use it. Running EMM386.EXE (as long as you don't use the "NOEMS" parameter) will set up a page frame and dedicate a portion of extended memory for use as expanded memory. EMM386 has a host of options that can be used to change how much memory is set aside, the location of the page frame, etc.
It is recommended that if at all possible, you avoid using programs that still require EMS. In addition to being slow and cumbersome, using extended memory for EMS makes it unavailable for use as extended memory by other applications, and the page frame wastes 64 KB of the upper memory area that could be used for drivers. This means that indirectly, up to 64 KB of conventional memory can be lost when using EMS. At the present time, most programs have been updated to use more modern, faster extended memory, but some persist in using EMS. The biggest culprits in this area seem to be games whose authors are still using EMS so they can run in DOS real mode. Even these are few and far between now.
Note: EMM386.EXE is also used
to provide access to UMBs.