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

Chris Torek chris at umcp-cs.UUCP
Tue Oct 7 13:19:06 AEST 1986


In article <4198 at brl-smoke.ARPA> harv%ksuvax1.BITNET at wiscvm.arpa
(Harvard Townsend) writes:

>... We are having a problem with the 11/780 clock and 4.2BSD
>setting the dat[e] and time when rebooting.  Upon reboot, 4.2BSD
>comes up with a bogus date and time - it is sometimes a few hours
>off, others a few days, and others a few months.  The maintenance
>folks have replaced the clock module in the VAX, but the symptom
>persists.

Where shall I start...?

4BSD has three sources of time information: the 780 Time Of Day
Register (TODR); the interval counter; and the root file system.
While booting, it reads the file system time stamp and the TODR.
It assumes that the file system stamp has the right year (+/-
six months), and that the TODR has the extra information needed
to pin that down to day and second.  It computes this value and
compares it with the original file system time.  If the times
differ by more than two days, it gripes (but believes the time
anyway).  There are a few miscellaneous sanity checks as well.

Whenever you set the date with date(1), the kernel resets the
TODR as appropriate.

While the machine is running, the time is advanced by the interval
counter.  The interval timer is set to interrupt every 10 ms. in
4.2 and 4.3BSD; after 100 of these it bumps the seconds counter.
It is possible (but unlikely) to keep the machine at a high IPL
long enough that it misses a few ticks.  In this case the clock
will slowly drift backward.

>From your description, I would say that either the Time Of Year
clock is malfunctioning, or the TODR processor register is not
accurately reading the TOY clock.

Incidentally, when this machine reboots, we set its clock from the
Naval Observatory's atomic clock:

	if [ -f /usr/local/lib/navclock ]; then
		( if /usr/local/bin/x set_clock > /dev/null 2>&1; then
			echo 'Clock Set from Naval Observatory'  > /dev/console
		  else
			echo 'Clock not set. Call 653-1800. ;-)' > /dev/console
		fi ) &
	fi

`x set_clock' dials 301 653 0351, which is the Observatory's 1200
baud machine readable clock.  (This is a local call for us, and
thus cheaper than a Heathkit WWV clock.)

301 653 1800 is, of course, their voice number.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at mimsy.umd.edu



More information about the Comp.unix.wizards mailing list