delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/10/06/07:51:04

Date: Tue, 6 Oct 1998 14:49:39 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
cc: djgpp AT delorie DOT com, djgpp-workers AT delorie DOT com,
Andris Pavenis <pavenis AT lanet DOT lv>,
Robert Hoehne <robert DOT hoehne AT gmx DOT net>
Subject: Re: Is NT 100% broken or what?
In-Reply-To: <m0zQBLp-000S5AC@inti.gov.ar>
Message-ID: <Pine.SUN.3.91.981006144533.17118b-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

On Mon, 5 Oct 1998, Salvador Eduardo Tropea (SET) wrote:

>   I want to know if that's just my NT or is a problem in
> all the NTs. If the bug is in NT I'll simply drop the
> support for this platform because is 100% broken, but
> perhaps isn't NT. Any ideas?

I tried this.  It doesn't crash for me at all.  It just clears the 
screen.  I tried to compile the program both as C and C++, with the same 
effect.

Maybe if you tell how did you compile it exactly, I could reproduce the 
problem.  I used GCC 2.7.2.1 and the command line didn't use any switches 
beyond -Wall and -g.

> * Ctrl+C when a djgpp program is running some times
> generates an exception, in my NT says:
> 
> "Error de aplicacion y se esta
>  generando un registro de error de aplicacion.
>  ntvdm.exe
>  Excepcion: infraccion de acceso (0xC0000005), direccion
> 0xf003084"

A known problem.  I don't know why does it happen, but it doesn't
happen every time.  Some programs almost never cause NT to puke,
others almost always do, still others sometimes do and sometimes
don't.

For example, programs that call __dpmi_yield in its old incarnation (the 
one that called INT 2Fh directly) crash badly, but those which were 
linked with a new version of __dpmi_yield (that calls __dpmi_int) work 
much better when Ctrl-C is pressed.

>  Perhaps that's when ^C hits NT and not the djgpp program.
> But I'm not sure.

Does Ctrl-BREAK work reliably?  If it does, then the problem is most
probably with the special ^C handling that NT does to emulate DOS.
Two things to try are:

    - Hook Int 23h in the startup code.  dpmiexcp.c already does that
      for some special brands of a PC: it sets Int 23h to a function
      that does an IRET.  Maybe NT needs that as well.

    - Remove the ^C character from the keyboard buffer in the DJGPP
      keyboard handler.  The change should be done in exceptn.S.
      AFAIK, the special handling of Ctrl-C by DOS happens when it
      sees 0x03 character in the keyboard buffer; the fact that this
      problem happens only sometimes might hint that if the DJGPP
      program is aborted by SIGINT *before* NT DOS emulator sees ^C,
      all is well.  In that case, removing ^C from the keyboard buffer
      should solve the problem.

      Btw, I think we should always remove ^C from the keyboard
      buffer.  I never understood why we don't do that now.

- Raw text -


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