www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/05/24/13:17:18

Date: Wed, 24 May 1995 17:38:07 +0100
From: Thomas Eifert <EIFERT AT reze-1 DOT rz DOT rwth-aachen DOT de>
Subject: Re: DJGPP crashes
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Reply-To: eifert AT rz DOT rwth-aachen DOT de
Organization: Rechenzentrum RWTH Aachen

> > They all crash with the unsupported int 0x06 message.
> > When running gcc with no parameters, used physical memory is 124K and 
> > remaining physical memory is 1324K at crash. The topline display
> > scrolls very fast so I have to use the pause button to read. 
> 
> Please check to be sure there isn't another go32.exe somewhere on
> your PATH which gets called before the latest go32 you've installed.
> (Some programs compiled with DJGPP might be distributed with older
> versions of go32.exe)  If this isn't the reason, then please post
> at least two of the stack dumps printed on the screen when the
> programs crash.  Post the _exact_ snapshot of the stack dumps, so
> it will be possible to see where in the programs you run does the
> problem happen.  It could be that you just have hit a bug...
> 

I've encountered this problem so often, that we wrote a little program
(in TurboPascal, admittedly) that follows DOS's rules for finding
a program - You give a name and an absolute path is returned.

Try "whence go32" (I'm used to ksh ;-)), and maybe it will return
C:\DJGPP\BIN\GO32.EXE


It's not yet converted to C but You may get it compiled somewhere.

Hope this helps.

Thomas Eifert

==========================================================================

PROGRAM WHERE;

Uses Dos;

Const
     exten : Array[1..3] of String[4] =('.com','.exe','.bat');
Var
   argu : String;
   dir  : DirStr;

   gesetzt : Boolean;

Procedure pruefung;
var
   flag : String[2];
   name : NameStr;
   ext  : ExtStr;
   anzahl : Word;

begin
 anzahl := ParamCount;
 FSplit(ParamStr(0),dir,name,ext);
 writeln;
 case anzahl of
  0 : begin
       writeln('Error - no parameters');
       writeln('Usage: ',name,' [-a] filename');
       halt;
      end;
  1 : argu := ParamStr(1);
  2 : begin
       flag := ParamStr(1);
       if (flag <> '-a') then
        begin
         writeln('Error - wrong option');
         writeln('Usage: ',name,' [-a] filename');
         halt;
        end;
       gesetzt := true;
       argu := ParamStr(2);
      end
  else
   begin
    if (anzahl > 2) then
     begin
      writeln('Error - too many parameters');
      writeln('Usage: ',name,' [-a] filename');
      halt;
     end;
   end;
  end;
end;              (* Ende - Prozedur Pruefung *)

Var
   pf, pfd, pfad , argue : String;
   hilf                  : String[4];
   s                     : SearchRec;
   fehler, anz, an, i, j, w : Word;
   einmal, gefunden, gefund : Boolean;

Begin
 gesetzt := false;
 pruefung;

 (* Pruefung des Dateinamens *)

  i := Pos(':',argu);
  j := Pos('\',argu);
  if ((i <> 0) or (j <> 0)) then
   begin
    writeln('Error - only filename allowed');
    halt;
    end;
  gefund := false;
  i := Pos('.',argu);
  if (i <> 0) then
   begin
    hilf := copy(argu, i, length(argu)+1);
    an := 1;
    Repeat
     if (hilf = exten[an]) then
      gefund := true;
     inc(an);
    Until (gefund or (an = 4));
    if not(gefund) then
     begin
      writeln('Error - wrong extension');
      halt;
     end;
    end;
 (*           *)

 pfad := '.;' + GetEnv('PATH') +';';
 einmal := false;
 gefunden := false;
 w := 0;

 Repeat
  if not(gefund) then
   anz := 1;
  w  := Pos(';',pfad);
  pf := Copy(pfad,1,w-1);
  delete(pfad,1,w);
  Repeat
   if gefund then
    argue := argu
   else
    argue := argu + exten[anz];
   pfd   := pf + '\' + argue;
   FindFirst(pfd,Anyfile,s);
   fehler := DosError;
   if (fehler = 0) then
    begin
     gefunden := true;
     if not(gesetzt) then
      einmal := true;
     if (pf = '') then
      writeln('Path: ',dir+argue)
     else
      writeln('Path: ',pfd);
     end;
    if not(gefund) then
     inc(anz);
  Until ((einmal) or (gefund) or (anz = 4));
 Until ((einmal) or (pfad = ''));

 if not (gefunden) then
  writeln('File not found');
End.

===========================================================================

- Raw text -


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