From owner-freebsd-hackers Mon May 6 12:06:01 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA01421 for hackers-outgoing; Mon, 6 May 1996 12:06:01 -0700 (PDT) Received: from tfs.com (tfs.com [140.145.250.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA01416 for ; Mon, 6 May 1996 12:05:59 -0700 (PDT) Received: from critter.tfs.com by tfs.com (smail3.1.28.1) with SMTP id m0uGVbS-0003xMC; Mon, 6 May 96 12:05 PDT Received: from localhost (localhost [127.0.0.1]) by critter.tfs.com (8.7.5/8.6.12) with SMTP id TAA10051; Mon, 6 May 1996 19:05:40 GMT X-Authentication-Warning: critter.tfs.com: Host localhost [127.0.0.1] didn't use HELO protocol To: Peter Olsson Cc: hackers@freebsd.org Subject: Re: DCF77 + xntpd + freebsd = WOW! In-reply-to: Your message of "Mon, 06 May 1996 19:08:42 +0200." <2.2.32.19960506170842.007555d8@lda> Date: Mon, 06 May 1996 19:05:38 +0000 Message-ID: <10049.831409538@critter.tfs.com> From: Poul-Henning Kamp Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > >Here then is the punchline: That receiver cost me something like 40 DMK > >via mail-order from "Konrad Electronic". Who said precise time-keeping > >had to be expensive ? :-) > > Do you have fax or email to Konrad Electronic? germany + (09622) 30 265 The chip I used is called "U2775" I belive it has order# 18 29 66-23 There is also a complete clock Incl RS-232. > How does this work in the > freebsd-box, do I need some sort of program for receiving or do I just use > xntpd and configure my local ntp.conf for it? (In the latter case, how do I > configure it, "server 127.127.8.20"?) What will the stratum be with > this device? Your stratum will be one, because the ref-clock has zero: xntpdc> loopinfo offset: -0.000303 s frequency: 6.238 ppm poll adjust: 30 watchdog timer: 52 s xntpdc> sysi system peer: GENERIC(20) system peer mode: sym_active leap indicator: 00 stratum: 1 precision: -18 root distance: 0.01324 s root dispersion: 0.00143 s reference ID: [] reference time: b538cb69.420c49b0 Mon, May 6 1996 21:03:05.258 system flags: pll monitor stats frequency: 0.000 ppm stability: 4.360 ppm broadcastdelay: 0.003906 s authdelay: 0.000122 s xntpdc> Here is my ntp.conf: driftfile /etc/ntp.drift peer 127.127.1.5 peer 127.127.8.20 statsdir /home/ntpstats/ filegen peerstats file peerstats type day enable filegen loopstats file loopstats type day enable filegen clockstats file clockstats type day enable Here is the patch to xntpd to configure the DCF gadget: Index: Makefile.inc =================================================================== RCS file: /home/ncvs/src/usr.sbin/xntpd/Makefile.inc,v retrieving revision 1.13 diff -u -r1.13 Makefile.inc --- Makefile.inc 1995/07/21 13:03:43 1.13 +++ Makefile.inc 1995/12/30 14:07:23 @@ -1,9 +1,10 @@ DEFS_LOCAL=-DREFCLOCK -DPARSE NTPDEFS= -DSYS_FREEBSD -DSYS_44BSD AUTHDEFS= -DMD5 -CLOCKDEFS= -DLOCAL_CLOCK -DPST -DWWVB -DAS2201 -DGOES -DGPSTM -DOMEGA \ - -DLEITCH -DTRAK -DACTS -DATOM -DDATUM -DHEATH -DMSFEES \ - -DMX4200 -DNMEA -DBOEDER +#CLOCKDEFS= -DLOCAL_CLOCK -DPST -DWWVB -DAS2201 -DGOES -DGPSTM -DOMEGA \ +# -DLEITCH -DTRAK -DACTS -DATOM -DDATUM -DHEATH -DMSFEES \ +# -DMX4200 -DNMEA -DBOEDER +CLOCKDEFS= -DLOCAL_CLOCK -DRAW_DCF -DFREEBSD_CONRAD -DDEBUG CFLAGS+= ${NTPDEFS} ${DEFS_LOCAL} ${AUTHDEFS} ${CLOCKDEFS} ${COPTS} BINDIR?= /usr/sbin Index: parse/util/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/xntpd/parse/util/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- Makefile 1995/04/04 17:48:02 1.2 +++ Makefile 1995/12/30 17:37:30 @@ -4,7 +4,7 @@ CFLAGS+= -I${.CURDIR}/../../include CFLAGS+= -DNTP_POSIX_SOURCE -DUSE_PROTOTYPES -CFLAGS+= -DSYS_FREEBSD -DBOEDER -DHAVE_TERMIOS -DHAVE_BSD_NICE +CFLAGS+= -DSYS_FREEBSD -DBOEDER -DHAVE_TERMIOS -DHAVE_BSD_NICE -DCONRAD .if exists(${.CURDIR}/../../lib/obj) LDADD+= -L${.CURDIR}/../../lib/obj Index: parse/util/dcfd.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/xntpd/parse/util/dcfd.c,v retrieving revision 1.4 diff -u -r1.4 dcfd.c --- dcfd.c 1995/07/21 13:03:58 1.4 +++ dcfd.c 1995/12/30 14:07:24 @@ -1393,8 +1393,22 @@ if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK) == -1) perror("F_SETFL"); +#if !defined(CONRAD) if (ioctl(fd, TIOCCDTR, 0) == -1) perror("TIOCCDTR"); +#else + + { + int i; + + if (ioctl(fd, TIOCMGET, &i) == -1) + perror("TIOCMGET"); + i |= TIOCM_DTR; + i &= ~TIOCM_RTS; + if (ioctl(fd, TIOCMSET, &i) == -1) + perror("TIOCMSET"); + } +#endif #endif PRINTF(" DCF77 monitor - Copyright 1993,1994, Frank Kardel\n\n"); Have Fun! Poul-Henning -- Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. whois: [PHK] | phk@ref.tfs.com TRW Financial Systems, Inc. Future will arrive by its own means, progress not so.