(Emacs: -*- indented-text -*-)

		      Installation Instructions
			    for PPSkit-0.7
		    Copyright (c) 1997, 1998, 1999
			   by Ulrich Windl

0) Unpack a compatible version of the Linux kernel sources (if not
   already done).  The kernel version should match the version of the
   patch (e.g. `patch-2.0.31pre9' matches `linux-2.0.31pre9').  Make
   sure that you have the tools and resources needed for a kernel
   compilation (see /usr/src/linux/Documentation/Changes)

1) The patches against the kernel follow the usual convention, that is
   you need `-p1' if your are standing in your kernel directory.
   Apply the patch as usual (e.g. cd /usr/src/linux; patch -p1
   <the_patch).

   If you intend to use xntpd with PPS support, you'll have to make a
   symbolic link (``ln -s ../linux/ppsclock.h /usr/include/sys/ppsclock.h''),
   because I did not want to patch `/usr/include/sys'.  A correspondig link
   is required for <sys/timepps.h>.

2a) `make config' and enable `experimental drivers'.

2b) Select `NTP kernel support', `NTP PPS support', and `NTP PPS
    support on serial port' after selecting the serial driver.  The
    driver can be inserted as a module at runtime if you like.

3a) `make dep' and then make the kernel as usual (e.g. `make bzImage')

3b) OPTIONAL: Have a small break with coffee, tee, cookies, or whatever...

4a) Activate the new kernel (copy the files and modules into place,
    maybe edit /etc/lilo.conf, and re-run LILO) and reboot (as
    usual)...

4b) If you have built the serial driver as a module, load that module
    (`insmod serial.o' if it isn't done automatically) and be sure
    that the `PPSAPI' option is displayed (or logged).  The string
    should read similar to ``Serial driver version 4.27+ with PPSAPI
    enabled''.

5) Do whatever you like ;-) If you use xntpd, be sure to get a recent
   version like xntp3-5.93.  I'm not yet fully convinced about the
   quality of ntp4.0, but 4.0.92h (or later) may be worth a try.  The
   patch won't automatically create a symbolic link from
   <sys/ppsclock.h> to <linux/ppsclock.h> (similar for
   <sys/timepps.h>); do that manually (cd /usr/include && ln -s
   linux/ppsclock.h sys/ppsclock.h).  There is a patch for xntpd
   included to get the ATOM driver working (at least I tested it for
   clocks using a PARSE driver).  You'll also have to remove
   config.cache, do re-configure, and recompile xntpd to get PPS
   support into the daemon.  You should have configured ATOM and LOCAL
   reference clocks in addition to your usual clocks.

   It seems you must recompile ntpd 4.0 to make it use ``STA_NANO''.
   In any case it's highly recommended, as some bit definitions for
   ``adjtimex()'' had to be changed for nanokernel support.

   An unpatched version of xntpd will detect support for `CIOGETEV' and
   use it for `ATOM' (which becomes a peer (`+') after some time).

   With the patch the `ATOM' will become ``PPS peer'' (`o') after some
   time if the preferred peer has been chosen as primary
   synchronization source, and the PPS signal has been monitored to be
   good enough.  You can force the PPS signal to be valid by using
   ``enable pps'' either in your configuration file, or at runtime
   using xntpdc.  I could only test it with PARSE drivers though.

   With ntpd-4.0 the flag ``STA_TIMEFREQ'' should go on once the
   preferred time source is reachable and seems valid.  If the jitter
   is low enough, or if the offset is small enough, ``STA_PPSTIME''
   will also go on.

   Maybe after a while your loopstats file will look like this:
51309 77437.519 0.000000203 16.824265 0.000008846 0.019343 6
51309 77561.521 0.000000001 16.824265 0.000007661 0.016752 6
51309 77686.523 0.000000013 16.838150 0.000006635 0.016083 6
51309 77811.525 0.000000010 16.838150 0.000005746 0.013928 6
51309 77935.527 0.000000131 16.827240 0.000004977 0.013238 6
51309 78057.529 0.000000005 16.827240 0.000004311 0.011465 6
51309 78179.531 0.000000043 16.803436 0.000003735 0.015500 6
51309 78301.534 0.000000168 16.803436 0.000003235 0.013423 6
