[ntp:questions] Using ntpd with custom clock

Chuck Swiger cswiger at mac.com
Wed Oct 17 17:38:38 UTC 2012


On Oct 17, 2012, at 12:06 AM, Rob wrote:
>> OK.  You can either hook into ntpd's calls to get/settimeofday() and adjtime() as you initially suggested, or perhaps look into the SHM driver.  The latter is a generic interface that puts clock timestamps into shared memory; but you can read from SHM instead of writing, if you like-- would be easier if you have something like a GPS receiver and gpsd populating the SHM timestamps.
> Funny that, after you initially seem to indicate that you have
> understood the question, you still come up with the SHM driver
> that is a REFERENCE CLOCK driver, not an ADJUSTMENT CLOCK driver.

That's right, and you may safely assume I have good reasons for doing so.

Without more information about what the OP is trying to do, it's not
clear whether trying to discipline this "external clock" is best handled
by managing it as a system/kernel clock (ie, like TSC, HPET, ACPI are),
or whether it would be easier to use the SHM interface to communicate with
it, since the SHM interface is generic enough to be used for more than
just what gpsd -> ntpd does, or whether something else might work better.


More information about the questions mailing list