Mail Archives: djgpp/1998/12/16/02:37:30
On Wed, 16 Dec 1998, Corey Harwell wrote:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML>
Please do not post in HTML.
> The faq was very confusing to me about interrupt handlers
> (probably because i'm used to real-mode programming =P )
Please tell what was confusing in the FAQ. I cannot make the FAQ better
if you don't tell what's wrong with it. As far as I could see, the FAQ
doesn't assume any knowledge about protected-mode programming.
The FAQ also includes pointers to examples of interrupt hooking in DJGPP;
did you look at those?
> /* holds old interrupt handler */
> void (_interrupt _far *Old_Serial_ISR)();
This declaration should be changed to the type returned by the function
you use to get the old handler, either __dpmi_paddr *Old_Serial_ISR (if
you use __dpmi_get_protected_mode_interrupt_vector), or
_go32_dpmi_seginfo *Old_Serial_ISR (if you use the _go32_dpmi_...
variety).
> void _interrupt _far Serial_ISR(void)
This should be just void Serial_ISR.
> Old_Serial_ISR = _dos_getvect(INT_SERIAL_PORT_0);
The FAQ explains (in section 18.9) that you need to use one of the
above-mentioned functions instead of _dos_getvect.
> _dos_setvect(INT_SERIAL_PORT_0, Serial_ISR);
The FAQ explains that you need to call either
__dpmi_set_protected_mode_interrupt_vector or
_go32_dpmi_set_protected_mode_interrupt_vector library function for this.
- Raw text -