Date: Thu, 24 Sep 1998 11:41:29 +0200 From: Burkard Meyendriesch <bm@malepartus.de> To: Peter Jeremy <peter.jeremy@auss2.alcatel.com.au> Cc: freebsd-stable@FreeBSD.ORG, bm@malepartus.de, hek@nic.dtag.de Subject: Re: kernel PPS line discipline for NTP Message-ID: <199809240941.LAA19644@Reineke.malepartus.de> In-Reply-To: Your Message from Mon, 07 Sep 1998 08:37:52 %2B1000. <98Sep7.083737est.40333@border.alcanet.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
1998-09-07 08:37:52 +1000 Peter Jeremy <peter.jeremy@auss2.alcatel.com.au> wrote: > > Burkard Meyendriesch <bm@malepartus.de> writes: > > > > I'm trying to install a NTP pulse per second suport on my FreeBSD-2.2.7 > > > > Can anybody of you give me a hint for installing a timestamp line > > discipline on FreeBSD? > > There is an undocumented ioctl that will do almost what you want > (assuming your PPS signal is tied to DCD on a serial port): > > struct timeval tv; > > ioctl(fd, TIOCDCDTIMESTAMP, &tv); > > This will enable the capture of, and report the time of the last > inactive -> active DCD edge on the serial port. (There's also > TIOCTIMESTAMP, which timestamps received characters). > > Note that the ppbus parallel port driver in -current includes similar > functionality. > > The reason I say `almost' is that: > 1) Since both the 16[45]50 and the code treat DCD transitions as a low > priority, there will be a substantial amount of jitter on the > timestamps. On a 486DX2/50, interrupt latencies are typically > ~12usec (peaking to ~50usec) for the clock interrupt. The SIO > interrupts are likely to be somewhat worse (because they are > masked more frequently). Once the interrupt is recognized, the > DCD transition isn't noted until after any received characters > are processed. > 2) The code does not include the hooks to call hardpps(), so the PPS > signal can't be used to directly discipline the kernel PLL. > > This may or may not be an issue for you. > > I have patched sio.c on 2.2.6 to support a PPS signal,whilst > minimising the jitter within the sio interrupt handler and including a > call to hardpps(). The changed in 2.2.7 are fairly minor, so the > patch should apply fairly cleanly. Let me know if you're interested. > > I'm also looking at a solution to compensate for interrupt latencies, > but that will require additional hardware and a bi-directional > parallel port. > Hello Peter, thanks for your advice. I'm still interested in your sio.c modifi- cations for PPS support. Would you please send me the patches? Thanks in advance Burkard To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809240941.LAA19644>