\documentclass[letterpaper]{article}
\nonstopmode
\akai
\usepackage{linuxdoc-sgml}
\usepackage{qwertz}
\usepackage{url}
\usepackage[latin1]{inputenc}
\usepackage{t1enc}
\usepackage[english]{babel}
\usepackage{epsfig}
\usepackage{null}
\def\addbibtoc{
\addcontentsline{toc}{section}{\numberline{\mbox{}}\relax\bibname}
}%end-preamble
\setcounter{page}{1}
\title{ÈçºÎÉè¶¨ÓëÎ¬³Ö×¼È·µÄµçÄÔÊ±ÖÓ}
\author{×÷Õß: Ron Bean, {\ttfamily \onlynameurl{rbean@execpc.com}}\\ 
ÒëÕß: Da-Wei Chiang, {\ttfamily \onlynameurl{dawei@sinica.edu.tw}}}
\date{v, December 1996
·­ÒëÈÕÆÚ: 2-16 July 1998}
\abstract{ÈçºÎÉè¶¨ÓëÎ¬³Ö×¼È·µÄµçÄÔÊ±ÖÓ.}


\begin{document}
\maketitle
\tableofcontents

\section{½éÉÜ}

¸öÈËµçÄÔ(ÉõÖÁì¶°º¹óµÄ¹¤×÷Õ¾)Ö÷»ú°åÉÏËùÊ¹ÓÃµÄ real-time-clock ¾§Æ¬²»¹»×¼È·ÊÇÖÚËù½ÔÖªµÄÊÂÇé. 
È»¶ø Linux ×÷ÒµÏµÍ³Ìá¹©ÁËÒ»¸ö¼òµ¥µÄ·½·¨À´Ð£ÕýÕâ¸ö²»×¼È·µÄµçÄÔÊ±ÖÓ, 
Ê¹µÃµçÄÔÊ±ÖÓ¾ÍËãÊÇ²»ÒÐÀµÍâÃæµÄÐ£Ê±Ô´Ò²¿ÉÒÔ´ïµ½ *{\itshape Ïàµ±\/}* ×¼È·µÄµØ²½.
µ«ÊÇËÆºõ´ó¶àÊýÈË¶¼»¹²»ÖªµÀÓÐÕâ¸ö·½·¨, ÆäÔ­ÒòÈçÏÂ:

\begin{enumerate}
\item  ÔÚÒ»°ã ``ÈçºÎÉè¶¨ linux ×÷ÒµÏµÍ³'' µÄÎÄ¼þÖÐ²¢Î´Êö¼°Õâ¸ö·½·¨,
¶øÇÒÔÚ°²×°×÷ÒµÏµÍ³Ê±ºÜÄÑ×Ô¶¯µØÍê³ÉÉè¶¨ (µ«ÊÇÀíÂÛÉÏ²¢²»ÊÇ²»¿ÉÄÜµÄ,
Èç¹ûÄãÓÐÒ»Ì¨Êý¾Ý»úµÄ»°).
\item  ÈôÄãÊ¹ÓÃ``{\ttfamily man clock}''À´²é¿´Éè¶¨Ê±ÖÓµÄËµÃ÷Ê±, 
Äã¿ÉÄÜ»áÈ¡µÃ·ÇÔ¤ÆÚµÄ {\ttfamily clock(3)} ËµÃ÷ÄÚÈÝ.
(ÊÔÖøÊ¹ÓÃ``{\ttfamily man 8 clock}'').
\item  ËÆºõ´ó¶àÊýÈË²¢²»ÔÚÒâÏÖÔÚµÄÕýÈ·Ê±¿ÌÊÇ¶àÉÙ.
\item  ÄÇÐ©ÉÙÊýÔÚÒâµÄÈËÍùÍù»á²ÉÓÃ {\ttfamily louie.udel.edu} ËùÌá¹©µÄ {\ttfamily xntpd} 
³ÌÊ½¼¯ÒÔ±ãÓëÍâÃæµÄÐ£Ê±Ô´, ÀýÈçÍøÂ·Ð£Ê±ËÅ·þÆ÷»òÎÞÏßµçÊ±ÖÓÐÅºÅ, È¡µÃÍ¬²½.
\end{enumerate}


Èç¹û¸÷Î»¶Ô±¾ÎÄËù½²ÊöµÄµÍ½×µÄÊ±ÖÓÉè¶¨·½·¨ÓÐÖø¼«¸ß¶ÈµÄÐËÈ¤,
ÎÒÇ¿ÁÒ½¨Òé¸÷Î»»¨Ð©Ê±¼äÀ´ä¯ÀÀÍøÒ³\nameurl{http://www.eecis.udel.edu/ntp/}{} ,
Õâ¸öÍøÒ³ÓÐÖø¸÷ÀàÄãËù¸ÐÐËÈ¤µÄÄÚÈÝ,ÀýÈçÓÐ¹Øì¶ {\ttfamily xntpd} µÄÍêÕû×ÊÑ¶ÒÔ¼°  NIST Óë USNO µÈÕ¾Ì¨µÄ³¬Á¬½á. 
(ÎÒÔÚ±¾ÎÄááÃæÒ²¶Ô {\ttfamily xntpd} ×÷ÁËÐ©ÐíµÄ¼ò½é.)

\begin{description}
\item[×¢Òâ] \mbox{}

Èç¹ûÄãÔÚÍ¬Ò»Ì¨»úÆ÷ÉÏÅÜ¶à¸ö×÷ÒµÏµÍ³,
ÄãÓ¦¸ÃÖ»ÈÃÆäÖÐÒ»¸öÀ´ÖØÐÂÉè¶¨ CMOS Ê±ÖÓ,
Èç´ËËüÃÇ¡õ²»»áÏà»¥Ó°Ïì¶øµ¼ÖÂ»ìÂÒ.
¼ÙÊ¹ÄãÆ½³£ÔÚÍ¬Ò»Ì¨»úÆ÷ÉÏÅÜ Linux ºÍ Windows ¶þÖÖ×÷ÒµÏµÍ³,
¶øµ±ÄãÒªÑ°ÕÒÒ»Ð©¹²ÏíµÄÐ£Ê±³ÌÊ½±ãÊ±¿ÉÒÔºöÂÔ Windows ×÷ÒµÏµÍ³µÄ²¿·Ö
(²Î¿¼Ç°ÃæËùËµÍøÒ³µÄ³¬Á¬½á).

\end{description}



\section{Ê¹ÓÃ``{\ttfamily clock}''³ÌÊ½}

ËùÓÐÄãÐëÒªÖªµÀµÄÄÚÈÝ¶¼ÔÚ {\ttfamily clock(8)} µÄËµÃ÷ÖÐ,
¶ø±¾ÎÄ½«´øÁì¸÷Î»Íê³ÉÕû¸öÉè¶¨³ÌÐò.

\begin{description}
\item[×¢Òâ] \mbox{}

ÒªÖ´ÐÐ``{\ttfamily clock}''»òÊÇÆäËü»áÓ°Ïìµ½ÏµÍ³Ê±¼äºÍ CMOS Ê±ÖÓµÄ³ÌÊ½,
Äã±ØÐëÓµÓÐ {\bfseries root} µÄÈ¨ÏÞ.

\end{description}



\subsection{¼ì²éÄãµÄ×÷ÒµÏµÍ³}

¼ì²éÄã×÷ÒµÏµÍ³µÄ¿ª»úÖ´ÐÐµµÖÐÊÇ·ñÓÐÀàËÆ``{\ttfamily clock -a}''»ò
``{\ttfamily clock -ua}''µÄÃüÁî.
Õâ¸öÃüÁî¿ÉÄÜ·ÅÔÚ {\ttfamily /etc/rc.local} ,»ò {\ttfamily /etc/rc.d/rc.sysinit} ,
»òÆäËüÀàËÆµÄµØ·½, ÕâÒª¿´Äã°²×°µÄÊÇÄÇÒ»Ì× Linux ×÷ÒµÏµÍ³.

Èç¹ûÕÒµ½µÄÃüÁîÊÇ ``{\ttfamily clock -s}'' »ò ``{\ttfamily clock -us}'' ,
Çë½« ``{\ttfamily s}'' ¸ü¸Ä³É ``{\ttfamily a}'' ,
½ÓÖø¼ì²é¿´¿´ÊÇ·ñÓÐ {\ttfamily /etc/adjtime} Õâ¸öµµ°¸,
¸Ãµµ°¸µÄÄÚÈÝÖ»ÓÐÒ»ÐÐ¿´ÆðÀ´ÏñÊÇÕâÑù:
\begin{tscreen}
\begin{verbatim}
0.000000 842214901 0.000000
\end{verbatim}
\end{tscreen}


ÕâÐ©Êý×ÖÒÀÐòÊÇÐ£ÕýÒò×Ó (Ã¿ÌìÆ«²îµÄÃëÊý),
ÉÏÒ»´ÎÐ£ÕýÊ±ÖÓµÄÊ±¼ä (ÓÉ Jan 1, 1970 ¿ªÊ¼ÆðËãµÄÃëÊý),
ÉÏÒ»´ÎÐ£ÕýËù¿Û³ýµÄÃëÊý.
Èç¹ûÄãÕÒ²»µ½Õâ¸öµµ°¸, ÇëÒÔ {\bfseries root} µÄÉí·Ý²úÉú´Ëµµ°¸,
ÆäÄÚÈÝÖ»ÓÐÒ»ÐÐ¿´ÆðÀ´ÏñÊÇÕâÑù (È«²¿ÊÇÁã):
\begin{tscreen}
\begin{verbatim}
0.0 0 0.0
\end{verbatim}
\end{tscreen}


È»ááÍ¸¹ý shell ÊÖ¶¯Ö´ÐÐ ``{\ttfamily clock -a}'' »ò ``{\ttfamily clock -ua}''
ÒÔ±ã¸üÐÂµÚ¶þ¸öÊý×Ö
(Èç¹ûÄãµÄÊ±ÖÓ±»Éè¶¨³ÉÐ­µ÷¹ú¼ÊÊ±¼ä¶ø²»ÊÇ±¾µØÊ±¼ä
ÄãµÃÊ¹ÓÃ ``{\ttfamily u}''Õâ¸ö²ÎÊý).


\subsection{Á¿²âÊ±ÖÓµÄÆ«²îÂÊ}

Ê×ÏÈÄãµÃÖªµÀÏÖÔÚµ½µ×ÊÇ¼¸µãÖÓ {\ttfamily :-)}.
Äã»úÆ÷µÄ±¾µØÊ±¼ä¿ÉÄÜÊÇ²»×¼È·µÄ.
ÎÒ×îÏ²»¶µÄ·½·¨ÊÇ²¦µç»°µ½ WWV µÄ (303)499-7111 µç»°±¨Ê±Ì¨
(ÕâÊÇ¸ö¸¶·Ñµç»°).
Èç¹ûÄãÄÜ¹»ÓëÍøÂ·Ð£Ê±ËÅ·þÆ÷Á¬ÉÏÏß,
ÄãÒ²¿ÉÒÔÊ¹ÓÃ {\ttfamily xntpd} ³ÌÊ½¼¯ËùÌá¹©µÄ {\ttfamily ntpdate} ³ÌÊ½À´Ð£Ê±
(Ê¹ÓÃ {\ttfamily -b} Ñ¡ÏîÒÔ±ÜÃâÏµÍ³ÅªÂÒ CMOS Ê±ÖÓ).
»òÕßÊ¹ÓÃ ``{\ttfamily date -s hh:mm:ss}'' ÒÔÊÖ¶¯·½Ê½Éè¶¨ÏµÍ³Ê±ÖÓ,
²»ÂÛÄÇÒ»ÖÖ·½·¨×îáá¶¼µÃÊ¹ÓÃ ``{\ttfamily clock -w}'' ½«ÏµÍ³Ê±¼äÐ´Èë CMOS Ê±ÖÓ.
Äã±ØÐë¼ÇµÃ×îááÒ»´ÎÉè¶¨Ê±ÖÓµÄÈÕÆÚ,
ËùÒÔÄãµÃ½«¸ÃÈÕÆÚÐ´ÏÂÀ´·ÅÔÚ²»»áÒÅÊ§µÄµØ·½.
Èç¹ûÄãÊ¹ÓÃµÄÊÇ {\ttfamily ntpdate} ³ÌÊ½, Ö´ÐÐ ``{\ttfamily date +\%s}''
È»ááÐ´ÏÂ×Ô´Ó Jan 1,1970 ËãÆðµ½¸Ã³ÌÊ½Ö´ÐÐµÄÃëÊý.

È»ááµÈ´ý¼¸Ìì»ò¼¸¸öÐÇÆÚááÖ®ááÔÙ»ØÀ´¿´¿´Ê±ÖÓµ½µ×Æ«²îÁË¶àÉÙÊ±¼ä.
Èç¹ûÄãÒÔÊÖ¶¯µÄ·½Ê½Éè¶¨Ê±ÖÓ, ½¨ÒéÖÁÉÙµÃµÈ´ý¶þ¸öÐÇÆÚÖ®áá,
ÔÙÀ´¼ÆËãÊ±ÖÓÆ«²îÂÊ½«¿ÉµÃµ½Ç÷½ü .1 sec/day µÄ½á¹û.
¼¸¸öÔÂÖ®ááÆ«²îÂÊÓ¦¸Ã»áÇ÷½ü  .01 sec/day
(ÓÐÐ©ÈËÐû³ÆÓ¦¸Ã¸ü×¼È·, µ«ÊÇÎÒ¸öÈË³Ö±£ÁôµÄÌ¬¶È).
Èç¹ûÄãÊ¹ÓÃ {\ttfamily ntpdate} ³ÌÊ½À´Éè¶¨Ê±ÖÓÄã¿ÉÄÜ²»±ØµÈ´ýÌ«¾ÃµÄÊ±¼ä,
È»¶ø²»ÂÛÊ¹ÓÃÄÇÖÖ·½Ê½Ö®áá¶¼µÃ×öÐ©Î¢µ÷µÄ¹¤×÷.

Äã¿ÉÒÔÊ¹ÓÃ cron ÔÚÒ»¶¨µÄÊ±¼äÖÜÆÚÄÚÖ´ÐÐ ``{\ttfamily clock -a}''
ÒÔ±ãÏµÍ³Ê±¼äÄÜ¹»Óë (Ð£Õý¹ýµÄ) CMOSÊ±¼äÎ¬³ÖÒ»ÖÂÐÔ.
ÆäÊµÔÚÄãÃ¿´Î¿ª»úµÄÊ±ºò¶¼»á´Ó¿ª»úÖ´ÐÐµµÀ´Ö´ÐÐÕâ¸öÃüÁî,
È»¶øÖ»Òª³£³£×öÉÏÃæÕâ¸ö¶¯×÷¾Í¿ÉÒÔ´ïµ½Äã×¼È·»úÆ÷Ê±¼äµÄÄ¿µÄ. 

×¢ÒâÈç¹ûÏµÍ³Ê±¼äµÄÐÞÕýÒ»´Î³¬¹ýÒ»Ãë»òÊÇÊ±¼äÍù»ØÐÞÕý,
ÓÐÐ©ÏµÍ³µÄ clock ³ÌÊ½¿ÉÄÜ»áÎÞ·¨Ö´ÐÐ.
Èç¹ûÄãÓÐÕâ·½ÃæµÄÎÊÌâ, Ôò¿ÉÒÔÊ¹ÓÃ {\ttfamily xntpd} »ò {\ttfamily ntpdate} ³ÌÊ½
À´Öð²½µØÐÞÕýÊ±¼ä. 


\subsection{ÊµÀý}


\subsubsection{Éè¶¨Ê±¼ä}

Ç©ÈëÏµÍ³²¢³ÉÎª {\bfseries root}.
²¦µç»°ÖÁ (303)499-7111 (ÓïÒô), À´ñöÌý±¨Ê±µÄÄÚÈÝ.
È»ááÊ¹ÓÃ¼üÅÌ´ò³öÏÂÃæ¼¸¸ö×Ö:
\begin{tscreen}
\begin{verbatim}
date -s hh:mm:ss
\end{verbatim}
\end{tscreen}

Ò»Ö±µÈµ½ßÙµÄÒ»Éù¡õ°´ÏÂ enter ¼ü.
(Èç¹ûÔÚ´Ë´¦Ê¹ÓÃ ``{\ttfamily ntpdate}'' ³ÌÊ½, ÔòÄã¿ÉÒÔÊ¡ÂÔ²¦µç»°µÄ¶¯×÷)
Õâ¸ö²½ÖèÔÚÉè¶¨ ``ÏµÍ³Ê±¼ä''.
½ÓÖøÖ´ÐÐ:
\begin{tscreen}
\begin{verbatim}
clock -w
\end{verbatim}
\end{tscreen}

Õâ¸ö²½Öè½«ÏµÍ³Ê±¼äÐ´»Ø CMOS Ê±ÖÓÈÃ¶þÕßÊ±¼äÒ»ÖÂ.
½ÓÖøÖ´ÐÐ:
\begin{tscreen}
\begin{verbatim}
date +%j
\end{verbatim}
\end{tscreen}

(Èç¹ûÔÚÇ°ÃæÊ¹ÓÃ ``{\ttfamily ntpdate}'' ³ÌÊ½ÄãµÃÖ´ÐÐ ``{\ttfamily date +\%s}'')
½«ÆäÖ´ÐÐµÄ½á¹û¼ÇÂ¼ÏÂÀ´.


\subsubsection{ÖØÐÂÉè¶¨Ê±¼äÓë¼ì²éÆ«²îÂÊ}

ÕÒ³öÄãÉÏ´ÎÐ´ÏÂÀ´ÈÕÆÚ.
Ç©ÈëÏµÍ³²¢³ÉÎª {\bfseries root}.
È»ááÖ´ÐÐ:
\begin{tscreen}
\begin{verbatim}
clock -a
\end{verbatim}
\end{tscreen}

Õâ¸ö²½Öè½« CMOS Ê±¼äÐ´ÈëÏµÍ³Ê±ÖÓÈÃ¶þÕßÊ±¼äÒ»ÖÂ.
²¦µç»°ÖÁ (303)499-7111 (ÓïÒô), À´ñöÌý±¨Ê±µÄÄÚÈÝ.
½ÓÖøÊ¹ÓÃ¼üÅÌ´ò³öÏÂÃæ¼¸¸ö×Ö:
\begin{tscreen}
\begin{verbatim}
date
\end{verbatim}
\end{tscreen}

Ò»Ö±µÈµ½ßÙµÄÒ»Éù¡õ°´ÏÂ enter ¼ü, µ«ÊÇµ±ÄãµÈ´ýµÄÊ±ºò, Ð´ÏÂ±¨Ê±µÄÄÚÈÝ,
²¢ÇÒ»¹²»Òª¹ÒÉÏµç»°.
Õâ¸ö¶¯×÷ÊÇÈÃÄãÖªµÀÄ¿Ç°ÕæÕýµÄÊ±¼äÊÇ¼¸µã,
¶ø´ËÊ±Ïà¶ÔÄãµÄ»úÆ÷ÉÏµÄÊ±¼äÊÇ¼¸µã.
ÏÖÔÚÊ¹ÓÃ¼üÅÌ´ò³öÏÂÃæ¼¸¸ö×Ö:
\begin{tscreen}
\begin{verbatim}
date -s hh:mm:00
\end{verbatim}
\end{tscreen}

ÆäÖÐ·ÖÕë²¿·ÖËùÉè¶¨µÄÊý×Ö¾ÍÊÇÄ¿Ç°±¨Ê±ÄÚÈÝ *{\bfseries Ö®ááµÄ}* ÏÂÒ»·ÖÖÓ,
Ò»Ö±µÈµ½ßÙµÄÒ»Éù¡õ°´ÏÂ enter ¼ü (ÏÖÔÚ¿ÉÒÔ¹ÒÉÏµç»°ÁË).
¶ø {\ttfamily hh} µÄ²¿·ÖÔòÊ¹ÓÃ»úÆ÷±¾µØµÄÊ±ÕëÊý×Ö¼´¿É.
Õâ¸ö²½ÖèÔÚÉè¶¨ ``ÏµÍ³Ê±¼ä''.
È»ááÖ´ÐÐ:
\begin{tscreen}
\begin{verbatim}
clock -w
\end{verbatim}
\end{tscreen}

½«ÐÂµÄ (Ð£Õý¹ýµÄ) ÏµÍ³Ê±¼äÐ´»Ø CMOS Ê±ÖÓ. 
È»ááÖ´ÐÐ:
\begin{tscreen}
\begin{verbatim}
date +%j
\end{verbatim}
\end{tscreen}

(»òÊÇÖ´ÐÐ ``{\ttfamily date +\%s}'' )

ÄãÏÖÔÚÊÖÉÏÓÐÈý¸öÊý×Ö (¶þ¸öÐ£ÕýÈÕÆÚ¼°Ò»¸öÕýÈ·Ê±¼ä)
ì¶ÊÇÄã¿ÉÒÔ¿ªÊ¼¼ÆËãÆ«²îÂÊÁË.


\subsubsection{¼ÆËãÐ£ÕýÒò×Ó}

µ±ÄãÔÚÄ³Ò»·ÖÖÓÖ´ÐÐ ``{\ttfamily date}'' ³ÌÊ½Ê±, Äã»úÆ÷µÄ±¾µØÊ±¼äÊÇÂý»¹ÊÇ¿ìÄØ?
Èç¹ûÊÇ¿ìÁË, Äã±ØÐë½«Ö®¼õÈ¥Ò»Ð©ÃëÊýÒÔ·ûºÏÕýÈ·Ê±¼ä,
ËùÒÔÄãÓ¦¸ÃÐ´ÏÂÒ»¸ö¸ºµÄÆ«²îÊýÖµ.
Èç¹ûÊÇÂýÁË,Äã±ØÐë½«Ö®¼ÓÉÏÒ»Ð©ÃëÊýÒÔ·ûºÏÕýÈ·Ê±¼ä, ËùÒÔÄãÓ¦¸ÃÐ´ÏÂÒ»¸öÕýµÄÆ«²îÊýÖµ.

ÏÖÔÚ½«¶þ¸öÐ£ÕýÈÕÆÚÏà¼õ.
Èç¹ûÖ®Ç°ÄãÊ¹ÓÃµÄÊÇ ``{\ttfamily date +\%j}'',
ÔòÊýÖµËù´ú±íÒâÒåÎªÒ»ÄêµÄµÚ¼¸Ìì (1-365, »ò 1-366 Èç¹ûÊÇÈòÄê).
Èç¹û×Ô´ÓÄãÉÏÒ»´ÎÉè¶¨Ê±ÖÓµ½ÏÖÔÚ¾­¹ý1 ÔÂ1 ÈÕÄã»¹ÐëÒª½«µÚ¶þ¸öÐ£ÕýÈÕÆÚ¼Ó 365 (»ò 366)
Èç¹ûÖ®Ç°ÄãÊ¹ÓÃµÄÊÇ ``{\ttfamily date +\%s}'' ÔòÊýÖµµÄµ¥Î»ÎªÃëÊý,
Äã±ØÐë½«Ö®³ýÒÔ 86400 ÒÔ±ãÈ¡µÃÈÕÊý.

Èç¹ûÄãµÄµµ°¸ {\ttfamily /etc/adjtime} ÖÐÒÑ¾­ÓÐÐ£ÕýÒò×Ó,
Äã±ØÐë½«ÏÈÇ°ÒÑÐ£Õý¹ýµÄÃëÊý¿¼ÂÇ½øÀ´,
Èç¹ûÄãÐ£Õý¹ý¶È, Õâ¸öÐ£ÕýÒò×ÓµÄÕý¸ººÅ½«ÓëÄãÁ¿²âµ½Æ«²îÊýÖµÏà·´; 
Èç¹ûÄãÐ£Õý²»×ãÔò¶þÕßÕý¸ººÅÏàÍ¬.
½«¾ÉµÄÐ£ÕýÒò×Ó³ËÒÔÈÕÊý,
È»áá¼ÓÉÏÐÂ»ñµÃµÄÆ«²îÃëÊý
(¸½×¢--
Èç¹û¶þÕßÕý¸ººÅÏàÍ¬, Äã½«È¡µÃÒ»¸ö½Ï´óµÄÆ«²îÊýÖµ,
Èç¹û¶þÕßÕý¸ººÅÏà·´, Äã½«È¡µÃÒ»¸ö½ÏÐ¡µÄÆ«²îÊýÖµ).

½ÓÖø½«Õâ¸ö×ÜÆ«²îÃëÊý³ýÒÔÈÕÊýÒÔ±ãÈ¡µÃÐÂµÄÐ£ÕýÒò×Ó,
È»áá½«µµ°¸ {\ttfamily /etc/adjtime} ÖÐ¾ÉµÄÐ£ÕýÒò×Ó´ú»»³ÉÐÂµÄ.
×îááÐ´ÏÂÐÂµÄÐ£ÕýÈÕÆÚ (ÒÔÃëÊý»òÈÕÊýÎªµ¥Î») ÒÔ±ãÏÂ´ÎÊ¹ÓÃ. 

ÕâÀïÊÇÎÒµÄ {\ttfamily /etc/adjtime} µµ°¸ÄÚÈÝ:
\begin{tscreen}
\begin{verbatim}
-9.600000 845082716 -0.250655
\end{verbatim}
\end{tscreen}

(×¢ÒâÃ¿Ìì 9.6 ÃëÔòÒ»¸öÔÂ½«½üÓÐ 5 ·ÖÖÓµÄÆ«²î!)






\section{xntpd ¼ò½é}

ÄãµÄÏµÍ³Êµ¼ÊÉÏÓÐ¶þ¸öÊ±ÖÓ-- Ò»¸öÊÇµ±ÏµÍ³¹Ø»ú¼ÌÐøÊ¹ÓÃµç³ØµçÁ¦Î¬³Ö¼ÆÊ±¹¦ÄÜµÄ 
``real time clock'' (Ò²¾ÍÊÇËùÎ½µÄ ``CMOS Ê±ÖÓ'', ``Ó²ÌåÊ±ÖÓ'', »ò ``RTC'')
¶øÁíÒ»¸öÊÇ ``kernel clock'' (ÓÐÊ±³ÆÎª ``ÈíÌåÊ±ÖÓ'' »ò ``ÏµÍ³Ê±ÖÓ'')
ÏµÍ³Ê±ÖÓµÄÌø¶¯ÊÇÒÔ¼ÆÊ±Æ÷µÄÖÐ¶ÏÐÅºÅÎª»ù×¼²¢ÔÚ¿ª»úÊ±´ÓCMOS Ê±ÖÓ´¦ÔØÈë³õÊ¼Öµ.
Õâ¶þ¸öÊ±ÖÓÓÐ²»Í¬µÄÊ±¼äÆ«²îÂÊ,
ËùÒÔ¶þ¸öÊ±ÖÓÉÏµÄÊ±¼ä»áÖð½¥µØ²úÉúÆ«²î,
¶øÇÒÒ²»áÓë ``ÕæÕýµÄ''Ê±¼ä²úÉúÆ«²î.

ÔÚ {\ttfamily xntpd} ÎÄ¼þÖÐËùÊö¼°µÄ ``the clock'' ¾ÍÊÇÖ¸ ``kernel clock''.
µ±ÄãÖ´ÐÐ {\ttfamily xntpd} »ò {\ttfamily timed} ³ÌÊ½Ê±
(»òÊÇÆäËûÊ¹ÓÃµ½ {\ttfamily adjtimex} ÏµÍ³ºô½ÐµÄ³ÌÊ½)
linux ×÷ÒµÏµÍ³»á¼Ù¶¨ÏµÍ³Ê±ÖÓ±È CMOS Ê±ÖÓ×¼È·,
¶øÇÒ»áÔÚ¿ª»úááÃ¿¸ô 11 ·ÖÖÓÖØÐÂÉè¶¨Ò»´Î CMOS Ê±¼ä (Ò»Ö±µ½ÖØ¿ª»úÎªÖ¹).
ÕâÒâÎ¶Öø ``{\ttfamily clock}'' ³ÌÊ½²»ÔÙÖªµÀÉÏÒ»´ÎÖØÐÂÉè¶¨ CMOS Ê±ÖÓµÄÕýÈ·Ê±¼ä,
ËùÒÔÄã²»¿ÉÒÔÊ¹ÓÃµµ°¸ {\ttfamily /etc/adjtime} ÖÐµÄÐ£ÕýÒò×Ó.
Äã¿ÉÒÔÔÚ¿ª»úÖ´ÐÐµµÉÏÊ¹ÓÃ {\ttfamily ntpdate} ³ÌÊ½
ÒÔ±ãÔÚ³õ´ÎÖ´ÐÐ {\ttfamily xntpd} ³ÌÊ½Ö®Ç°ÓëÐ£Ê±ËÅ·þÆ÷¶ÔÊ±.
Èç¹ûÄãÔÚ¿ª»úµÄÊ±ºòÒ»Ö±ÎÞ·¨Á¬ÉÏ×¼È·µÄÐ£Ê±Ô´, Õâ¿ÉÄÜ»áÈÃÄãÃæÁÙµ½Ò»Ð©À§¾³--
Êµ¼ÊÉÏ {\ttfamily xntpd} ²»ÊÇ±»Éè¼ÆÀ´ÔÚÄÇÖÖÇé¿öÖ®ÏÂÊ¹ÓÃµÄ.

{\ttfamily Xntpd} °üº¬ÁËÐí¶àÎÞÏßµçÊ±ÖÓµÄÇý¶¯³ÌÊ½,
²¢ÇÒÒ²¿ÉÒÔ±»Éè¶¨ÔÚÒ»¶¨µÄÖÜÆÚÄÚ²¦µç»°ÖÁ NIST µÄµç»°²¦½ÓµçÄÔÐ£Ê±·þÎñ
(µ±ÄãÉè¶¨ºÃµç»°²¦½ÓµÄÖÜÆÚÖ®áá×îºÃÏÈ¼ÆËãÒ»ÏÂµç»°ÕÊµ¥µÄ»¨·Ñ).
ÔÚÓëÆäËûµÄÐ£Ê±Ô´Ê§È¥ÁªÂçÒ»¶ÎÊ±¼äÖ®ááÕâ¸ö·½Ê½Ò²ÄÜÌá¹©ÏµÍ³Ê±ÖÓÒ»¸öÐ£ÕýÒò×Ó.

´ó²¿·ÖµÄÎÞÏßµçÊ±ÖÓ´óÔ¼Òª»¨·Ñ \$3-4K,
²»¹ýÄã¿ÉÒÔ²ÉÓÃ½Ï±ãÒËµÄ ``{\ttfamily gadget box}'' ·½°¸
(Êµ¼ÊÉÏÊÇÒ»¸ö 300 baud µÄÊý¾Ý»ú) Ëû±»·ÅÔÚÄãµÄµçÄÔÓëÒ»Ì¨¶Ì²¨ÎÞÏßµç½ÓÊÕÆ÷Ö®¼ä
ÆµµÀµ÷ÖÁ Canada µÄ CHU Ð£Ê±ÎÞÏßµçÌ¨
(²Î¼ûÍøÖ· \nameurl{ftp://ftp.udel.edu/pub/ntp/gadget.tar.Z}{}).
¶øHeathkit WWV ½ÓÊÕÆ÷ (``×î×¼È·µÄÊ±ÖÓ'')
ÈÔÈ»ÂòµÄµ½ (µ«²»ÊÇÒ»×éÌ×¼þ), ´óÔ¼Òª»¨·Ñ \$4-500.
Ä¿Ç°GPS µÄÑ¶ºÅÀïÈÔÈ»°üº¬ÓÐÐ£Ê±µÄ×ÊÑ¶,
¶øÇÒ²¿·ÖµÄ GPS ½ÓÊÕÆ÷¿ÉÒÔ½ÓÉÏµçÄÔµÄ´®ÁÐ²º.
ÔÚ×î½üµÄÎ´À´Õâ¿ÉÄÜ»á³ÉÎªµÍ¼ÛÎ»µÄ½â¾ö·½°¸.

ÀíÂÛÉÏ, Ò»°ãÈË¿ÉÒÔ×Ô¼ºÐ´³ÌÊ½À´Ê¹ÓÃ NIST µÄµç»°²¦½ÓµçÄÔÐ£Ê±·þÎñÒÔ±ã×Ô¶¯
¼ÆËã CMOS Ê±ÖÓÓëÏµÍ³Ê±ÖÓµÄÆ«²îÂÊ.
ËäÈ»ÎÒ²»ÖªµÀÊÇ·ñÓÐµ¥¶ÀµÄ³ÌÊ½ÄÜ¹»´ïµ½Õâ¸öÄ¿µÄ,
µ«ÊÇ´ó²¿·ÖµÄ³ÌÊ½ÂëÓ¦¸Ã¿ÉÒÔ½èÓÃ×Ô {\ttfamily xntpd} ³ÌÊ½¼¯.

\end{document}
