From: "Miles F. Bintz Ii" Newsgroups: comp.os.msdos.djgpp Subject: More interrupt handling questions Date: Mon, 19 Oct 1998 12:45:11 -0400 Organization: Clarkson Univeristy Lines: 79 Message-ID: NNTP-Posting-Host: polaris.clarkson.edu Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: news.clarkson.edu 908815513 3795 128.153.4.24 (19 Oct 1998 16:45:13 GMT) X-Complaints-To: abuse AT clarkson DOT edu NNTP-Posting-Date: 19 Oct 1998 16:45:13 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Just to verify, if I wanted to write an ISR for IRQ 4, I would install it into vector 0x0c, correct (in DPMI)? Here's a brief history.... I have a PCI device whose interrupt line is 0 on bootup. I manually set this to IRQ 4 in the config space and then tell the card that its OK to start issuing interrupts. Heres the routine that installs the handler.... void ISR() { disable(); interrupt_count++; /* can I call this in my ISR or does this end up being a far call? */ _farpeekl(yadda, yadda) /* Signal EOI: do I need to do this? */ outportb(0x20, 0x20); enable(); } void endof_ISR() {} void install_handler() { . . . read_cfg_space(0x3c, &i); write_cfg_space(0x3c, (i & 0xffffff00) | 0x4, LONG); newISR.pm_offset = (int) ISR; newISR.pm_selector = _go32_my_cs(); _go32_dpmi_lock_data(&interrupt_count, sizeof(interrupt_count)); _go32_dpmi_lock_data(&interrupt_code, sizeof(interrupt_count)); _go32_dpmi_lock_code(ISR, (long) endof_ISR - (long) ISR); _go32_dpmi_get_protected_mode_interrupt_vector( 0x0c, &oldISR); _go32_dpmi_allocate_iret_wrapper(&newISR); _go32_dpmi_set_protected_mode_interrupt_vector( 0x0c, &newISR); /* still working at this point */ . . . tell_hardware_ok_to_int(); /* frozen */ } So thats that. The problem is, whenever the hardware starts issuing interrupts, the computer locks up. No mouse, no keyboard, but my softpower till works. The frequency of these interrutps should be about 60-85 Hz as this is the vertical retrace interrupt generated by a graphics adapter. I dont have any idea why this isn't working. I've read the DPMI spec, the DJGPP FAQ, and some of the Allegro stuff... The routines above are almost identical to those found at http://www.abwillms.demon.co.uk/prog/djints.txt Some other tidbits: I realize that the wrapper isn't locked in memory, but I don't believe the system is paging. I'm currently running under win95, but I think there is still plenty o' memory available. The same things happen when I run with cwsdpmi. A pre-emptive thanks for your help/suggestions! -Miles