Subject: Re: Clockticks lost, why ?
To: Michael R Zucca <mrz5149@cs.rit.edu>
From: Christoph Ewering <eweri@uni-paderborn.de>
List: port-mac68k
Date: 01/28/1997 10:28:37
> > 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.
Well, I don't think that this is silly. think it is silly to count the
interrupts and when i reach 60 to add a second to the systemclock.
So why don't i take 60 interrupts and then look what is in the RTC.
You can share processtime with this interrupt, but i don't understand why
use it to calculate the time.
> 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.
Someone said that this won't help to get the right time.
By the way, i've started this thread, because I want to know why NetBSD
can't hold the time and MacOS can. Now I understand why, but I still can't
understand, why NetBSD uses an interrupt when every Mac has a RTC.
The code to read the RTC exists, but it is only called at bootime.
... and it is just a cosmetic bug.
But maybe it is something where i can start to write code for NetBSD.
What say the MacBSD gods to this thread?
Thanks to all who explain it to me, bye
Christoph
Christoph Ewering eweri@uni-paderborn.de
Husarenstrasse 48 Fon: 05254 12555
33104 Paderborn www.uni-paderborn.de/Admin/eweri/