From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 22 Jun 1999 02:17:52 +0000 From: Christopher Pane cpane@metamorsw.com Subject: [9fans] Hooking up to a timer in a driver Topicbox-Message-UUID: 9902a426-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19990622021752.LUStkY15dWTrW5UNutpHu0N-t-6-Q1j9t9rD-IhH4JQ@z> 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