presents

REAL-MEMORY SYSTEM - A 32bit MEMORY ADDRESSING TECHNIQUE FOR THE REAL-MODE!

What is the REAL-MEMORY system?

"REAL-MEMORY" is just our way to call the usage of extended memory in
the real-mode. We've never heard of anyone doing such a thing before,
so we decided to distribute some information about this little thing.
Of course the protected mode might be a lot better way to solve problems
due to its ability to run 32bit code and so. Anyway, as long as we use
DOS, it's a lot easier to use memory in the real-mode. For instance,
the REAL-MEMORY works in the background when using TSR:s - with no extra
drivers. Using it, is also as fast as the usage of basememory, and in
addition, it's a superior technique to QEMM and other corresponding
memory managers. For the last thing, the REAL-MEMORY is, at least, a lot
easier to use than the protected mode!

How does it work, then?

Well... a 80386 is initially started in the real-mode to be 100% PC/XT-compa-
tible. All you are expected to know the segment limit (64KB) in the realmode
and what happens if you address over it (like: mov edi,66000 - mov ax,[edi])
- an exception will be generated. However, a 386 allows the modification of
segment limit in the protected mode - up to 4GB. So, we simply switch to the
protected mode and adjust the limit of all segments to 4GB. After that we
switch back to the real-mode without resetting the CPU. And...voila : we can
address the maximum of 4GB memory in the real-mode without the nasty segment
limit of 64KB! However, there's still one thing, which has to be made sure
before using extended memory; the addressline 20 must be enabled. Fortunately
HIMEM.SYS, for example, includes a function for it. Thus, it's not a problem
at all.

How about the compatibility with other applications?

Expanded memory managers, like QEMM, usually prevent the modifications
directly. We haven't tested, if it would be possible to use the REAL-MEMORY
system under QEMM. Anyway, there's no reason. There's no need for QEMM, if
the memory is entirely in use without QEMM! If you really want to make your
code compatible with one of the most incompatible programs ever made, do it
freely. We won't.

As always, there are also some difficulties. The problem comes up with the
A20-line, because it has to be enabled all the time. When extended memory
is used and DOS (5.0 or newer) is loaded into HMA, the A20-line is turned
off every time a new program is executed. It's not a problem, if we are not
in a DOSshell. If we are, it's anything but an easy thing to handle. For this
case, We have coded a short routine to patch HIMEM.SYS (or other extended
memory manager) for the time the shutdown of the A20-line has to be preven-
ted.

The REAL-MEMORY system has been tested with over 20 different 80386s and
80486s and it's been found working with all those CPUs. Anyway, we can
give no guarantee, because the system seems to be quite undocumented.

The examples

There are three programming examples distributed with this info. First
is an initialization code. Second is a short program, which allocates
100KB of XMS and fills the area with data. Third code is the patch for
XMS driver to prevent A20 shutdown. The first two are in C (mainly in-
line assembly) and the last one is pure assembly. Hopefully the examples
are clear enough.

The final words...

Yeah, that's it... if any information in this packet is useful for you, it
would be nice to greet us in your product. And, if YOU find out something
useful, perhaps undocumented, which you've never heard of before, don't
hesitate; inform also the others about it!!!

All netmail concerning REAL-MEMORY to
Fidonet: 2:220/980 (to Chatter/PROGREX)

Thank you for your attention.