delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/19/19:03:30

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Interrupt hooking help, please
Date: Wed, 19 Nov 1997 19:26:01 +0000
Organization: None
Distribution: world
Message-ID: <l2DqZDAJ1zc0Ewfb@talula.demon.co.uk>
References: <347098B8 DOT 35F3 AT cepsz DOT unizar DOT es> <64tri8$775$1 AT news DOT nyu DOT edu>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 22
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

(noname) writes:
>On a related note, is it possible for a PIT (timer) interrupt to
>_conditionally_ chain to the previous interrupt handler (i.e. the one
>usually responsible for keeping the DOS clock in sync with the world)?

Sure. That is pretty important if you want to keep the rest of the
system running happily while you play tricks with the timer!

The IRQ wrapper functions in libc only support handlers that always
chain or never chain, so you will need to write your own wrapper
function. Then it is up to you whether to use ljmp to call the original
handler, or iret to return instantly.

To get an idea how to do this, take a look at the irq.c and irqwrap.s
files from Allegro. I wrote the wrappers as a little asm stub that call
a C handler function, and optionally chains or irets depending on the
return value.


--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Pigs use it for a tambourine" - Frank Zappa

- Raw text -


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