From owner-freebsd-stable Thu Sep 24 02:41:50 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA03348 for freebsd-stable-outgoing; Thu, 24 Sep 1998 02:41:50 -0700 (PDT) (envelope-from owner-freebsd-stable@FreeBSD.ORG) Received: from limes.NIC.DTAG.DE (limes.NIC.DTAG.DE [194.25.1.113]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA03330 for ; Thu, 24 Sep 1998 02:41:46 -0700 (PDT) (envelope-from bm@Reineke.malepartus.de) Received: from kronos.NIC.DTAG.DE (kronos.NIC.DTAG.DE [194.25.1.92]) by limes.NIC.DTAG.DE (8.8.5/8.8.3) with ESMTP id LAA20042; Thu, 24 Sep 1998 11:40:24 +0200 (MET DST) Received: from kronos.NIC.DTAG.DE (kronos.NIC.DTAG.DE [194.25.1.92]) by limes.NIC.DTAG.DE (8.8.5/8.8.3) with ESMTP id LAA20042; Thu, 24 Sep 1998 11:40:24 +0200 (MET DST) Received: from Reineke.malepartus.de (reineke.malepartus.de [194.25.4.66]) by kronos.NIC.DTAG.DE (8.8.5/8.7.1) with ESMTP id LAA04216; Thu, 24 Sep 1998 11:41:32 +0200 (MET DST) Received: from Reineke.malepartus.de (localhost.Malepartus.de [127.0.0.1]) by Reineke.malepartus.de (8.8.8/8.8.8) with ESMTP id LAA19644; Thu, 24 Sep 1998 11:41:30 +0200 (MEST) (envelope-from bm@Reineke.malepartus.de) Message-Id: <199809240941.LAA19644@Reineke.malepartus.de> From: Burkard Meyendriesch To: Peter Jeremy cc: freebsd-stable@FreeBSD.ORG, bm@malepartus.de, hek@nic.dtag.de Subject: Re: kernel PPS line discipline for NTP In-reply-to: Your Message from Mon, 07 Sep 1998 08:37:52 +1000. <98Sep7.083737est.40333@border.alcanet.com.au> X-Mailer: MH 6.8.3 X-organization: The home of Reineke Fuchs X-GPOS: 52.0844N 7.9081E X-phone: +49 5484 96097 X-pgp-fingerprint: DF 83 04 CD B5 D1 10 43 57 4C AD 9A B1 02 28 17 X-face: "[-;]oI+8gP9>*J%knDN8d%DuhvJS2Lj4L\bRb7gz(pcT?2Zh6_Vam_6csAum3$<&lhAFd^ jt|!&Ut1C~Vg*E/q}+#cbFg-GU]c.bB8Ad,L'W$'9{^0y'AzM4#hS[C[F-1'|O;Kg3Vrq5q6dsU*TmJ@}+QPM\ b[^9Rhd,UoMpRpd5k[X=h.Dom*kbT`cNQ MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19641.906630088.1@Reineke.malepartus.de> Date: Thu, 24 Sep 1998 11:41:29 +0200 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 1998-09-07 08:37:52 +1000 Peter Jeremy wrote: > > Burkard Meyendriesch 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