home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Pier Shareware 6
/
The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso
/
033
/
stltech.zip
/
STLTECH.TEC
Wrap
Text File
|
1994-12-14
|
19KB
|
337 lines
ID:QS QEMM's Stealth ROM Technology
Quarterdeck Technical Note #168 Filename: STLTECH.TEC
by Michael Bolton CompuServe: STTECH.ZIP
Last revised: 12/14/94 Category: QEMM
Subject: An overview of QEMM's Stealth ROM technology -- how it works,
why it works so well, and what can cause complications for it.
PLEASE NOTE: Unless otherwise indicated, references to the 386 processor
include all 386 and higher processors.
Q: What is Stealth Rom?
A: Traditionally, 386 memory managers such as QEMM have been able to
create High RAM by associating physical extended memory with unused
addresses between 640K and 1MB. Quarterdeck's Stealth ROM technology
(which is included with QEMM versions 6.00 and higher) is QEMM's
method of creating more High RAM than previously thought possible, by
mapping memory to addresses that are used by system, video, disk, and
other ROMs.
Q: How does Stealth ROM work?
A: To understand how Stealth ROM works, it is 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 EMS memory created by a 386 expanded memory
manager.
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. You may know this technology as
"bank switching," which is one of the techniques used to extend and
add power to everything from mainframe computers to high-end UNIX
systems to DOS machines.
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.
Stealth ROM uses mapping for a new purpose. The 386 chip can be made
to map memory in or out of DOS' address space at any time. Stealth ROM
uses 386 mapping to map system, disk, or video ROMs in and out of DOS'
address space when appropriate, using one of two strategies -- ST:M or
ST:F.
Q: What is the difference between ST:M and ST:F?
A: ROMs on your system are accessed via interrupts, which are
conceptually similar to BASIC subroutines. When your system boots up,
it sets up something called an interrupt vector table. This is a list
of addresses where specific ROM subroutines can be found. When a
program on your system needs a certain ROM function (for example,
writing colored text to the screen), it sets up some data in
appropriate places, and then calls the interrupt with a processor INT
instruction. The processor then looks at the interrupt vector table to
find out the address where the ROM function can be found. The
processor transfers control to that address, the ROM subroutine gets
run, and then control is returned to the calling program.
When you use Stealth ROM, as your system boots QEMM takes control of
interrupts that are in use by the ROMs on your system and points those
interrupts into itself. This way, QEMM can monitor exactly when a ROM
interrupt occurs, and can manage the interrupt appropriately.
When you use ST:M ("Mapping Method"), QEMM maps system, video, and
disk ROMs and any other "Stealthable" ROMs out of the first megabyte.
(For information on what is "Stealthable," see "How can Stealth ROM
fail?" below.) When the ROM is needed by the system, QEMM maps the
appropriate ROM code into the expanded memory page frame. The ROM
code now has a valid address at which it can execute, and it does so
normally. When the ROM routine is finished, QEMM then remaps the ROM
elsewhere out of the address space.
When you use ST:F ("Frame Method"), QEMM leaves the system, video, and
disk ROMs where they are normally found. QEMM then places the EMS
page frame on top of a ROM. Expanded memory can then be mapped into
the EMS page frame. When the ROM that has been hidden by the page
frame is needed, QEMM maps the ROM back into the page frame, at its
original address. The ROM code then executes normally. When the ROM
routine is finished, QEMM can then restore the contents of the EMS
page frame, and the ROM is mapped out again.
Q: Which Stealth ROM strategy is preferable?
A: Since ST:M is capable of mapping almost all ROMs out of DOS' address
space, and thus leaves you with much more High RAM, it is the better
of the two options. ST:F should only be needed on a very small number
of systems; its object is to ensure compatibility with machines that
have ROMs that jump to each other without using an interrupt to do so,
or with ROMs that need to execute at their original addresses.
Q: Do I have to have a special version of QEMM so that Stealth ROM will
work on my system? Does my system need to be one that Stealth ROM
knows about?
A: No to both questions! Stealth ROM is designed to work on ANY system,
regardless of brand, model, or ROM BIOS revision. You do not need a
special version of QEMM or Stealth ROM that has been customized for
your machine, because Stealth ROM's strategy merely relocates your
ROMs instead of replacing them. Stealth ROM does not modify, compress
or replace your ROM BIOS, and it does not depend on being aware of the
brand or revision of your ROMs. Additionally, Stealth ROM will
typically create more High RAM on your system than any other memory
management technique. You do not have to disable any of QEMM's
features -- EMS, XMS, DPMI, or VCPI memory management -- as other
memory managers force you to do in order to squeeze every last byte of
High RAM from your system.
Q: Does Stealth ROM slow my system down?
A: Stealth ROM does add some tiny amount of overhead to ROM BIOS
interrupts. Since most application programs spend very little time
calling ROM code, the slowdowns are usually imperceptible or
insignificant to the user. Ironically, since benchmark programs often
call ROM interrupts repeatedly (some do almost nothing but this), the
greatest slowdown will be seen in some benchmark results; these
results rarely have much to do with the speed of useful programs,
however. Since your application programs typically have much more
conventional memory to deal with when Stealth ROM is invoked, you are
much more likely to observe faster performance. Furthermore, QEMM
replaces some ROM video functions with its own faster code when
Stealth ROM is active, and QEMM's ROM parameter can provide additional
performance increases. Using Stealth ROM with the ROM parameter is
typically significantly faster than not using QEMM at all.
Q: How can Stealth ROM fail?
A: Stealth ROM is a robust and proven technology. However, some programs
and some system ROM implementations can interfere with Stealth ROM's
strategies. Note that the problems described here are infrequent
and/or system-specific, and that most users will experience no
difficulty at all with Stealth ROM.
* In the above description of how Stealth ROM works, each strategy
depends on a processor interrupt being asserted. This is the normal
way of calling a piece of ROM code; processor registers are loaded
with data and with information which denotes exactly which ROM service
is being requested, and then a processor INT instruction is called.
BASIC programmers will recognize that this is similar to the process
of initializing a few variables with data, and then calling a
subroutine with a GOSUB instruction; most good texts favor this method
of programming. However, it is possible (though relatively uncommon)
for a piece of code to JUMP to a specific ROM address, without
asserting an interrupt. This is analogous to a BASIC GOTO, rather
than a GOSUB; GOTOs are frowned upon by expert programmers, since a
GOTO presumes that the address to which the code is jumping will
remain constant and unchanging. This is less of a problem if one
person writes all the code, since it is easier for one person to keep
track of the proper destination addresses; when more than one person
is involved, it's more difficult to determine why and where the code
should branch.
If an application or utility jumps directly to a ROM address when
Stealth ROM is invoked, QEMM will not be able to intercept an
interrupt, and thus may not have a chance to make sure that the
appropriate portion of the ROM code is mapped into the page frame. If
QEMM's Optimize program detects this behavior, it can make the
application work properly with Stealth ROM by applying the
STEALTHTHUNK parameter, sacrificing a small amount of High RAM
(usually 4K) in order to intercept the direct jump, map the
appropriate ROM into the page frame, and divert the direct jump to the
proper address. If the behavior does not occur during the Optimize
process, it will probably be necessary to EXCLUDE a portion of the ROM
on the QEMM386.SYS line in the CONFIG.SYS.
* In the case of system setup programs and installation routines for
video cards (many of which access ROM addresses directly), it is far
better to disable QEMM temporarily than to use EXCLUDEs or sacrifice
the large amounts of extra High RAM that ST:M can provide. Setup
programs should need to be run infrequently, and typically require a
reboot before the modified settings take effect. High RAM is
generally much more useful. It is worth weighing the benefits of
instant access to your setup program against the extra High RAM that
Stealth ROM can provide; the decision should not be a difficult one.
The easiest way to deal with this is to disable QEMM, run your Setup
program, and reboot with QEMM active again. To disable QEMM
temporarily, hold down the <Alt> key immediately after you hear a beep
on bootup. QEMM will post a message telling you to press <Esc> to
unload QEMM, or any other key to continue with QEMM. Press <Esc>, and
run your Setup program. (If you are using the DOS-UP feature from
QEMM version 7.0 or later, you will first see a message asking if you
want to unload DOSDATA. Press <Esc> to unload DOSDATA, then hold down
the <Alt> key again until you see the message telling you to press
<Esc> to unload QEMM. After unloading QEMM, run your Setup program,
then reboot the machine normally (without holding down <Alt>); your
revised Setup will be in effect, and so will QEMM.
* Some ROMs are written in such a way that they jump internally to
addresses that are "hard-wired" into the ROM code. For instance, a
ROM that lives at address C000 may jump within itself using a full
address like C000:AD91, where a jump to offset AD91 would have had the
same effect. Jumps to explicit addresses can confound Stealth ROM, as
the ROM does not always execute at its original address. The best way
of getting around this problem is for the EMS page frame to overlay
the ROM in question; this means that the ROM will execute at its
original location without any sacrifice of High RAM. If you cannot put
the page frame over the offending ROM, the ST:F option is another
method of guaranteeing that all ROMs will execute at their original
addresses.
* Sometimes one ROM will jump directly into another ROM's code instead
of accessing the other ROM through interrupts. In such circumstances,
ST:F may be helpful, since the ROMs will all execute at their original
addresses, making both inter-ROM and intra-ROM jumps safe.
* Some programs find the address of a given piece of ROM at startup, and
then jump directly to that address later on, at a time when the ROM
may not be mapped into memory. Programs like these will often require
that a portion of the ROM be EXCLUDEd on the QEMM386.SYS line in
CONFIG.SYS.
* Some ROMs do not have any interrupts pointing to them at startup. If
this is the case, QEMM will not be able to detect where a given
interrupt should point, and thus may not invoke Stealth ROM for that
ROM.
* Some device drivers refuse to load unless they see an interrupt
pointing to its normal location; these programs can be loaded before
QEMM if necessary. Alternatively, Quarterdeck Technical Note #233,
"QEMM and the XSTI parameter" (XSTI.TEC), explains another way to
resolve this problem which usually results in more conventional memory
saved than if the driver is loaded before QEMM.
* Some programs make invalid assumptions about the EMS page frame. In
some cases, programs assume that the state of the EMS page frame will
remain unchanged even after they free an EMS handle; this is akin to
assuming that you can get your property back after leaving it at the
end of the driveway on garbage pick-up day. This fails with Stealth
ROM because, by default, the page frame is immediately un-mapped after
a handle has been abandoned -- as if, in the above example, the city
picks up the garbage pretty much immediately -- as soon as you get
back into your house. The UFP:N parameter suppresses this feature and
can make such careless programs work with Stealth ROM, perhaps at the
expense of some speed.
* Some applications assume that the contents of the page frame will be
the same at hardware interrupt time as they are when the main body of
the application is executing -- like assuming that your coat will
never get moved from the place in which you saw the cloakroom
attendant put it. This is an invalid assumption, and can cause
problems not only with Stealth ROM, but with EMS-using TSRs as well.
This is in plain violation of the Expanded Memory Specification.
* Other programs outright violate the Expanded Memory Specification by
placing their interrupt stacks in the page frame. This is not simply
a problem for Stealth ROM or for QEMM; this can cause a conflict with
programs using expanded memory and ANY expanded memory manager.
Fortunately, the programs that exhibit these problems are rare. If
you experience difficulty that is found to be Stealth-related, you
might wish to encourage the developer of the faulting program to make
the program more compatible with Stealth ROM. Quarterdeck is very
happy to assist the developer of any commercial hardware or software
who wishes added compatibility with our products.
ROM code is normally read 8 or 16 bits at a time, and 32-bit RAM is
therefore much faster. (You can see this in action by looking at
Manifest First Meg / Timings, first without the ROM parameter on the
QEMM386.SYS line in CONFIG.SYS, and then with ROM added to the end of
that line.) Some video ROM speed-up drivers work by copying the
contents of video ROM to conventional RAM. These programs (such as
TVGABIO.SYS, RAMBIOS.SYS, FASTBIOS.SYS, and SPEED_UP.SYS, typically
shipped on the utilities diskette provided with your video card) will
often conflict with Stealth ROM. If loaded after QEMM, such programs
may refuse to load because they detect that a program loaded before
them (QEMM) is intercepting the video interrupt, INT 10. Conversely,
if loaded before QEMM, these programs may divert interrupts into RAM,
so that QEMM cannot locate the ROM handler for those interrupts. In
these cases, the video speed-up program will function properly, but
Stealth ROM will be disabled. XSTI.TEC explains how to resolve this
problem if you really want to load the video enhancement program.
However, QEMM's ROM parameter generally provides the same feature
these drivers do, with three important advantages: First, QEMM copies
the video ROM into 32-bit RAM and then write-protects the RAM so that
some errant program does not overwrite the ROM code. Second, QEMM's
ROM parameter costs neither conventional memory nor High RAM to
provide this feature -- the video drivers mentioned above will
typically take 32K of one or the other. Finally, the ROM parameter is
fully compatible with Stealth ROM.
Q: If I'm having problems with Stealth ROM, what should I do?
A: Stealth ROM problems can be resolved by consulting Quarterdeck
Technical Note #205, "Troubleshooting Stealth ROM" (STEALTH.TEC). If
you are using QEMM version 7.0 or later, this technote was installed
in your \QEMM\TECHNOTE directory. This and other Quarterdeck
Technical Notes are also available on the Quarterdeck BBS (310)
314-3210, CompuServe (!GO QUARTERDECK), our Anonymous FTP Site
(qdeck.com (149.17.8.10)), via our Q/FAX fax retrieval service (from
the handset of your fax machine, call (310) 314-3214, or in Canada,
(416)665-5070), and some large local BBS systems.
SUMMARY
-------
Stealth ROM is a robust and proven technology. It is an easy-to-use,
safe, and efficient way of creating more High RAM on your system,
providing more memory for your TSRs, your device drivers, DESQview 386,
MS Windows, and your application programs. It is likely to speed up your
system rather than slow it down. It is designed to be effective on any
386 or higher processor, regardless of the ROM's manufacturer or version.
Many programs that cause conflicts with Stealth ROM can cause problems
with other programs and memory managers. Stealth conflicts are rare, and
troubleshooting is straightforward. Stealth ROM is the easiest way to
provide the optimal amount of High RAM on your system.
************************************************************************
*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) 1994 by Quarterdeck Office Systems *
************************ E N D O F F I L E *************************