Subject: PRAM & the Time Manager
To: <>
From: Rick C. Petty <pett0019@gold.tc.umn.edu>
List: port-mac68k
Date: 03/09/1996 16:47:34
On Sat, 9 Mar 1996, Allen Briggs wrote:

> >  How does MacOS keep the clock accurate, with heavy interrupt lossage 
> > with things like floppy too ?
> 
> I don't know.  They might just read it from the RTC on a regular basis...
> Anyone have any ideas?

Well, reading my references didn't help all that much, but it looks like 
the MacOS keeps a low-memory global variable called, ironically, Time 
(0x020C) which contains the number of seconds since Midnight Jan. 1, 
1904.  This number usually reflects the PRAM's number, which is updated 
by the RTC.  The low-memory global gets updated by the Time Manager 
periodically (internally?) to reflect the correct (RTC) time.  I'm 
assuming, since I haven't looked into it further, that While the Time 
Manager is playing around with other tasks, it says "Gee, I wonder what 
time it really is?" and reads the time from the RTC into the low-memory 
global.  So after the floppy driver has taken up a lot of time, the Time 
Manager fixes the time to reflect the current one, I'm guessing...

Now, why can't netbsd follow a similar algorithm?  NTP could set the RTC 
every so often...  I'm not sure how accurate of a time one would need 
anyway, and how accurate can we get using a machine that only keeps track 
of # of seconds...???

--Rick C. Petty,  aka Snoopy
__________________________________________________________
 email: pett0019@gold.tc.umn.edu, pett0019@itlabs.umn.edu
   WWW:     http://www.itlabs.umn.edu/~pett0019/