9fans archive / 1999 / 06 / 49 / prev next
From: Christopher Pane cpane@met...
Subject: [9fans] Hooking up to a timer in a driver
Date: Tue, 22 Jun 1999 02:17:52 +0000
Hi,
This is an update.
I have been hacking into how the pc kernal setups up the 8253 PIT.
It looks like if you want to get interrupted you insert a call to your
clock routine inside the clock() function in pc/clock.c.
Here is what is there now -
static void
clock(Ureg *ur, void *arg)
{
Proc *p;
int nrun = 0;
USED(arg);
m->ticks++;
checkalarms();
uartclock();
hardclock();
/* And more clock stuff */
}
Is it correct to assume that if I want a clock interrupt I can add a
midiclock() function , like the uartclock() and mouseclock() functions
that will get called every time clock is called by the timer, thus
giving me a way to sample the output queue for my file system, and
decide if is time to send the data to the MIDI port?
Am I way off here, I am kind exploring how to do this by reverse
engineering what is going on in the code !!!
Thanks
-Chris Pane