[comp.sys.ibm.pc] Expanded vs. Extended mnemonic.

rjs@moss.ATT.COM (11/24/88)

A simple mnemonic was provided by someone on the net a few months ago
to help remember the difference between expanded and extended memory.

Extended conjures the image of long and thin: the address range of extended
memory in an 80[23]86 based machine is longer than the 0-1M range of an
8086 based machine, while each address represents one byte.

Expanded conjures the image of short and fat: the address range of expanded
memory still falls withing the 8086 0-1M range, but a small (64K I think)
section above the 0-640K range assigned to general purpose RAM can be mapped
to many different arrays of 64K bytes.  Thus each address represents a
collection of bytes.  A bios/driver/DOS/? function call is used to pick the
64K array which will be accessed by subsequent use of the 64K expanded memory
range.

While my description above may not be entirely technically accurate, the
mnemonic sure helps me quickly remember which memory addressing scheme is
which when I run across the terms in an article or ad.  Hope it helps you too.

	Robert Snyder
	{att|ihnp4|clyde}!moss!rjs
	rjs@moss.ATT.COM
	(201) 386-4467

The above statements are my own thoughts and observations and are not
intended to represent my employer's position on the subject(s).

jcmorris@mitre-bedford.ARPA (Joseph C. Morris) (12/03/88)

In article <36835@clyde.ATT.COM> rjs@moss.ATT.COM writes:
>
>A simple mnemonic was provided by someone on the net a few months ago
>to help remember the difference between expanded and extended memory.
>
> [extended=long/thin, expanded=short/fat mnemonic discussion]

Another one I've seen on the net which helps me is:

exTended: what you get with an AT.  Memory is available as normal, DOS-
managed address space.  Available only on '286 and higher systems; no 8088's
need apply.

exPanded: what you get with a Paged interface like LIM, under which you
have a small (like 64K) page window with support software which responds to
special calls to remap the window address space to an area within the
LIM memory (which is not otherwise addressable by the 8088-type CPU).
Works fine with old 8088 chips since there is no need to address physical
memory beyond the 20-bit address bus.

simon@ms.uky.edu (Simon Gales) (12/04/88)

In article <42393@linus.UUCP> jcmorris@mbunix (Morris) writes:
>
>exTended: what you get with an AT.  Memory is available as normal, DOS-
>managed address space.  Available only on '286 and higher systems; no 8088's
>need apply.
>

Just to avoid another round in this discussion, exTended memory is normal
memory on an AT that is beyond the 1meg 'barrier'.  The 'barrier' is there
because the 286 cannot access it without using protected mode.

(Actually the first 64k of exTended ram can be accessed but this is another 
 story)

DOS cannot execute code from exTended ram, so programs must still fit into
the 1st 640k.  Virtual (Ram) disks, print spoolers, FastOpen (DOS 4.0),
BUFFERS= (DOS 4.0), and exPanded memory emulators are some things that can 
use exTended memory.

/--------------------------------------------------------------------------\
| Simon Gales@University of Ky         UUCP:   {rutgers, uunet}!ukma!simon |
|                                      Arpa:   simon@ms.uky.edu            |
| MaBell: 263-2285/257-3597            BitNet: simon@UKMA.BITNET           |
\--------------------------------------------------------------------------/
-- 
/--------------------------------------------------------------------------\
  Simon Gales@University of Ky         UUCP:   {rutgers, uunet}!ukma!simon 
                                       Arpa:   simon@ms.uky.edu 
  MaBell: 263-2285/257-3597            BitNet: simon@UKMA.BITNET  

leefi@microsoft.UUCP (Lee Fisher) (12/05/88)

Just another entry in the long list of messages attempting to
distinguish expanded memory from extended memory. This one was
instigated by a misconception stated in an earlier message, which
stated that the data from the DOS 4.0 commands FASTOPEN and BUFFERS
use extended memory. This is not true. FASTOPEN and BUFFERS will use 
expanded (EMS) memory when the /X switch is used, and conventional 
memory if the /X switch is not used. They will NOT use extended memory.

Here's something I wrote which discusses (in very general detail) the
various forms of memory that are available in a MS-DOS environment.
It is heavily biased towards including XMS memory and describing the
drivers included by MS-DOS and PC-DOS 4.0. It tends to discuss
extended memory as XMS memory, and discusses the logical components
that an XMM breaks down extended memory into. Unfortunately, the
addition of XMS and XMA memory and some of their subdivisions may
very well confuse this general discussion of extended -vs- expanded
memory... I just hope that I don't include any incorrect statements
below. If so, please send me any incorrect statements, so I can
update the document, and resend it if I've said anything grossly
wrong or misleading. Although I don't really see a need, I guess I
should say something to the effect of:

Copyright (C) 1988 Lee Fisher, All Rights Reserved. The author makes no
warranty for the use of this information and assumes no responsibility 
for any errors which may appear in this document.

----- snip ----- snip ----- snip ----- snip ----- snip ----- snip -----

A General Tutorial on the Various Forms of Memory in a DOS Environment
                 by Lee Fisher (leefi@microsof.UUCP)

Introduction

This article provides a general description of the different forms of
memory available in the MS-DOS environment on PC and PS/2 systems. It
also discusses what kinds of software use these different areas, and
what drivers are needed to create and control some of these areas. 
 
The first section of this article "The Memory Map," shows a memory map
that outlines the layout of these different forms of memory. The next
section, "Types of Memory," discusses the major forms of memory, and
their physical and logical components and drivers. The "Equations"
section gives some handy equations for showing how these areas of
memory can be used or emulated. After this is the "Memory Drivers"
section, which gives a brief description of the memory management
device drivers mentioned in this article. The last section "Further
Reading," gives additional reading material for more information on
some of these forms of memory. 
 
There are many forms of memory: conventional, extended, EMS, XMA, and
XMS. Below is a description of each form of memory, and how they
relate; because there are many relationships, you may have to read the
following material twice to eliminate any references to undefined
terms.
 
The Memory Map

The following is an illustration that shows the various components of
memory that are available (please note that it is a very general map): 
 
    32M +--------------------------------------------+
        |                                            |
        | expanded memory board                      | ----+
        |                                            |     |
      0 +--------------------------------------------+     |
                                                           |
                                                           |
        +------------------------------------------- +     |
        |                                            |     |
        | built-in memory                            |     |
        |                                            |     |
    nM* +--------------------------------------------+     |
        |                                            |     |
        | extended memory (1M-nM*)                   |     |
        |                                            |     |
        +- - - - - - - - - - - - - - - - - - - - - - +     |
        |                                            |     |
        | high memory area (FFFF:0010-FFFF:FFFFh)    |     |
        |                                            |     |
     1M +--------------------------------------------+     |
        |                                            |     |
        | upper memory area (640K-1M)                |     |
        |                                            |     |
        +- - - - - - - - - - - - - - - - - - - - - - +     |
        |                                            |     |
        | expanded memory page frame (64K)           | <---+
        |                                            |
        +- - - - - - - - - - - - - - - - - - - - - - +
        |                                            |
        +- - - - - - - - - - - - - - - - - - - - - - +
        |                                            |
        | extended bios data area (1K)               |
        |                                            |
   640K +--------------------------------------------+
        |                                            |
        | conventional memory (0K-640K)              |
        |                                            |
      0 +--------------------------------------------+
 
 
        +--------------------------------------------+
        |                                            |
        | IBM expanded memory adapter (XMA)          |
        |                                            |
        +--------------------------------------------+
 
* nM = 16 megabytes on an 80286, 4 gigabytes on an 80386
 
Types of Memory

1. Conventional Memory
 
   Intel 8086 systems can address 1 megabyte of memory. (Later systems
   can address more, in other modes.) On PC and PS/2 systems, this is
   divided into the Conventional Memory Area and the Upper Memory
   Area. 
 
   The Conventional Memory Area is the 0K-640K section of "normal"
   memory. This area of memory is used by MS-DOS and normal application
   software. 
 
   The Upper Memory Area is the 640K-1 megabyte section of memory that
   normally contains video adapter buffers, network card buffers, and
   other buffers and work areas for peripherals and the ROM BIOS. It
   is also normally used on EMS systems to store the Expanded Memory
   Page Frame. This area of memory is normally used by the ROM BIOS
   and peripherals, such as the Expanded Memory Manager. 

   On PS/2 systems, the top 1KB of conventional memory can be used for
   the Extented BIOS Data Area, a work area of the PS/2 ROM BIOS. In
   order to accomplish this, the ROM BIOS lowers the amount of 
   conventional memory that is reported by ROM BIOS interrupt 12h by 1KB.
   (Thus PS/2 systems with 640KB of conventional memory only have 639KB
   free conventional memory usable by DOS and applications.

2. Extended Memory
 
   The Extended Memory Area is an area of memory that is available
   only on 80286 and 80386 systems. This memory begins at 1 megabyte.
   On 80286 systems the upper limit is 16 megabytes; on 80386 systems
   the upper limit is 4 gigabytes. This memory is only addressable
   while in protected mode. It is normally used by systems software
   (RAMDrive, SMARTDrive, VDISK, EMM386.SYS, XMAEM.SYS, and
   HIMEM.SYS). 

   [Warning: Begin blatant XMS plug: :-)]

   Extended memory is not easy to use by applications software. There
   are many ROM BIOS and OEM hardware dependencies, such as the use of
   the A20 line, and noncontiguous memory on some systems. The ROM BIOS
   has services to determine how much extended memory is free, and to
   move it, but there are no ROM BIOS services for allocating extended
   memory. Thus, various allocation stratagies have come about, which
   often conflict. The solution to these problems is to use an eXtended
   Memory Manager (XMM). See the section on XMS memory for more on this.
   The services provided by the XMM provide a portable, hardware and ROM
   BIOS independent method of accessing extended memory.

   [End blatant XMS plug]
 
   Built-In Memory (BIM) is a form of memory that exists on Compaq and
   some other 80386 OEM systems. These systems have 1 megabyte of
   conventional memory on their motherboard, and this extra 384K of
   "built-in memory" is mapped to the top of extended memory, because 
   the Upper Memory Area already occupies the upper 384K of
   conventional memory. This area of memory is normally used by
   systems software. HIMEM.SYS uses this memory and includes it in its
   Extended Memory Blocks, if it is available. (Many other OEM systems 
   also have 1MB of memory on their motherboard. In most other cases, 
   the top 384K of otherwise unused memory is mapped into the first 
   384KB of Extended Memory.) 
 
3. Expanded (EMS) Memory
 
   An Expanded Memory Board is a separate board that contains EMS
   memory of up to 32 megabytes, which can be addressed on any Intel
   80x86 system by paging 15K portions of memory into the Expanded
   Memory Page Frame, located in the Upper Memory Area. 
 
   The Expanded Memory Page Frame, normally located in the Upper
   Memory Area, is a collection of 16K physical pages from which an
   application program accesses expanded memory. These page frames are
   memory frames paged in from the Expanded Memory board. This area of
   memory is controlled exclusively by the Expanded Memory Manager
   (such as EMM386.SYS), which is in turn called by systems software
   (such as Buffers/X, Fastopen/X, SMARTDrive, RAMDrive, VDISK,
   MSCDEX, and Windows) and applications software (such as Excel and
   the Programmer's Library).
 
4. XMA Memory
 
   An IBM Expanded Memory Adapter (XMA) is a separate board that
   contains IBM (or compatible) XMA memory, which can be addressed as
   either Expanded Memory or Extended Memory, with the appropriate
   software drivers. XMA memory is, as far as I know, IBM proprietary.
 
5. XMS Memory
 
   XMS memory is the collection of the Upper Memory Area and the
   Extended Memory Area, and is controlled by an eXtended Memory
   Manager (XMM) such as HIMEM.SYS. The Extended Memory Area is only
   available on 80286 and 80386 systems. The Extended Memory Area is
   broken up into two logical areas by the XMM: the High Memory Area
   and Extended Memory Blocks. Thus, XMS memory consists of the Upper
   Memory Area, the High Memory Area, and the Extended Memory Area. 
 
   The High Memory Area (HMA) is 64K of memory located at the
   beginning of the Extended Memory Area. It exists only on 80286 and 
   80386 systems with extended memory. This area only exists in a
   controlled, easily accessible manner when HIMEM.SYS or another XMS
   driver is installed. This area of memory is controlled exclusively
   by the eXtended Memory Manager (such as HIMEM.SYS), which is in
   turn called by systems software (such as Windows and DOS LAN
   Manager) and applications software.
 
   Upper Memory Blocks (UMBs) are blocks of memory that are available
   on some 80286 and 80386 systems and are located in the
   Upper Memory Area. The number, size, and location of these blocks
   vary widely, depending upon the types of hardware adapter cards
   installed in the machine. The XMS specification creates these
   abstract data types. (HIMEM.SYS currently does not implement UMBs,
   however the driver 386^Max by Qualitas does.)
 
   Extended Memory Blocks (EMBs) are blocks of extended memory. The
   XMS specification creates these abstract data types. This area can
   only be used for data storage, i.e., they cannot be used to store
   code. They exist to allow systems and applications software to
   allocate extended memory, which is otherwise very difficult to
   address and manipulate in a controlled manner. 
 
General Equations
 
The following are some rules and "equations" for combining,
modifying, and emulating some of these forms of memory to make it
useful by systems and applications software. The goal is to find an
equation for a form of memory that is usable by the applications that
you use...
 
   <extended memory> = usable by some applications

   <XMS memory> = <upper memory> + <extended memory> + HIMEM.SYS

   <XMS memory> = usable by some applications
 
   <XMA memory> = proprietary memory adapter of IBM
    
   <XMA memory> = <80386 system> + <extended memory> + XMAEM.SYS
 
   <EMS memory> = <XMA memory> + XMA2EMS.SYS
 
   <EMS memory> = <80386 system> + <extended memory> + EMM386.SYS

   <EMS memory> = usable by MS-DOS and some applications
 
This means the two-stage system needed by IBM PC-DOS owners to convert
their 80386 extended memory into EMS memory is as follows: 
 
   <EMS memory> = <80386 system> + <extended memory> + XMAEM.SYS + 
                  XMA2EMS.SYS
 
The one state processed is needed by Microsoft MS-DOS users to convert
their 80386 systems to EMS memory is as follows:
 
   <EMS memory> = <80386 system> + <extended memory> + EMM386.SYS
 
People who have 80386 systems, extended memory, and MS-DOS can use
EMM386.SYS to obtain EMS memory, while people who have the same system
and memory with IBM PC-DOS must use two drivers, XMAEM.SYS and
XMA2EMS.SYS, in order to achieve EMS memory. 
 
People who have 80286 systems and want to use their extended memory
as EMS memory will not be able to use the existing drivers included
with MS-DOS. Some of these extended memory boards come with EMS
emulators, which could be used.
 
Memory Drivers
 
The Microsoft driver HIMEM.SYS takes over 80286 and 80386 extended
memory, converting it to the Extended Memory Area of the XMS
specification. It also takes the first 64K of this extended memory
area and converts it into the High Memory Area. 
 
The IBM PC-DOS Version 4.00 driver XMAEM.SYS takes IBM PS/2 Model 80
80386 extended memory and uses it to emulate IBM XMA memory. (Used in
conjunction with the XMA2EMS.SYS driver, it is possible to use this
memory as EMS memory.) 
 
The IBM PC-DOS Version 4.00 driver XMA2EMS.SYS takes IBM XMA memory
(or the emulated XMA memory created by the XMAEM.SYS driver) and uses
it to emulate LIM/EMS memory. 
 
The Microsoft MS-DOS Version 4.00 driver EMM386.SYS takes 80386
extended memory and uses it to emulate LIM/EMS memory. 
 
Further Reading
 
For more information on LIM/EMS memory, refer to the official
specification, the "Lotus/Intel/Microsoft Expanded Memory
Specification Version 4.0," jointly developed by Lotus Development
Corporation, Intel Corporation, and Microsoft Corporation, which is
available free from Intel by calling (800) 538-3373. 
 
For more information on XMS memory, refer to the official
specification, the "eXtended Memory Specification Version 2.0,"
jointly developed by Microsoft Corporation, Lotus Development
Corporation, Intel Corporation, and AST Research, Inc., which is
available free from Microsoft by calling (800) 426-9400. (Make sure
that you ask for the supplemental XMS diskette, too.) 
 
For more information on the memory services and the Extended BIOS Data
Area of IBM PS/2 and compatible OEM systems, refer to the "IBM PS/2
and PC BIOS Interface Technical Reference," part number 68X2260,
available from IBM by calling (800) IBM-PCTB. (Another reference that
contains similar material is the Microsoft Press book "Programmer's
Quick Reference Series: IBM ROM BIOS," by Ray Duncan, ISBN
1-55615-135-7.) 
 
For more information on Compaq Built-In Memory (BIM), refer to the
"Compaq DeskPro 386 Personal Computer Technical Reference Guide,"
available from Compaq.

----- snip ----- snip ----- snip ----- snip ----- snip ----- snip -----

-Lee

01001100 Lee Fisher, Microsoft Corporation, Redmond, WA.
01000101 leefi@microsof.UUCP  leefi%microsof@uw-beaver.ARPA
01000101 leefi@microsof.beaver.washington.EDU
01000110 {uw-beaver,decvax,decwrl,intelca,sco,sun,trsvax,uunet}!microsof!leefi
01001001 Everything mentioned here is MY fault, not my employer's.

Robert_Bruce_Ferrell@cup.portal.com (12/09/88)

Now that we've covered all of those others...  what is the difference between
EMS and EEMS?

Sorry if this has been covered before... never thought I'd need to know %-}

ray@micomvax.UUCP (Ray Dunn) (12/10/88)

In article <42393@linus.UUCP> jcmorris@mbunix (Morris) writes:
>In article <36835@clyde.ATT.COM> rjs@moss.ATT.COM writes:
>>
>> [extended=long/thin, expanded=short/fat mnemonic discussion]
>
>Another one I've seen on the net which helps me is:
>
>exTended: what you get with an AT.  Memory is available as normal, DOS-
>managed address space.  Available only on '286 and higher systems.....

Available on '286 and higher only but *NOT* DOS-managed!!!!!!

Why is 9 lines of (incorrect) explanation a better *mnemonic* than what was
quoted?
-- 
Ray Dunn.                      |   UUCP: ..!philabs!micomvax!ray
Philips Electronics Ltd.       |   TEL : (514) 744-8200   Ext: 2347
600 Dr Frederik Philips Blvd   |   FAX : (514) 744-6455
St Laurent. Quebec.  H4M 2S9   |   TLX : 05-824090