www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/06/05:41:56

Date: Fri, 06 Oct 2000 11:41:43 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: "Peter Remmers" <Peter DOT Remmers AT t-online DOT de>
Message-Id: <7458-Fri06Oct2000114142+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.5h
CC: djgpp AT delorie DOT com
In-reply-to: <8rj5td$l0o$14$1@news.t-online.com> (Peter.Remmers@t-online.de)
Subject: Re: strange interrupt chaining problem with keyboard interrupt
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1001005075606 DOT 3958E-100000 AT is> <8rhi12$4up$10$1 AT news DOT t-online DOT com> <9003-Thu05Oct2000231854+0300-eliz AT is DOT elta DOT co DOT il> <8rj5td$l0o$14$1 AT news DOT t-online DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Peter Remmers" <Peter DOT Remmers AT t-online DOT de>
> Newsgroups: comp.os.msdos.djgpp
> Date: Fri, 6 Oct 2000 02:21:07 +0200
> 
> > How about locking everything that the interrupt handler touches?  Did
> > you do that?  The code you posted doesn't show.
> 
> I have a
> int _crt0_startup_flags = _CRT0_FLAG_LOCK_MEMORY;

It stikes me that you should have posted the full code of your program
to begin with.  That would have saved lots of bandwidth waste, to say
nothing of the factors I would have to consider as possibly relevant.
It would also allow those who want, to try the program on their
machines; who knows, perhaps this is something specific to your system
setup?

> > Did you try to disable the keyboard hooking in the DJGPP startup code?
> > If so, did it change anything?
> 
> How do I do that?

By modifying the source of the startup code (function
`__djgpp_exception_setup' in the file dpmiexcp.c from djlsr203.zip).

> Meanwhile I got around it by writing my own wrapper in assembler.
> I took some inspiration by looking at the allegro sources.
> My C function returns a value that tells if the wrapper should chain
> to the original ISR or not, which BTW works.
> 
> The problem with calling the old ISR directly from the C handler
> still persists, however. More precisely, after setting up the
> DJGPP execution environment (DS=ES=SS and setting up a new stack),
> calling the old ISR has said effects.

The ``old ISR'' is the keyboard handler set up by the DJGPP startup
code.

One issue that might be worth exploring is the registers used by your
handler.  You don't save/restore any of them around the call to the
old ISR; however, the old ISR might destroy some of them while doing
its thing.  I'd suggest to push all of the registers before the lcall,
then pop them after the old ISR returns, and see if that changes
anything.

> Suggestion: integrate the idea of telling the wrapper with a return
> value if it should chain or not into
> _go32_dpmi_chain_protected_mode_interrupt_vector().

If you can add this to the library code (see file gopint.c in
djlsr203.zip), I'm sure the patches will be gratefully accepted.

- Raw text -


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