Manual Calibration without NTP
This section describes how to calibrate the clock to an accuracy of order tenths of a second. This procedure was found useful when
ntpd was used on a
variable speed processor and upset the drift correction.
Linux
The aim is to calibrate the kernel frequency adjustment variable(s) stored in
/etc/adjtime. This following is a translation of
Laurent Picouleau's page. Many thanks to Mike Cook for the above explanation and supplying this link.
The following steps are to be done as
root.
- Day 1
- Set the CMOS clock to "approximately" UTC using the BIOS (1).
- Install
hwclock and adjtimex
- Run
hwclock --set --date="MM/DD/YY hh:mm:00" --utc (2) --debug on the fourth beep (radio, I presume) (3)
- Day 2
- Run
hwclock --set --date="MM/DD/YY hh:mm:00" --utc --debug
- If the first value of the first line of
/etc/adjtime is greater than 8 then
- run
adjtimex -u -c
- record the suggested value for "tick"
- run
adjtimex -u -t suggested_value
- Run
adjtimex -u -l=/var/log/clocks.log
- Day 7
- Run
adjtimex -u -l=/var/log/clocks.log
- Run
hwclock --set --date "MM/DD/YY hh:mm:00" --utc --debug
- Run
adjtimex -u -l=/var/log/clocks.log
- Run
hwclock --utc --hctosys
- Run
adjtimex -u -l=/var/log/clocks.log
- Run
adjtimex -u -c=22 -i=100
- Calculate the average of the 20 values given for "freq"
- Run
adjtimex -u -f calculated_average
- Run
adjtimex -u -l=/var/log/clocks.log
Phew! Your clock system is now calibrated to your reference and will drift by about only one tenth of a second per day.
Footnotes:
1. Or any other method
2. Note care the date format: month/day/year
3. Use local time, don't use GMT.
--
ParkerJones - 25 Nov 2004