Mail Archives: djgpp/1998/07/04/09:30:59
From: | michael DOT mauch AT gmx DOT de (Michael Mauch)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Timer interrupt
|
Date: | Sat, 04 Jul 1998 15:13:58 +0200
|
Organization: | Gerhard-Mercator-Universitaet -GH- Duisburg
|
Lines: | 42
|
Message-ID: | <6nl9r2$fte$1@news-hrz.uni-duisburg.de>
|
References: | <01bda6f1$8ceb4540$LocalHost AT SPOCK>
|
NNTP-Posting-Host: | ppp164.uni-duisburg.de
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
On 4 Jul 1998 02:19:16 GMT, "Matt Barker" <matt DOT b AT clear DOT net DOT nz> wrote:
> int Factor;
> void interrupt (* OldTimerHandler)(void);
> .
> .
> void interrupt TimerHandler(void)
> {
> static int Counter = 1;
> if (Counter == Factor) {
> Counter = 1;
> OldTimerHandler();
> }
> else {
> Counter++;
> asm int 0x1C;
> }
> asm push ax;
> asm mov al,0x20;
> asm out 0x20,al;
> asm pop ax
> }
>
> In converting the function the only line I'm having trouble with is when I
> call OldTimerHandler(). At the moment OldTimerHandler is now in a
> _go32_dpmi_seginfo structure. What is the most efficient way to perform a
> far jmp to OldTimerHandler in DJGPP ie. what function should I use??
I don't know the answer to your question, but I have answers to
questions you didn't ask:
OldTimerHandler() sends an EOI on its own, so you shouldn't do it in
your handler when you call OldTimerHandler(). And IIRC you shouldn't
call Int 1C manually, because that's done by OldTimerHandler() as well -
and I guess you set Factor so that OldTimerHandler() is called just as
often as it is normally called.
For more information on this topic, see Kris Heidenstrom's PC timing FAQ
(pctim003.zip at Simtel mirrors).
Regards...
Michael
- Raw text -