[prev in list] [next in list] [prev in thread] [next in thread]
List: freebsd-stable
Subject: Re: kernel PPS line discipline for NTP
From: Burkard Meyendriesch <bm () malepartus ! de>
Date: 1998-09-24 9:41:29
[Download RAW message or body]
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic