delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/12/15/18:06:52

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Wed, 15 Dec 2004 23:46:45 -0200
From: Jonatan Liljedahl <lijon AT kymatica DOT com>
To: djgpp AT delorie DOT com
Subject: Re: Problems with timer interrupt chaining and SmartDrv
Message-Id: <20041215234645.6d15ae95.lijon@kymatica.com>
In-Reply-To: <01c4e2e9$Blat.v2.2.2$7ba22de0@zahav.net.il>
References: <20041215011234 DOT 44376f01 DOT lijon AT kymatica DOT com>
<01c4e2e9$Blat.v2.2.2$7ba22de0 AT zahav DOT net DOT il>
Organization: Kymatica
X-Mailer: Sylpheed version 0.9.10 (GTK+ 1.2.10; i686-pc-linux-gnu)
Mime-Version: 1.0
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

On Wed, 15 Dec 2004 23:02:07 +0200
"Eli Zaretskii" <eliz AT gnu DOT org> wrote:

> > Date: Wed, 15 Dec 2004 01:12:34 -0200
> > From: Jonatan Liljedahl <lijon AT kymatica DOT com>
> > 
> > Situation: I'm replacing the timer interrupt handler with my own
> > protected mode handler. I'm also reprogramming the PIT chip to 600Hz
> > frequency. I keep a counter so that I can call the original realmode
> > handler at 18.2Hz interval.
> > 
> > Now, everything works fine if I do NOT have smartdrv installed. But
> > if smartdrv is installed, the computer hangs when smartdrv is
> > writing from cache to disc.
> 
> Does the problem go away if you hook the timer interrupt, but do not
> reprogram the timer to a higher frequency?

I just tried this: I leave the PIT alone and I chain to the original
handler at the end of my own handler every time. Yes, the problem goes
away! I also tried to let the PIT run in 120Hz, and chaining at a 18.2Hz
interval - this works too, no hang... 240 worked too, but 480 did not!

Isn't this strange? I always chain to the original handler at 18.2Hz
interval, regardless of how often my custom handler is called (18.2,
120, 240, 480, 600). Why would the original handler (where smartdrv
lives) care about how often my own handler is called?? What could be the
explanation for this?

By the way, I have also tried to disable interrupts while writing to
disc, and to flush smartdrv before enabling interrupts again (assuming
that sync() does signal to smartdrv to flush it's cache, as it says in
the info). This didn't help either.

> > If so, can I work around it somehow? I'd love to not have to write
> > "You must disable smartdrv's write-cache or this program will hang
> > your computer" in the manual!
> 
> If everything else fails, you can include in your program's
> initialization routine code to disable SmartDRV automatically.  Ralf
> Brown's Interrupt List documents the API exported by SmartDRV via
> interrupt 2Fh.

Yes, that would be OK. Does it work under Windows too?

/Jonatan    -=( http://kymatica.com )=-

- Raw text -


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