Mail Archives: djgpp/1996/08/07/14:24:47
snarfy AT goodnet DOT com wrote:
>After reading the DPMI 0.9 spec and after looking through FAQ, I'm a
>bit perplexed. The FAQ says that using _go32_dpmi_allocate_iret_wrapper
>shouldn't be used in production quality code, since you can't really
>lock the wrapper. I'm not sure what a DPMI compliant interrupt handler
>should do though, and I know very little about protected mode.
>
>Lets say I was hooking IRQ0 and I didn't want to allocate the iret_wrapper.
>What would the interrupt code have to look like?
>Sample code:
>_protected_mode_IRQ0_handler:
>cli
>...do some stuff
>movb $0x20,%al
>outb %al, $0x20
>sti
>iret
>Now, what else would have to be added to that code to make it work
>without calling _go32_dpmi_allocate_iret_wrapper() on it? Maybe a
>pusha, popa, stack switch, ... ?
See the Allegro sources. I'm writing an interrupt handling tutorial
which will include a library to do just that, and make locking easier
by sticking locked stuff into special sections.
>On a side note, can I access my pmode variables in a real mode interrupt?
>Are there any special considerations I have to take into account (like
>making sure the variables are in DOS mem)?
Normal C variables, no. What you can do is to allocate some DOS mem
and use it as a buffer, like dynamic allocation; pass the realmode
pointer down to this realmode interrupt handler. Why are you making a
realmode handler, anyway? The handler you pass to
set_real_mode_vector_whatever doesn't execute in real mode - you make
a protected mode thunk for it. No DJGPP-made code ever runs in real
mode (as far as I know)!
Regards,
ABW
--
I have become... Comfortably numb...
Alaric B. Williams Internet : alaric AT abwillms DOT demon DOT co DOT uk
<A HREF="http://www.hardcafe.co.uk/Alaric/">http://www.hardcafe.co.uk/Alaric/</A>
- Raw text -