[ntp:questions] Hints to write a clock driver

Juergen Beisert jbeisert at netscape.net
Sun May 31 17:18:31 UTC 2009


Hi,

currently I'm trying to write a clock driver for my selfmade USB based DCF77
receiver. Communication works trough the "usblib", there is no kernel
driver involved. But now I'm in trouble how to forward the time to the
NTPD. There are various DCF77 drivers in the ntp source tree. But they all
are based on a serial device. I have no. I have to poll my USB device two
times a second. My clock device generates a data set with a reference
second pulse - synced to/by the DCF signal - and also provides the raw bit
information sent via DCF in 59 bits for the next minute (one bit per second
like the DCF77 signal does, but already filtered and converted to binary
data).
Is there a way to use anything from the libparse/ directory to let it decode
the DCF bit stream, but _not_ registering and using a serial device?

Another question: How does the time flow works? I read
the "refclock_hopfpci.c" clock driver, as it also does not use a serial
device. It does something in "hopfpci_poll" (struct refclock.clock_poll).
But the comment of this function (and in all the other implementations I
found) is: "called by the transmit procedure". ????? Will this function be
called periodically (by ntp)? Or does the clock driver trigger something to
let it be called?

Any hints are welcome.
Juergen




More information about the questions mailing list