Subject: Re: Clockticks lost, why ?
To: Christoph Ewering <eweri@uni-paderborn.de>
From: Michael R Zucca <mrz5149@cs.rit.edu>
List: port-mac68k
Date: 01/27/1997 16:04:30
> Why do I need to catch an interrupt, when it is possible to read the time
> from a counter that is independant from interrupts?
> Everytime when the clock gets the processor it will call a routine that
> reads the counter. A little calculation, and it has the exact time.
Well, I asked this too and I feel silly because the answer is somewhat obvious.
The RTC chip only has a resolution of 1 second. Certain calls in UNIX present
time with finer resolution. To emulate that you put a counter on the
video interrupt which fires every 60th of a second and you have 60th of
a second resolution.
If you're servicing a long SCSI interrupt and a video interrupt comes in,
you've essentially lost it. Basic problem: we need semaphores to protect
critical code rather than shutting off interrupts for hours at a time.
> This solution is a little to big, to have the right time on my home mac
> :-)
Just don't run any programs :)