www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/06/07:28:55

Message-ID: <008a01bf0fe9$926f7d80$293f8589@gv015029.bgo.nera.no>
From: "Gisle Vanem" <gvanem AT eunet DOT no>
To: <djgpp AT delorie DOT com>
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
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 <Martin_Czamai AT peak-service DOT com> 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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019