Date: Sat, 21 May 2005 23:32:02 +0200 From: Christian Hiris <4711@chello.at> To: freebsd-questions@freebsd.org Cc: Darrel <dlevitch@iglou.com> Subject: Re: NTP issues with 5.4 (SOLVED) (fwd) Message-ID: <200505212332.22596.4711@chello.at> In-Reply-To: <Pine.GSO.4.61.0505210916570.4653@shell1> References: <Pine.GSO.4.61.0505191853570.24602@shell1> <200505202240.27506.4711@chello.at> <Pine.GSO.4.61.0505210916570.4653@shell1>
next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart1270199.2FmV2alhb2 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 21 May 2005 15:56:15, Darrel wrote: > On Fri, 20 May 2005, Christian Hiris wrote: > > On Friday 20 May 2005 01:01:01, Darrel wrote: [...] > Thanks, Christian! > > I am comparing to a NetBSD computer with older hardware, that seems to > always have PLL enabled: > > May 14 18:26:10 ntpd[343]: ntpd 4.2.0-r Wed Mar 23 08:12:50 UTC > 2005 (1) > May 14 18:26:11 ntpd[343]: precision =3D 2.000 usec > May 14 18:26:11 ntpd[343]: kernel time sync status 0040 > May 14 18:26:12 ntpd[343]: frequency initialized 74.725 PPM > from /var/db/ntp.drift > May 14 18:29:29 ntpd[343]: time reset -1.128987 s > May 14 18:29:29 ntpd[343]: kernel time sync disabled 0041 > May 14 18:35:49 ntpd[343]: kernel time sync enabled 0001 > > Probably the 4 indicates that the clock had drifted too far for the > program to permit syncing to- perhaps the battery should be replaced. No, that's ok. The synchronization takes some minutes. The '1' indicates th= at=20 PLL updates enabled, but it doesn't tell you much about the actual PLL/FFL= =20 mode. About weak batteries - I run ntpd on a i386 machine that had no batte= ry=20 inserted w/o any problems.=20 > I=20 > am still not sure why we do not see the new NTP4 mode shift to FLL, as > with the FreeBSD computer. > > Maybe the /var/log/messages are just implemented differently on NetBSD > 2.02. I will watch it occasionally with 'ntpdc -c kerninfo | grep > status'. This NetBSD clock is also set to UTC and it seems that I > recall that UTC can be improperly implemented when the computer > previously had Microsoft Windows installed. The answer to your question is quite simple. The status bit STA_MODE hasn't= =20 been implemented in netBSD. I run a diff on FreeBSD's and netBSD's timex.h = to=20 point out the status bits differences: $ diff -u timex.h-freebsd timex.h-netbsd | grep STA_ =2D * format in use is determined by the STA_NANO bit of the status =2D * STA_NANO bit in the status word. See the description below for =2D * STA_FLL bit in the status word. #define STA_PLL 0x0001 /* enable PLL updates (rw) */ #define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */ #define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */ =2D#define STA_FLL 0x0008 /* enable FLL mode (rw) */ +#define STA_FLL 0x0008 /* select frequency-lock mode (rw) = */ #define STA_INS 0x0010 /* insert leap (rw) */ #define STA_DEL 0x0020 /* delete leap (rw) */ #define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */ #define STA_FREQHOLD 0x0080 /* hold frequency (rw) */ #define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */ #define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */ #define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */ #define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */ #define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */ =2D#define STA_NANO 0x2000 /* resolution (0 =3D us, 1 =3D ns) (ro) */ =2D#define STA_MODE 0x4000 /* mode (0 =3D PLL, 1 =3D FLL) (ro) */ =2D#define STA_CLK 0x8000 /* clock source (0 =3D A, 1 =3D B= ) (ro) */ #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ =2D STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) + STA_PPSERROR | STA_CLOCKERR) /* read-only bits */ =2D * Note: The time member is in microseconds if STA_NANO is zero and =2D * STA_NANO is zero and nanoseconds if not. The complete sources are available via cvsweb:=20 http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/sys/sys/timex.h http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/dist/ntp/kernel/sys/time= x.h Cheers, ch =20 =2D-=20 Christian Hiris <4711@chello.at> | OpenPGP KeyID 0x3BCA53BE=20 OpenPGP-Key at hkp://wwwkeys.eu.pgp.net and http://pgp.mit.edu --nextPart1270199.2FmV2alhb2 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQBCj6jm09WjGjvKU74RAsfMAJ9iZFvWhWmsJRQ7ldUsxgBd7274HACdHUl5 jMNS8QH7ruNgLFwmZzHIGv8= =ZXqp -----END PGP SIGNATURE----- --nextPart1270199.2FmV2alhb2--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505212332.22596.4711>