4.2BSD and the VAX 11/780 clock (try again)

Dave Martindale dave at onfcanim.UUCP
Thu Oct 9 00:39:13 AEST 1986


I've seen three different reasons for time being suddenly wrong on a
VAX after a boot even when the hardware is all working properly.

One is simply clock drift over time.  The UNIX time of day is maintained
by counting down the main CPU clock, produced by a crystal oscillator.
This will drift slowly over time depending on how accurate the oscillator
is, but the slow drift isn't going to surprise anyone while the machine
is up.

However, the time-of-year clock that provides the time at boot is driven
by a separate, battery-backed-up crystal oscillator, and nobody tries
to keep it in agreement with the CPU's oscillator.  Over a period of
several months of uptime, the CPU clock may drift in one direction while
the time-of-year clock drifts, unnoticed, in the other direction.  When
you eventually reboot, the system time suddenly changes by several
minutes relative to the correct time.

(A side note: the PDP-11 clock counted 60Hz line cycles, and so was
much more accurate than a VAX over a long period).

Two other reasons for the clock changing suddenly are both due to DEC
field service.  Berkeley UNIX tries to keep the time in the same format
that VMS uses for peaceful coexistence on the machine.  Unfortunately,
VMS uses local time while UNIX uses UTC.  If field service boots VMS
and it tells them the time of day is off by 5 hours (for EST, other
timezones differ appropriately) they are likely to be helpful and reset it.
Then when UNIX comes back up, it's time is now 5 hours off.

Finally, diagnostics can completely trash the time-of-year clock.



More information about the Comp.unix.wizards mailing list