Date: Tue, 6 Oct 1998 14:49:39 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: "Salvador Eduardo Tropea (SET)" cc: djgpp AT delorie DOT com, djgpp-workers AT delorie DOT com, Andris Pavenis , Robert Hoehne Subject: Re: Is NT 100% broken or what? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp 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.