Subject: ntpd - does it work?
To: None <port-macppc@netbsd.org>
From: Donald Lee <donlee_ppc@icompute.com>
List: port-macppc
Date: 03/14/2000 09:07:20
Howdy all,

Love this list.  So many helpful people! ;->

The reason I asked is that I tried using ntpd (and xntpd) and found that
it didn't do anything.  (and debugging it was hard)

I ended up poking around in the kernel source and found where it
initialized the clock variables.  It seems to get its idea
of the clock rate from the "timebase-frequency" in the /PowerPC,604
node in Open Firmware.  The clock freq in the OF on the PCenter 132 is
132000000 (dec) and the timebase-frequency was 10500000.  I'm not sure
why, because 132000000 is not an even multiple of 10500000, as I
would expect.  In any case, I was gaining 685 seconds every 4 hours.
("ntpdate -s" in cron does the clock, and leaves stuff in syslog)
I adjusted this timebase-frequency up by (3600*4 + 685)/(3600*4)
and got something very close to 11000000.  Oddly enough, 11000000 * 12
is 132000000..... hmmm.

For now, I manually did at boot:

	ok> dev /PowerPC,604
	ok> A7D8C0 encode-int " timebase-frequency" property
	ok> boot

(0xA7d8C0 is not what I used, it was slightly smaller.  This is 11M.
My notes are upstairs)

Now the clock appears to be keeping reasonable time.  It's hard to tell, as
I just did this about an hour ago.

I'm going to leave this running a day or so to see how well it's doing.
After that, I'll fire up ntpd, and see if it works.

By the way, I did a load test this morning, and unlike my 68K machines,
the clock does not seem to be affected by activity.  Whatever
mechanism is being used does not "lose" ticks under SCSI load.

Thanks to you all.  I'll keep you posted.

-dgl-