Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : QWHITE13.ZIP
Filename : SHADOWRM.TEC

 
Output of file : SHADOWRM.TEC contained in archive : QWHITE13.ZIP

ID:SR ShadowRAM, Top Memory, and QEMM-386
Quarterdeck Technical Note #224 Filename: SHADOWRM.TEC
by Quarterdeck Testing & Compatibility CompuServe: SHADOW.ZIP
Last revised: 12/26/91 Category: QEMM

Subject: A discussion of ROM shadowing; how this feature is implemented in
hardware on some machines, and how QEMM can provide ROM shadowing on
systems that don't implement it in hardware.


SHADOWRAM & TOP MEMORY

This document discusses copying ROMs into RAM, explaining how this
service is performed by the hardware of many DOS computers, by QEMM-386, and
by some third-party programs.

WHAT IS SHADOWRAM?

ShadowRAM is 384K of RAM that can be mapped into the address space
between 640K and 1024K. What computers use it for is to copy the contents of
the system BIOS ROM, perhaps video ROM, and, less likely, other ROMs (disk
controller ROM, network card ROM, etc.) into RAM, where it will run more
quickly. RAM is read more quickly than ROM both because RAM is faster and
because ROM is read eight bits at a time (or sixteen bits at a time on some
machines) while RAM is read 32 bits at a time (on a 386 or 486) or 16 bits at
a time (on a 386sx).


HOW DO I KNOW IF I HAVE SHADOWRAM?

The QEMM-386/Memory screen of MANIFEST will indicate that you have
ShadowRAM on the line underneath the Extended line.


ARE MACHINES WITH CHIPS & TECHNOLOGIES MOTHERBOARDS THE ONLY MACHINES WITH
SHADOWRAM?

While ShadowRAM was invented by Chips & Technologies other computers
(including IBM PS/2s) may have RAM reserved for a similar purpose. QEMM-386
will not detect this reserved RAM on machines that do not use Chips &
Technologies or compatible ShadowRAM. ShadowRAM that is not Chips &
Technologies or compatible ShadowRAM may not be 384K but some smaller amount.
If the documentation or system setup of your computer does not tell you
whether you have this feature you can look at the QEMM-386/Memory screen of
MANIFEST in order to discover whether you have this feature because the amount
of memory reported in the Initial column of the Total line will not match the
total amount of memory in your system if your computer has ShadowRAM that QEMM-
386 does not use. On an IBM PS/2 the discrepancy is 128K. The QEMM-
386/Memory screen will only report Chips & Technologies (or compatible)
ShadowRAM on a ShadowRAM line in Manifest.


HOW CAN I TELL IF MY SHADOWRAM (OR EQUIVALENT) IS WORKING?

The FirstMeg/Timings screen of MANIFEST reports that the portions of the
address space occupied by ROM run about as quickly as conventional memory
(usually 0000-9FFF) if your ROMs are being shadowed (copied into RAM).


WHAT IF MY MACHINE DOES NOT PROVIDE THIS FEATURE?

QEMM-386 can shadow ROMs. It does this by copying the contents of the
ROM into RAM, mapping this RAM into the address space occupied by the ROM,
then write-protecting this RAM. You get this feature by putting the ROM
parameter on the QEMM386.SYS line of the CONFIG.SYS. First Meg/Timings will
demonstrate that this is working.
It is possible to shadow only some of your ROMs with QEMM-386. The ROM
parameter can be used to shadow only a limited portion of the address space by
using, say, ROM=C800-CBFF. This parameter can be used multiple times to
shadow different ROMs. A good reason to do this is if you have ROM on an add-
in card in a machine that is shadowing the system and video ROMs in hardware.
The IBM PS/2 has 128K of RAM reserved to shadow the system and video ROM in
E000-FFFF. If you use the ROM parameter on the QEMM line then QEMM would
waste 128K of RAM to duplicate this feature. If you have a ROM on the disk
controller card or network card or the like then the PS/2 is not shadowing it.
You can use QEMM to shadow only the adapter ROM with a restricted ROM=MMMM-
NNNN parameter, where MMMM is the beginning address of the adapter ROM and
NNNN is the ending address of the adapter ROM.

SHOULD I USE QEMM-386's ROM PARAMETER WHEN MY MACHINE IS ALREADY SHADOWING
ROM?

No. This will cause QEMM-386 to waste the memory it uses to shadow the
ROM, duplicating a feature already being provided by your hardware. Shadowing
a ROM twice will not improve system performance.
If your system is shadowing some, but not all of the ROMs, then a
restricted ROM=MMMM-NNNN parameter can be used to shadow only those ROMs not
being shadowed by the system already. See the above paragraph for discussion
of this.
On some systems the 384K of ShadowRAM can be used as extended memory
instead. On such systems it is a more efficient use of memory to have QEMM-
386 perform the service of shadowing the ROMs because QEMM-386 will only use
the amount of memory to shadow the ROMs equal to the amount of ROM to shadow.
It is is more common for the ShadowRAM not to be usable as extended memory.
On such machines, one wastes the ShadowRAM by disabling it.


WHAT HAPPENS IF I ROM A PORTION OF THE ADDRESS SPACE THAT QEMM-386 IS NOT
DETECTING AS ROM?

Nothing other than stop mapping the portion of the address space
specified as an argument to the ROM parameter. QEMM-386 will not shadow a ROM
it does not detect as a ROM.

WHAT DOES THE NOSHADOWRAM (NOSH) PARAMETER DO?

The NOSH parameter tells QEMM-386 not to use the system's unused
ShadowRAM. On machines with Chips & Technologies (or compatible) ShadowRAM
(the only kind QEMM-386 can use) there is 384K of ShadowRAM. Since no
computer has 384K of ROM to shadow some portion of this ShadowRAM is unused.
QEMM-386 tries to grab the unused portion of the ShadowRAM and allocate it to
the pool of useful memory. It turns out that some programs may not function
properly if ShadowRAM is being used as Expanded Memory or High RAM (the
purposes to which QEMM-386 puts it); or some other company's implementation of
ShadowRAM may be sufficiently alike to Chips & Technologies ShadowRAM for QEMM-
386 to detect and try to use it even though it is not actually usable by QEMM-
386. Because this may happen the NOSH parameter was invented. Using the NOSH
parameter does NOT affect the system's use of ShadowRAM to shadow ROMs, it
simply prevents QEMM-386 from attempting to use the ShadowRAM.


HOW DOES QEMM-386 USE THE SHADOWRAM?

QEMM-386 creates High RAM and Expanded Memory by placing memory in the
previously unused address space between 640 and 1024K: this is called
mapping. You can tell what portions of the address space QEMM-386 is mapping
by looking at the First Meg/Overview screen of Manifest: all of the address
space which is marked as "High RAM", "Page Frame", "Mappable", or "Rammable"
is being mapped by QEMM-386. QEMM-386 uses all the ShadowRAM in the address
space it is mapping.
For any portion of the address space that QEMM-386 is not mapping (where
there are ROMs being shadowed by the system; portions of the address space
being occupied by other devices, such as the video card; portions of the
address space from which QEMM-386 is EXCLUDEd) QEMM-386 does not use the
ShadowRAM.
ShadowRAM must be used in 16K increments and on 16K boundaries. An
entire 16K piece of ShadowRAM will not be used by QEMM-386 if any portion of
the 16K piece is not being mapped by QEMM-386. This is why a 4K exclude can
cause QEMM-386 to stop recovering a whole 16K of ShadowRAM.
QEMM-386 Stealths a Shadowed ROM in the same manner that it Stealths an
unshadowed ROM. The service hardware ShadowRAM provides is still active when a
ROM is Stealthed. This is why no additional ShadowRAM is used by QEMM-386
when Stealthing even though it maps a larger portion of the address space.


WHAT ABOUT RAMBIOS.SYS, FASTBIOS.SYS, RAPIDBIO.SYS...?

These programs (and others like them) copy the video ROM into RAM to
provide the same shadowing feature that ShadowRAM provides, but for the video
ROM only. These programs use conventional memory (or High RAM, if QEMM loads
them high) to load their code and make a copy of the video ROM. If your system
is already providing this feature in hardware, this is a waste of memory. The
ROM shadowing feature of QEMM-386 provides the exact same service when used to
shadow the video ROM but does not load any extra code or use any additional
conventional memory or High RAM. This is much more efficient. For those who
have their video ROM at C000-C7FF, the appropriate ROM parameter is ROM=C000-
C7FF.

WHAT IS TOP MEMORY?

Some machines (notably Compaqs and those with Micronics motherboards)
have a kind of memory called Top Memory. This memory is in the Extended
memory address space at 16000-16384K, the "top" of the 16 Meg address space.
(The 80286 chip is limited to addressing 16 MB of memory.)


WHY IS THERE TOP MEMORY?

If you have one megabyte of memory installed in your computer, 640K of
it is conventional memory and 384K is left over. In most machines this 384K
is extended memory, beginning at 1024K, ending at 1408K. Some add-in extended
memory cards cannot begin addressing memory at 1408K, being limited to
beginning addressing on multiples of 512K. Putting this 384K of memory at the
"top" of the address space leaves the address space beginning at 1024K free.

FOR WHAT DOES THE MACHINE USE TOP MEMORY?

Many of these machines use their Top Memory to shadow ROMs. In some
cases they do this by mapping a portion of the Top Memory into "vacant"
address space between 640K and 1024K and copying the contents of the target
ROM into this RAM. A classic use of Top Memory for this purpose is to map
memory into E000-E7FF and copy the contents of the video ROM into this memory.
Compaq does this, though their video ROM is 24K large (E000-E5FF).


HOW DO I KNOW IF I HAVE TOP MEMORY?

The QEMM-386/Memory screen of MANIFEST will report the existence of Top
Memory on the line underneath the Extended line.


WHAT DOES THE NOTOPMEMORY (NT) PARAMETER DO?

This parameter tells QEMM-386 not to try to take control of the unused
portion of the Top Memory. Using this parameter does NOT stop the system from
using Top Memory to provide the services Top Memory already performs with Top
Memory. On Compaq computers QEMM-386 even takes control of the 128K portion
of the Top Memory that Compaq uses to shadow ROMs, then QEMM-386 shadows the
appropriate ROMs to provide the same service. This action of QEMM- 386
continues even when the NT parameter is used. The NCF parameter will cause
QEMM-386 to stop appropriating this portion of the Compaq's Top Memory.


SHOULD I USE TOP MEMORY OR QEMM-386 TO SHADOW MY ROMS?

You will probably find that if you use Top Memory to shadow your ROMs
that it uses more memory than is necessary because the Top Memory usually
needs to be used in 64K increments, while you may have a ROM that is not 64k
large. If QEMM-386 is controlling your unused Top Memory then if you let QEMM-
386 shadow the ROMs only as much RAM as is necessary to shadow the ROM will be
used and QEMM-386 will recover all the unused Top Memory. It is, of course, a
waste of memory to shadow your ROMs both with the system's Top Memory and QEMM-
386. Note that the portion of the address space into which the computer maps
Top Memory to shadow its ROMs must be excluded from QEMM-386's mapping. The
common location for this is E000-E7FF. This cost of 32K of address space is
another good reason to stop shadowing ROM with the system's Top Memory and let
QEMM-386 do it. On Compaqs, QEMM-386 does this automatically. The
NOCOMPAQFEATURES (NCF) causes QEMM-386 not to do this automatically.


SUMMARY

Copying ROMs into RAM is a way to speed up your system's performance.
Many machines do this in the hardware. QEMM-386 can also provide this feature
with the ROM parameter. You can tell if your system hardware or QEMM-386 is

performing this service by looking at the First Meg/Timings screen of
MANIFEST: If a portion of the address space occupied by ROM is running about
as fast as conventional memory (usually 0000-9FFF) then that ROM is being
shadowed. There are also third-party programs (such as RAMBIOS.SYS,
RAPIDBIO.SYS, FASTBIOS.SYS) that can shadow video ROMs. It is usually best to
enable the ShadowRAM feature in the hardware setup. If your system does not
have this feature in the hardware setup you may wish to have QEMM-386 provide
it. It is a more efficient use of address space to have QEMM-386 provide this
feature, instead of a third-party program. In any case it is wasteful to have
more than one provider performing this service.


************************************************************************
*This technical note may be copied and distributed freely as long as it*
*is distributed in its entirety and it is not distributed for profit. *
* Copyright (C) 1990-2 by Quarterdeck Office Systems *
************************ E N D O F F I L E *************************