Date: Tue, 7 Mar 1995 09:08:41 -0300 From: acmq AT beta DOT coe DOT ufrj DOT br (Antonio Carlos Moreirao de Queiroz) To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: Interrupt Handling Issues. ??? About handling real-time interrupts: According to the example somewhere in the into files, the code to redirect the clock tick interrupt is: _go32_dpmi_registers regs; _go32_dpmi_seginfo old_handler,new_handler; void Interruptor(_go32_dpmi_registers *r) { /* The routine that treats the interrupt */ ... } ... /* To install the handler */ _go32_dpmi_get_real_mode_interrupt_vector(0x1C,&old_handler); new_handler.pm_offset=Interruptor; _go32_dpmi_allocate_real_mode_callback_iret(&new_handler,®s); _go32_dpmi_set_real_mode_interrupt_vector(0x1C,&new_handler); ... /* To uninstall */ _go32_dpmi_set_real_mode_interrupt_vector(0x1C,&old_handler); _go32_dpmi_free_real_mode_callback(&new_handler); This appears to work correctly, but I have some questions: 1- How to call the old interrupt handler at the end of the new handler? 2- Is it necessary to guarantee that the new handler is uninstalled before the program exits, normally or not? 3- Is this really safe? Antonio Carlos M. de Queiroz