
                Why the EMS Page Frame is Important

 Quarterdeck Technical Note #295              Filename: FRAME.TEC
 by Michael Bolton                          CompuServe: FRAME.TEC
 Last revised:  4/02/95                       Category: QEMM

 Subject: How the EMS page frame can save much more than the 64K of
          High RAM than it requires, and why disabling the page
          frame is a bad idea.

 Technical support staff at some companies will sometimes suggest
 that you disable the expanded memory page frame in order to get
 64K more High RAM.  This is short-sighted and wasteful.  The
 expanded memory page frame is one of the most valuable resources
 available to increase the amount of memory available to your DOS
 programs.

 To understand the usefulness of the EMS page frame in a
 non-technical way, suppose an empty space, 16" x 12", on an
 otherwise blank wall in your living room.  Some people might put
 up a painting (which displays one thing, all the time), but most
 would prefer a television screen (in which you can see what you
 want, when you want to see it).

 On a more technical level, the page frame is a 64K window of
 address space, typically located above the 640K line, that can be
 shared and used by multiple programs to reduce their overhead.  To
 understand how expanded memory works, it is most useful to
 understand the concept of mapping.  Mapping is the process by
 which memory management hardware and software can make memory
 appear in appropriate places at appropriate times; it is the
 process of associating memory with an address other than its
 actual one.  The expanded memory specification (EMS) uses mapping
 to make portions of expanded memory appear inside the EMS page
 frame when that memory is requested by a program.  When a program
 needs more memory than what is normally available to it under DOS,
 it can request that some expanded memory be allocated from either
 an EMS board, or from the extended memory managed and made to
 appear as expanded memory by a 386 memory manager such as QEMM.

 Expanded memory has no addresses of its own, but can be made to
 appear at a valid address -- "mapped in".  Expanded memory pages
 that are not currently needed may be "mapped out" -- relieved of
 their addresses and put back into the expanded memory pool, with
 code and data still intact. When the application needs these
 pages, they are "mapped in" to the EMS page frame again.  It is
 therefore possible for a program that uses expanded memory to have
 access to much more memory than DOS itself can see of its own
 accord.  This is similar in concept to bank switching and paged
 memory systems, techniques used to extend and add power to
 everything from mainframe computers to high-end UNIX systems to
 DOS machines.  Any program loaded on your system may use EMS at
 any time, even while other programs have access to it.

 Mapping is also useful for creating High RAM; in the same way as
 detailed above, memory can be associated with unused addresses
 between 640K and 1MB.  The 386 hardware and QEMM cooperate to make
 memory appear where there is otherwise none; this memory is called
 High RAM. Programs can be loaded into High RAM instead of
 conventional memory. This allows more room in conventional memory
 for DOS programs.  Unlike the page frame, however, only one
 program at a time can occupy a block of High RAM.

 QEMM's StealthROM feature uses mapping for yet another purpose.
 The 386 chip can be made to map memory in or out of DOS' address
 space at any time.  StealthROM uses the page frame and 386 mapping
 to map system, disk, or video ROMs in and out of DOS' address
 space when appropriate. More information on StealthROM is
 available in Quarterdeck Technical Note #168, QEMM's StealthROM
 Technology (STLTECH.TEC).

 The Quarterdeck Expanded Memory Manager, QEMM, provides expanded
 memory services, allowing any EMS-using program on your system to
 take advantage of expanded memory.  QEMM itself also takes
 advantage of expanded memory for its StealthROM, SqueezeFrame, and
 Stealth D*Space features.

 Thus any advice to remove the page frame is penny-wise and
 pound-foolish.  Remember that the page frame is 64K of address
 space that can be used any program, at any time, to access
 effectively as much memory as it likes.  Some view the page frame
 as 64K of address space that could be used to hold up 64K of
 programs, but it is much more useful to consider the page frame as
 a place to access up to 32 megabytes of code and/or data for the
 programs that use it.  The distinction is very similar to the
 difference between a TV and a painting.

 On an example system, with the page frame enabled, StealthROM can
 create an 83K of extra High RAM.  This alone justifies the
 investment in the page frame, returning an extra 19K.  Stealth
 D*Space can also use the page frame, reducing the overhead for
 Microsoft's DoubleSpace or DriveSpace disk compression utilities
 by 40K.  Stacker's EMS feature can permit similar memory gains.

 This example system is on a Novell network.  If the page frame is
 enabled, one may use EMSNETX as the network redirector instead of
 NETX. The overhead for the latter is 44K; for the former it's a
 little less than 10K.  When EMS is available, VSAFE, on that
 system, reduces its overhead from 22K to 6.5K; MSCDEX goes from
 35K to 15K, and so on. Thus 194K of code is loaded for an
 investment of 64K, at a net savings of 130K.

 In addition to these savings, EMS is also available to DOS
 application programs that can use it.  If an application uses EMS,
 it can reduce its conventional memory overhead dramatically,
 and/or improve its performance.  The Lotus 1-2-3 Release 2 series,
 the most widely-installed version of Lotus, uses expanded memory;
 WordPerfect 5.1 similarly uses expanded memory. Neither of these
 programs uses XMS (or any other flavour of) extended memory. VCPI,
 a memory management specification for DOS Extended applications,
 depends on an expanded memory manager to be present. Not all VCPI
 applications require a page frame, but many of them attempt to map
 a page in the page frame, and refuse to run if they can't.

 In summary, it is imprudent to disable the EMS page frame in order
 to create more High RAM.  For a 64K investment, you can typically
 recover a good deal more memory.

 ******************************************************************
 *      Trademarks are property of their respective owners.       *
 *   This and other technical notes may be available in updated   *
 *     forms through Quarterdeck's standard support channels.     *
 *          Copyright (C) 1996 Quarterdeck Corporation            *
 ******************** E N D   O F   F I L E ***********************

