[LinuxPPS] How to use PPS to adjust system clock time ?

Ran Shalit Ran.Shalit at comm-it.com
Sat Feb 16 11:47:03 CET 2019


________________________________________
From: Rodolfo Giometti [giometti at enneenne.com]
Sent: Saturday, February 16, 2019 12:36
To: Ran Shalit; discussions at linuxpps.org
Subject: Re: [LinuxPPS] How to use PPS to adjust system clock time ?

On 16/02/2019 09:43, Ran Shalit wrote:
>
>
>> Is it that the linuxpps interface already attached the pps to the system clock ?
>
>> No. A pps device simply attachs a timestamp to each arriving pulse then a
>> userland program uses these information to precisely set system clock.
>
> One more if I may on this issue:
> Is there a way to adjust system clock (from pps) in kernel instead of doing it in userland ? How ? (I ask because I am still not sure how to do this adjustment from userland, and might find that doing it in kernel it is simpler)

>Take a look here:

  >  http://paul.chavent.free.fr/pps.html


Right, I am familiar with this page, and tried to understand it.
Actually it is related to my original question.
In 4.1 there are several steps:
1. attach PPS to a "kernel consumer" , and lock phase and frequency in kernel (PPS_KC_BIND).
2. use adjtimex in userland

What I don't understand is what PPS_KC_BIND actually does. There is almost no documentation of this.
Does it actually synchronize the system clock with pps ?
If it does it is exactly what I need, and means that I can achieve this sync without ntp, or any other clock adjustment from userland.

I also assume that doing step (1) is sufficient, i.e. I don't need to ever do to step (2) of adjtimex, if I do step (1), Right ?


Thank you very much,
RanThis email has been scanned for spam and viruses by Proofpoint Essentials.



More information about the discussions mailing list