Mail Archives: djgpp/2000/10/06/05:41:56
> 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 -