Mail Archives: djgpp/1997/04/20/23:17:29
SteelGolem wrote:
>
> i want to write apps that will run in both win95 and dos, how do i
> detect whether there is a dpmi already being used? can you detect
> win95's, or whether there already is a dpmi working? email, please..
You're operating under a common misimpression - that you need to be
involved in some way in your program's use of DPMI. With DJGPP
programs, this is not the case. DJGPP programs use DPMI completely
transparently, via a 2k 16-bit stub program that is automatically
attached to every executable. This stub detects whether DPMI exists in
the current environment. If so, it uses whatever DPMI host is present.
If not, it attempts to load the 'cwsdpmi.exe' DPMI host that accompanies
the DJGPP distribution. What this means is that DJGPP programs will
work under MS-DOS, Windows 3.1, Windows 95, Windows/NT, OS/2 Warp,
Linux, and nearly every other PC operating system without you needing to
do a thing.
When distributing DJGPP-compiled programs, you should always include a
copy of cwsdpmi.exe, in case your users run them under plain DOS.
If you are really interested in looking into the mechanics of detecting
DPMI, then you should get the DJGPP library sources from SimTel
('v2/djlsr201.zip'), and examine the source code for the stub loader in
'src/stub/stub.asm'.
Hope this helps!
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com |
| Descent 2: The Infinite Abyss - The greatest Internet game of all |
| time just got better! This time, you're going all the way down...|
---------------------------------------------------------------------
- Raw text -