[ntp:questions] Re: PPS working or not? FreeBSD 5.4

Per Hedeland per at hedeland.org
Mon Jan 30 23:02:46 UTC 2006

In article <8gkDf.11755$wl.3150 at text.news.blueyonder.co.uk> "David J
<david-taylor at blueyonder.co.not-this-bit.nor-this-part.uk.invalid>
>Per Hedeland wrote:
>> In article <qObDf.11636$wl.1818 at text.news.blueyonder.co.uk> "David J
>> Taylor"
>> <david-taylor at blueyonder.co.not-this-bit.nor-this-part.uk.invalid>
>> writes:
>>> Many thanks, Harlan.  I'll look into this, although I am a little
>>> disappointed to find that less than 24 hours after starting with
>>> FreeBSD I'm having to recompile the kernel!
>> Well, using PPS_SYNC shouldn't be *required* to use the PPS signal on
>> FreeBSD - what it does is make the kernel discipline the local clock
>> directly from the PPS signal, but FreeBSD also supports the PPSAPI, to
>> let ntpd collect the timestamps from the PPS signal. It should be
>> possible to use this via the ATOM driver. I haven't personally
>> verified any of this though (hence the "should"s) - and I guess
>> PPS_SYNC may give better results, but it could be interesting to try
>> both variants.

>Per, thanks for that.  I think I understand what you are saying (although 
>I may not next week!):
>- you need to recompile the kernel if you want the PPS signal to 
>discipline the local clock directly
>- there is an alternative programming interface, the PPSAPI, which FreeBSD 
>supports, but this API is not used by the NEMA driver.  (Why not?)

Actually, checking the source, the NMEA driver (along with a handful of
others) *does* use the PPSAPI interface. However for these drivers it
happens sort of "under the cover", i.e. they effectively replace the
timestamp obtained from the serial data input with the one obtained from
the PPS signal, and the "core ntpd" knows nothing about it.

I've never really seen the point of this - it saves a line in the config
file, but that's about it, and it seems to me that you get less control
and monitoring capabilities than when explicitly using ATOM (actually it
has been renamed to the more appropriate PPS, I'm just behind the
times...) to collect the PPS time stamps. As far as I know you can't
even tell that you're receiving any PPS pulses other than implicitly by
the low jitter.

There is obviously also a lot of code duplication, and each driver seems
to provide its own way (if any) to tweak the PPSAPI parameters
(ASSERT/CLEAR etc) - and of course, the fact that only some of the
reference clock drivers have the PPSAPI support, and that you may need
to check the source to find out about it, doesn't help (it *is*
documented for NMEA though).

Anyway, bottom line: You were probably already using the PPS signal
before you recompiled the kernel - you just couldn't tell.:-)

--Per Hedeland
per at hedeland.org

More information about the questions mailing list