delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/20/15:00:16

From: "Charles Sandmann" <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Automatic EOI in DJGPP
Date: Fri, 20 Oct 2000 13:18:47
Organization: Aspen Technology, Inc.
Lines: 48
Message-ID: <39f04637.sandmann@clio.rice.edu>
References: <8sp1s3$2bh3 AT imsp212 DOT netvigator DOT com> <9003-Fri20Oct2000133109+0300-eliz AT is DOT elta DOT co DOT il> <8spl4n$8qb1 AT imsp212 DOT netvigator DOT com>
NNTP-Posting-Host: dcloan.hou.aspentech.com
X-Trace: selma.aspentech.com 972067715 2528 10.32.115.107 (20 Oct 2000 18:48:35 GMT)
X-Complaints-To: postmaster AT aspentech DOT com
NNTP-Posting-Date: 20 Oct 2000 18:48:35 GMT
X-NewsEditor: ED-1.5.8
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> Since I've already replaced ISR of timer interrupt by my own, therefore I
> suppose DPMI can't do anything behind my back. Am I right? please tell me
> if I'm actually wrong.

If you are running a non-ring-0 DPMI provider, it needs to swap stacks for
you when a hardware interrupt happens - so it actually messes with the
interrupts too.  If you run a ring-0 provider without stack swaps you could
replace the ISRs without worrying too much.  I can't say for sure if the
ring swapping code would work with auto EOI.

> Turning on auto-EOI is not just so stright forward in DJGPP. I suscepts that
> the ICW2 (Vector base address?) is not 0x08h as usually should be set to.

This is correct.  This interrupt range interferes with exceptions which have
the same values, and in some cases are very difficult to tell exceptions from
hardware interrupts.  Each DPMI provider usually revectors to a higher point.
The DPMI spec allows the revector point to be returned - but almost all 
providers lie about revectoring and then just try to fix up the calls.

> Every time after I set up the 8259, the program crash immediately, no matter
> whether I set or clear the auto-EOI bit. Please give me a help if anybody
> can.

I suggest you download the sources for CWSDPMI and look at them, if you 
want to run in regular DOS.  The source for PMODE is also available.

> Another factor that prevents me from further increase the data rate, is that
> it seems when you issue EOI by writing 20h to 8259, the DPMI will thinks
> that the protect mode ISR fails, it then switch to real mode and call the 
> real mode ISR routine. I read this from the README of PCTIME14 program. 

Read the source of exphdlr.c instead.  This isn't what happens in 
CWSDPMI or PMODE.

> I've
> varified this by hooking both real mode and protect mode ISRs. I haven't
> chainned the real mode ISR as PCTIME14 do, but the real mode routine
> really can affect the output!! I think except using Auto-EOI, there should
> be another method to prevent DPMI from calling the real mode ISR? isn't it?
> Please tell me the method, if this is not a bug.

If you do the following:
 1) Hook the PM interrupt, don't chain, and
 2) Either never leave PM (don't call any interrupts) or replace the RM
    interrupt of one of your own you should be OK.

Since you need maximum speed, I suggest you pick a DOS DPMI provider like
CWSDPR0 or PMODE and grab the source and look at what happens in detail.

- Raw text -


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