regarding excising PLL

Gary E. Miller gem at rellim.com
Wed May 4 01:51:27 UTC 2016


Yo Hal!

This discussion has motivated me to actually read up on adjtime() and friends.

On Tue, 03 May 2016 15:13:04 -0700
Hal Murray <hmurray at megapathdsl.net> wrote:

> There are two RFCs describing PPS stuff.
> 
> RFC 1589, 37 pages
>   A Kernel Model for Precision Timekeeping
>   https://tools.ietf.org/html/rfc1589
> 
> RFC 2783, 31 pages
>   Pulse-Per-Second API for UNIX-like Operating Systems, Version 1.0
>   https://tools.ietf.org/html/rfc2783
> 
> The second is the API to read the info the kernel captures when a PPS
> type pulse happens and all the stuff to turn it on/off and such.

See also RFC 5905.  The Linux man page for adjtimex(2) specifies:

    "Linux  uses  David  L.  Mills'  clock  adjustment  algorithm (see
    RFC 5905).  The system call adjtimex() reads and optionally  sets
    adjustment  parameters for this algorithm."

Some other interesting things on that man page.

adjtimex() allows user space to see some kernel PPS values in a
read-only fashion:

               long ppsfreq;    /* PPS (pulse per second) frequency (in units
                                   of 2^-16 ppm--see NOTES, read-only) */
               long jitter;     /* PPS jitter (read-only); nanoseconds, if
                                   STA_NANO status flag is set, otherwise
                                   microseconds */
               int  shift;      /* PPS interval duration (seconds, read-only) */
               long stabil;     /* PPS stability (2^-16 ppm--see NOTES,
                                   read-only) */
               long jitcnt;     /* PPS jitter limit exceeded (read-only) */
               long calcnt;     /* PPS calibration intervals (read-only) */
               long errcnt;     /* PPS calibration errors (read-only) */
               long stbcnt;     /* PPS stability limit exceeded (read-only) */

The BSD kernel can accept PPS directly into the kernel from a serial port.

Kernel 4.5.2, looking in kernel/time/ntp.c at line 222:
        /* PPS is not implemented, so these are zero */
        txc->ppsfreq       = 0;
	[...]

So, no dice there...

Also in adjtimex(), unrelated to this discussion:

               int tai;         /* TAI offset, as set by previous ADJ_TAI
                                   operation (seconds, read-only,
                                   since Linux 2.6.26) */

AFAIK neither gpsd nor chrony try to pass the TAI offset to the kernel.
The kernel does nothing with it, except allow that value to be read back.

Useful as a standard location to store the TAI offset, but not for
anything else.  Someone asked on gpsd-dev lately if the kernel used TAI.

I also found a command line tool to read adjtimex():

	http://www.ibiblio.org/linsearch/lsms/adjtimex.html

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ntpsec.org/pipermail/devel/attachments/20160503/62920f0e/attachment.bin>


More information about the devel mailing list