From: Olivier PERRON Newsgroups: comp.os.msdos.djgpp Subject: Problem with interrupt handling Date: Mon, 06 Oct 1997 13:21:18 +0200 Organization: Alcatel/Bell Lines: 67 Message-ID: <3438C9AE.2BBD@art.alcatel.fr> NNTP-Posting-Host: rtbsci143s.art.alcatel.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi, I'm trying to work with interrupt and interrupt handler. My problem is that the following sample program doesn't work. Under a Windows 95 dos box, I have a "non conform operation" error message. What am I doing wrong ? #include #include #include #include #include #include #include _go32_dpmi_seginfo _v0xF1; int my_exit(void); void my_handler(void) { printf("I'm in my_handler\n"); } void main(void) { _go32_dpmi_seginfo info; __dpmi_regs r; char rep[10]; /* save current 0xF1 int context */ _go32_dpmi_get_protected_mode_interrupt_vector( 0xF1, &_v0xF1 ); memset(&info, 0, sizeof(_go32_dpmi_seginfo)); info.pm_selector = _go32_my_cs(); info.pm_offset = (unsigned long )my_handler; _go32_dpmi_allocate_iret_wrapper(&info); _go32_dpmi_set_protected_mode_interrupt_vector(0xF1, &info); /* big_loop(); */ printf("Press to continue: "); scanf("%c", rep); printf("Generating 0xF1 interrupt\n"); memset(&r, 0, sizeof(__dpmi_regs)); __dpmi_int(0xF1, &r); printf("Returning from 0xF1 interrupt\n"); my_exit(); } int my_exit(void) { /* restore previous context */ _go32_dpmi_set_protected_mode_interrupt_vector(0xF1, &_v0xF1); exit(0); }