Initial import from FreeBSD RELENG_4:
[games.git] / contrib / ntp / html / kern.htm
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <html>
3 <head>
4 <meta name="generator" content="HTML Tidy, see www.w3.org">
5 <title>Kernel Model for Precision Timekeeping</title>
6 </head>
7 <body>
8 <h3>Kernel Model for Precision Timekeeping</h3>
9
10 <hr>
11 <img align="left" src="pic/alice61.gif" alt="gif"> <a href=
12 "http://www.eecis.udel.edu/~mills/pictures.htm">from <i>Pogo</i>,
13 Walt Kelly</a> 
14
15 <p>Exploding kernel<br clear="left">
16 </p>
17
18 <hr>
19 <p>The technical report [2], which is a major revision and update
20 of an earlier report [3], describes an engineering model for a
21 precision time-of-day function for a generic operating system. The
22 model is based on the principles of disciplined oscillators using
23 phase-lock loops (PLL) and frequency-lock loops (FLL) often found
24 in the engineering literature. The model uses a hybrid PLL/FLL
25 discipline algorithm implemented in the kernel. The hybrid loop
26 provides automatic time and frequency steering with update
27 intervals from a few seconds to over one day.</p>
28
29 <p>The hybrid PLL/FLL has been implemented in the Unix kernels for
30 several operating systems, including FreeBSD and Linux and those
31 made by Sun Microsystems, Digital/Compaq and Hewlett Packard. The
32 modifications are currently included in the licensed kernels for
33 Digital Unix 4.0 (aka Tru64) and Sun Solaris 2.8. Since the
34 modifications involve proprietary kernel interface code, they
35 cannot be provided for other licensed kernels directly. Inquiries
36 should be directed to the manufacturer's representatives. The
37 software and documentation, including a simulator with code
38 segments almost identical to the implementations, but not involving
39 licensed code, is called <tt>nanokernel.tar.gz</tt> and available
40 via the web at <a href="http://www.ntp.org">www.ntp.org</a> or by
41 anonymous FTP from ftp.udel.edu in the <tt>pub/ntp/software</tt>
42 directory.</p>
43
44 <p>Recently [1], the model has been re-implemented to support a
45 nanosecond system clock. The <tt>/usr/include/sys/timex.h</tt>
46 header file defines the applications programming interface (API)
47 routines and data structures. Implementations are available for
48 Linux, FreeBSD, SunOS and Tru64; however, only the Linux and
49 FreeBSD implementations, which are included in recent system
50 versions, are directly available. The software and documentation,
51 including a simulator with code segments almost identical to the
52 implementations, but not involving licensed code, is called <tt>
53 nanokernel.tar.gz</tt> and available via the web at <a href=
54 "http://www.ntp.org">www.ntp.org</a> or by anonymous FTP from
55 ftp.udel.edu in the <tt>pub/ntp/software</tt> directory.</p>
56
57 <p>The model changes the way the system clock is adjusted in time
58 and frequency, as well as provides mechanisms to discipline its
59 time and frequency to an external precision timing source, such as
60 described in the <a href="pps.htm">Pulse-per-second (PPS) Signal
61 Interfacing</a> page. The model incorporates a generic system call
62 interface for use with the NTP or similar time synchronization
63 protocol. The NTP software daemons for Version 3 <tt>xntpd</tt> and
64 Version 4 <tt>ntpd</tt> use this API to provide synchronization
65 limited in principle only by the accuracy and stability of the
66 external timing source. There are two new system calls defined in
67 <tt>timex.h</tt>, <tt>ntp_gettime()</tt>, which returns a structure
68 including the current time, estimated error and maximum error, and
69 <tt>ntp_adjtime()</tt>, which provides a means to adjust kernel
70 variables, including the current time and frequency offsets.</p>
71
72 <p>These kernel modifications are normally used in conjunction with
73 a kernel hardware interface such as described in the <a href=
74 "kernpps.htm">Kernel Programming Interface for Precision Time
75 Signals</a> page.</p>
76
77 <h4>References</h4>
78
79 <ol>
80
81 <li><p>Mills, D.L., and P.-H. Kamp. The nanokernel. <i>Proc. Precision
82 Time and Time Interval (PTTI) Applications and Planning Meeting</i>
83 (Reston VA, November 2000). Paper: <a href=
84 "database/papers/nano/nano2.ps">PostScript</a> | <a href=
85 "http://www.eecis.udel.edu/~mills/database/papers/nano/nano2.pdf">
86 PDF</a>, Slides: <a href=
87 "http://www.eecis.udel.edu/~mills/database/brief/nano/nano.htm">
88 HTML</a> | <a href=
89 "http://www.eecis.udel.edu/~mills/database/brief/nano/nano.ps">
90 PostScript</a> | <a href=
91 "http://www.eecis.udel.edu/~mills/database/brief/nano/nano.pdf">
92 PDF</a> | <a href=
93 "http://www.eecis.udel.edu/~mills/database/brief/nano/nano.ppt">
94 PowerPoint</a></p></li>
95
96 <li><p>Mills, D.L. Unix kernel modifications for precision time
97 synchronization. Electrical Engineering Department Report 94-10-1,
98 University of Delaware, October 1994, 24 pp. Abstract: <a href=
99 "http://www.eecis.udel.edu/~mills/database/reports/kern/kerna.ps">
100 PostScript</a> | <a href="database/reports/kern/kerna.pdf">PDF</a>,
101 Body: <a href=
102 "http://www.eecis.udel.edu/~mills/database/reports/kern/kernb.ps">
103 PostScript</a> | <a href=
104 "http://www.eecis.udel.edu/~mills/database/reports/kern/kernb.pdf">
105 PDF</a></p></li>
106
107 <li><p>Mills, D.L. A kernel model for precision timekeeping. Network
108 Working Group Report RFC-1589, University of Delaware, March 1994.
109 31 pp. <a href=
110 "http://www.eecis.udel.edu/~mills/database/rfc/rfc1589.txt">
111 ASCII</a></p></li>
112 </ol>
113
114 <hr>
115 <a href="index.htm"><img align="left" src="pic/home.gif" alt=
116 "gif"></a> 
117
118 <address><a href="mailto:mills@udel.edu">David L. Mills
119 &lt;mills@udel.edu&gt;</a></address>
120 </body>
121 </html>
122