Date: Mon, 20 Jan 1997 08:53:28 -0700 (MST) From: Josh Turpen To: djgpp AT delorie DOT com Subject: Interrupt handlers & GPF's in RMCBs Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Can anybody tell me if my interrupt code is ok? About once out of 10 times my program bombs with a GPF | Stack Fault | Page Fault in RMCB. I don't know what a real-mode callback is, but I think it has to do with my interrupt code. # file irq.S .globl _irq0_int _irq0_int: pushl %eax /* save clobbered regs */ pushw %ds /* save clobbered regs */ movw %cs:___djgpp_our_DS, %ds /* get a valid DS so that */ movl __lwp_enable, %eax /* we can access __lwp_enable */ cmpl $0, %eax /* raise exception? */ jne done /* no */ movl $0x99, %al /* generate exception 0x99 */ call ___djgpp_hw_exception /* later trap exception */ done: movl $0x20, %eax /* outportb(0x20,0x20) to */ outb %al, $0x20 /* acknoledge interrupt */ popw %ds /* restore DS */ popl %eax /* restore EAX */ sti /* restore int flag */ iret /* return */ I've tried it with and without the sti, as some people told me I don't need it while the DPMI spec says I do. Either way it still blows up about 1 out of 10 times. This interrupt handler is installed with the __dpmi_set_protected_mode_interrupt_vector, and it works great except for the occasional hang. I'm not even sure if I should be looking at this code for the bug, because I really don't know what a RMCB is. Josh snarfy AT goodnet DOT com