Subject: Time Drift
To: None <>
From: Adam Lebsack <>
List: port-macppc
Date: 08/03/2001 13:51:27
I just started using netbsd-macppc once again and my biggest problem 
was the time drift on my PowerCenter Pro 180 (overclocked to 210). 
The RTC was running at about 94% of the actual speed of time, so  I 
was losing several minutes/hour and ntpd could not keep up.

Anyway, I figured out an accurate fix if anyone is interested.  use 
the date command to set the clock in sync with an accurate watch or 
clock.  Be aware of the time when you set it.

To get a good reading, take a sample of at least a day.  One day 
later, take the seconds passed on your computer and divide it by the 
seconds passed on your clock.  This gave me a value of about 0.94 
(that's rounded off, use as many decimal places as you can).

Next, boot into OF:

>  dev /PowerPC,604
>  .properties

look at the timebase-frequency value (it's in hex, convert it to 
decimal).  I had a value of about 15800000 Hz. For your new value, 
use this simple algebra:

	new_timebase_frequency = timebase_frequency * drift_percentage

My new value was something like 14.9 MHz.  encode it into hex, 
0xE4891A, and then enter this in OF:

>  dev /PowerPC,604
>  E4891A encode-int " timebase-frequency" property
>  .properties

The last command is to verify.  Now, a reboot will clobber this new 
value, so just boot directly:

>  boot

Now, if you got a nice and accurate reading, your clock should be 
pretty sane.  You may spend a lot of time getting it "just right", 
but don't bother.  If it's close enough, just run ntpd and that will 
keep the clock as accurate as you can get it.

I posted this because I felt there weren't any decent explanations of 
this on the web.  Now, it may work with other processors, but I have 
not tested it.