delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/01/12:19:26

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DMPI question
Date: Mon, 28 Jul 1997 20:01:59 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 40
Message-ID: <33DCFAB7.5AF9@cs.com>
References: <33DC0E43 DOT 6D6 AT hotmail DOT com>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp107.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Asbjørn wrote:
> 
> Hi, i got a little question, perhaps a bit off-topic,
> but i'm curious, how does a program compiled with djgpp find a
> dmpi server when it runs? Like, i have cwsdpmi.exe in my C:\dos
> directory, and it runs fine, now, does the program search for
> it? or is there a little trick or something?

DJGPP programs perform the following steps when they load.  Actually,
the programs themselves don't do it; it's the responsibility of a little
2 kilobyte real-mode stub that is attached to all DJGPP programs.  But
here is a basic summary:

First, the stub issues a call to switch the computer into protected
mode.  If this call is successful, it assumes the presence of a DPMI
host in the system and continues on its merry way.

If not, the stub then searches the current working directory and then
the PATH environment variable for the program hardcoded into it.  This
program is usually "cwsdpmi.exe" but you can change it with the
'stubedit' utility.  If it finds such a program, it runs it.

The stub attempts to switch into protected mode again.  If it still
fails, it issues a "Load error: no DPMI." message and quits.

The moral of the story is that, if no other DPMI host is present in the
system, DJGPP programs will look for the cwsdpmi.exe program somewhere
in the PATH, or in the current directory.  So your problem is most
likely that you failed to add the DJGPP 'bin' directory to your PATH, as
stated in the instructions in 'v2/readme.1st'.

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "It may be better to be a live jackal|
|       aka Fighteer I       | than a dead lion, but it is better   |
|   mailto:fighteer AT cs DOT com   | still to be a live lion."            |
| http://www.cs.com/fighteer |                - Lazarus Long        |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019