Date: Tue, 28 Feb 1995 19:09:12 +0500 From: hvb AT netrix DOT com To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: How to avoid nested interrupts? We try to reprogram the clock to interrupt once per milli second. The protected mode interrupt issues a call to the original real mode interrupt function (via go32_dpmi_simulate_fcall_iret) once every 18.2msec to keep the DOS clock happy. The clock call back interrupt will call the protected mode function to keep the counter arithmetic in sync (using go32_dpmi_allocate_real_mode_callback_iret and go32_dpmi_set_real_mode_interrupt_vector). The problem we get is sometimes while accessing the disk on a 386 system, the protected mode to real mode switching is so slow that when the real mode interrupt returns to the protected mode, another interrupt can occur immediately. In fact, there are so many of the stacked up that it overflowed the stack. The question is: how do I set up so that when real mode returns to protected mode the processor remains interrupt disabled? I have issued an "cli" in the protected mode prior to call go32_dpmi_simulate_fcall_iret. It seems that the INTERRUPT flag which is cleared in protected mode, is set on return from go32_dpmi_simulate_fcall_iret. Thanks in advance. ============================================================== Hung Bui Internet: h DOT bui AT ieee DOT org Netrix Corporation Phone: +1 703 793 1016 13595 Dulles Technology Drive Fax: +1 703 713 3805 Herndon Va 22071 ==============================================================