Quote
Konstantin Koll wrote:
> Evaluation of a new DPMI host by
> Konstantin Koll, Martin Rusch, Sarah Gunter
> Abstract
> Since the introduction of Borland Pascal, it is capable to create protected
> mode applications for DOS that run under a DPMI host. Either an existing DPMI
> host (e.g. Windows) is used; if none is found at startup, an integrated DPMI
> host takes over
Well, the DPMI host is hardly "integrated"...
In fact, the loader which is run by MS-DOS (the real-mode program at the
beginning of the .EXE) is what is called a stub. It first tries to use an
existing DPMI host, and records the result. Then it tries to use Borland
RTM services (using a dedicated interrupt, int 2F/AX=$FB42/BX=$1001),
and again records the result. Then it goes TSR, and:
- if the DPMI was not found, it loads DPMI16BI.OVL as an overlay;
this is taken as enabling an DPMI host
- if the RTM services was not found, it loads RTM.EXE (which is a one-shot
TSR that exits itself on completion of the program)
- finally, it uses RTM services to load and run itself; RTM services are
able to use the protected-mode part of a .EXE instead of the real-mode.
Quote
> By browsing the files RTM.EXE and DPMI16BI.OVL, you'll
> quickly find that the DOS extender in use is a special version of the common
> Ergo DPMI system.
I agree about DPMI16BI.OVL, but it was not my impression about RTM.EXE
I was under impression that the latter was produced by Borland itself.
In any way, this is what the Copyright says.
On the other hand, I never played with the original Ergo extender.
Quote
> However, this system is far from being perfect. The version of the package
> shipped with Borland Pascal (and many versions of Borland C++) is the
> "compatible" 286-version of the DOS extender.
Sorry to appear pedantic, but I believe you have to be more precise.
There are two different animals here, the DPMI host and the DOS extender.
The DPMI host can be of two variations:
- a '286-like, that makes use '286 protected mode structure; DOSX.EXE (aka
Windows 3.x standard mode) and DPMI16BI.OVL are examples
- a '386-like, that makes use '386 structures; Windows WIN386.EXE enhanced
mode, Win9X, Go32, DPMI32VM.OVL, etc., are examples; it is by far the
most common these days
One should add that so-called '286 DPMI host are in fact (except for the
oldest versions, before 1988) aware of what a 386 is, and reacts
accordingly (for example by using more than 16 MB of memory if available).
The DOS extenders also come in two variations:
- 16-bit extenders, like Ergo OS/286, RTM.EXE, or Windows 3.x (yes, even
in enhanced mode!)
- 32-bit extenders, like Ergo OS/386, 32RTM.EXE, or Win32
Thanks to DPMI specifications, whether you use the former or the latter
category of DPMI host is immaterial to the extender (so you can run Borland
DPMI programs in Windows).
On the other hand, either your program is compiled for the former kind
of extender (so it is called a 16-bit program), or for the latter (and
we call it 32-bit).
There is no way to pass from one to the other short to rebuild all
with different tools.
I assume the following talks about the Ergo 286 DPMI host
Quote
> It can only handle up to 64 MB of memory
That is correct. Ergo 286 DPMI host allocates memory in 1K block, and
its counter is 16-bit, so it have a maximum of 64 MB memory allocation
(for example, this is not true for DOSX.EXE that can use more memory).
Quote
> (in some cases just 16 MB),
Please elaborate.
Of course, with a 286 or a 386SX you are limited (by the chip) to 16 MB.
But I never saw problem with higher-end boxes.
Quote
> Existing versions
> We've found about 5 different versions of the Ergo DPMI system on the
> internet being part of software packages:
> (1) Ergo DPMI 1.0 (286)
> (RTM.EXE, RTMRES.EXE, DPMI16BI.OVL, DPMIINST.EXE)
> (2) Ergo DPMI 1.1 (286)
> (RTM.EXE, RTMRES.EXE, DPMI16BI.OVL, DPMIINST.EXE)
> (3) Ergo DPMI 1.5 (286)
> (RTM.EXE, RTMRES.EXE, DPMI16BI.OVL, DPMIINST.EXE)
> (4) Ergo DPMI 1.1 (386/swapping)
> (32RTM.EXE, DPMI32VM.OVL)
> (5) Ergo DPMI 1.5 (386/swapping)
> (32RTM.EXE, DPMI32VM.OVL)
Please disconnect the DOS extenders from the DPMI hosts.
I am aware of two versions of the 286 host, both of them copyrighted Ergo:
- version 8232 (build 1992-10-21 17:14:00), which shipped with BP7/TP7
- and version 5032 (depending of the package, build 1993-11-16 19:10:22,
1994-05-25 17:56:23 or 1994-07-18 17:53:20), which shipped with BC4+ and
Delphi 1, and available at Borland ftp site.
I do not know what shipped with BC++ 2.0 and 3.x (information welcome;
I am almost sure that a precedent version [BC2] was not able to correctly
handle the 386).
I am also aware of only one version of the 386 host with VM support :
version 5032 (built either 1993-11-16 19:10:22 or 1994-07-18 17:53:36),
which shipped with BC4+. However, your tests show there are differences
between the builds (probably a bug with the original one).
While there are references to a 386 host without VM (DPMI32BI.OVL), I never
encountered it. DPMIINST.EXE is a support program for the Ergo 286 host.
On the other hand they are the DOS extenders:
* The 16-bit DOS extender (RTM.EXE) comes in 3 versions (not counting its
predecessors, DPMILOAD.EXE and DPMIMEM.DLL):
- version 1.0 shipped with BP7/TP7 and was 84 KB in length
- version 1.1 shipped with BC4 and was 107 KB in length
- version 1.5 shipped with BC4.02+ and Delphi, and was 119 KB in length.
* The 32-bit DOS extender (32RTM.EXE) comes (at least) in 2 versions:
- version 1.0 shipped with BC4 and was 139 KB in length
- version 1.5 shipped with BC5 and was 149 KB in length.
Quote
> Apparently, there are two major groups of versions: old systems that run on
> old 286 computers (and therefore can only access 16 MB of RAM if no other
> DPMI or VCPI host is present).
Have you tried to use plain old BP7 DPMI program on a computer with
more than 16 MB of physical memory?
In fact one can access up to (almost) 64 MB of RAM if available,
even with the oldest versions shipped with BP7.
On the other hand, even if your DPMI host is able to provide more,
RTM.EXE does not seem able to manage more than 64 MB (probably
another 16-bit counter somewhere, related with the parsing of
EXTMAX in the environment string RTM...)
Quote
> Newer versions (4) and (5) can run on 386 computers only and provide
> access to the first 64 MB of RAM, with addition of paging and swapping.
... and are unusable without a 32-bit compiler, so what?
Do you want to say that you have been able to run a program compiled
with BP7 with *only* the files mentionned under (4) or (5) ?
Quote
> There don't seem to be any major differences between the 286 versions of
> Ergo (1) to (3). However, the versions differ in file size and creation date.
That is also my impression.
Quote
> On the other side, (4) and (5) differ in interrupt latency.
This is interesting information.
By the way, interrupt latency comes from the DPMI host (so DPMI32VM.OVL,
but it can be replaced by anyone you like, however note that Windows will
take over).
Quote
> Realtime constraints and hardware specific code
> For typical realtime applications, it is vital to have a very low interrupt
> latency.
<snipped>
You should then consider using other DPMI hosts than Ergo. PMODE (various
versions are available) might be a very good choice for your problem, since
it does not implement paging and is optimized toward speed. It is freely
available on the net, both as binary or C source.
Quote
> Integration of the new host
> Using the new DPMI host with your software is very simple. It is possible to
> rename DPMI32VM.OVL to DPMI16BI.OVL and use it with your old loader. However,
> we provide a compressed version of RTM.EXE with this package that has been
> modified to suit the new overlay.
But you do not use the 32-bit extender (32RTM.EXE)! You are simply using
the 16-bit DOS extender, RTM.EXE, with the '386-based, VM-aware DPMI host.
As I said, another solution is to use instead some other DPMI host.
Hope it helps,
Antoine