Message-ID: <008a01bf0fe9$926f7d80$293f8589@gv015029.bgo.nera.no> From: "Gisle Vanem" To: Subject: Re: interrupt service routine in protected mode for a PCI device Date: Wed, 6 Oct 1999 12:57:17 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Reply-To: djgpp AT delorie DOT com Martin Czamai said: >can anybody tell me, whats wrong with this code? >... > BYTE PCI_INT = GetINT(Device); // Interrupt Line Number read from >the configuration space > > // interrupt service routine (ISR) must NOT be swaped out to file > _go32_dpmi_lock_code(ISR, (DWORD)LOCK_ISR - (DWORD)ISR); >// _go32_dpmi_lock_data((void*) &Msg, (long)sizeof(Msg)); // >currently not used > > _go32_dpmi_get_protected_mode_interrupt_vector(PCI_INT, >&OldHandler); > Handler.pm_offset = (int)ISR; > _go32_dpmi_allocate_iret_wrapper(&Handler); > _go32_dpmi_set_protected_mode_interrupt_vector(PCI_INT, &Handler); >... >// SYSTEM CRASHES NOW!!! (sinply hangs up) AFAICS, because you use assert(): >void ISR(void) > { assert(0); // not implemented > } 'assert(0)' will call DOS-functions to print some text. Use cputs() if you need to print something in an IRQ-handler. And besides you didn't send an EOI command to the intr-controller. Gisle V.