delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2006/11/06/13:00:23

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Jordar" <rrcdaniel AT sbcglobal DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: porting from borland
Date: 6 Nov 2006 09:54:34 -0800
Organization: http://groups.google.com
Lines: 39
Message-ID: <1162835674.032597.311890@i42g2000cwa.googlegroups.com>
References: <1162831801 DOT 086285 DOT 199260 AT h54g2000cwb DOT googlegroups DOT com>
<200611061704 DOT kA6H4mUK006274 AT envy DOT delorie DOT com>
<1162833119 DOT 166609 DOT 126110 AT i42g2000cwa DOT googlegroups DOT com>
<200611061732 DOT kA6HWVTd007180 AT envy DOT delorie DOT com>
NNTP-Posting-Host: 65.67.51.194
Mime-Version: 1.0
X-Trace: posting.google.com 1162835679 16598 127.0.0.1 (6 Nov 2006 17:54:39 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Mon, 6 Nov 2006 17:54:39 +0000 (UTC)
In-Reply-To: <200611061732.kA6HWVTd007180@envy.delorie.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: i42g2000cwa.googlegroups.com; posting-host=65.67.51.194;
posting-account=rQ0tLw0AAABlxfVSZZfLGXLmQpwv2fH6
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

DJ Delorie wrote:
> The only thing I can think of is to set up your handler first, then
> enable interrupts.  The BIOS's default handler may be disabling
> "rogue" interrupts.
>
> Are you installing both a PM and RM handler?

I do install the handler first.... below is code for setting up
interrupt 1-7:
void InitHostIT(void interrupt (*IntVect) (void), short IRQNum)
{
 unsigned char IMR;
disable();                           // Don't want short called during
revector
outportb(0x20, 0x20);         //  acknowledge any pending IRQ
_go32_dpmi_get_protected_mode_interrupt_vector(IRQNum, &old_handler);
new_handler.pm_offset = (unsigned long) IntVect;
new_handler.pm_selector = _go32_my_cs();
_go32_dpmi_allocate_iret_wrapper(&new_handler);
_go32_dpmi_set_protected_mode_interrupt_vector(IRQNum, &new_handler);
IMR = inportb(0x21);               // Read in current IMR
IMR &= ~(1 << IRQNum);             // Clear desired bit
outportb(0x21, IMR);               // Out new IMR
enable();
}

I think you are definately on to something.  If I read back the value
of the pic before the enable(), it returns the proper value.  However
if I do the same thing immediately after the enable the PIC returns
back with the interrupt disabled.  Something (BIOS??) is disabling it
so I must not be setting up the Handler properly.

I am using the above PM handler code only.  Perhaps I need to
experiment with a RM handler or is there something else missing to the
above?  

Thanks for your help

- Raw text -


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