Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site onfcanim.UUCP Path: utzoo!watmath!watnot!watcgl!onfcanim!dave From: dave@onfcanim.UUCP (Dave Martindale) Newsgroups: net.unix-wizards Subject: Re: 4.2BSD and the VAX 11/780 clock (try again) Message-ID: <14948@onfcanim.UUCP> Date: Wed, 8-Oct-86 10:39:13 EDT Article-I.D.: onfcanim.14948 Posted: Wed Oct 8 10:39:13 1986 Date-Received: Thu, 9-Oct-86 02:49:23 EDT References: <4198@brl-smoke.ARPA> <3723@umcp-cs.UUCP> Reply-To: dave@onfcanim.UUCP (Dave Martindale) Organization: National Film Board / Office national du film, Montreal Lines: 29 Summary: 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.