Mail Archives: djgpp/1997/11/19/19:03:30
(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 -