SUN date problem

Mike Clarkson mike at ists
Fri May 6 16:38:38 AEST 1988


In article <967 at tellab5.UUCP>, dpb at tellab5.UUCP (Darryl Baker) writes:
> In article <7811 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
> +>In article <21024 at oliveb.olivetti.com> ilcu at icoven.UUCP (Daniela Papa) writes:
> +>>Every time I reboot my SUN 3/50M I get the message that the clock lost
> +>>29 days. While running the clock slows done about 10 minutes per hour
> +>
> +>My first thought was that you haven't fixed the clock bug in the Sun
> +>kernel (contact Sun for details).  My next thought was that perhaps
> We had the very same problem on all our machines (3/50, 3/60, 3/180 more
> than one of each). We installed a one byte patch from Sun and that fixed
> it. This was 3.5.


I happen to have a copy of the patch handy so here it is.  This text was
extracted from SunSpots.  As always, you should make a spare copy of
vmunix in case something goes wrong.  

P.S. : why is Sun still shipping kernels with this bug when they've
known about it since  January ?

-------------------------------------------------------------------------------


Date: Thu, 7 Jan 88 10:29:15 PST
>From: chuq at sun.com (Chuq Von Rospach)
Subject: Sun TOD Clock bug Patches for all releases 

[These are the official patches from Sun for all known affected releases
 in the field. If you have any questions or problems, please call Sun
 Tech Support]

chuq
Sun Tech Support

There exists a problem for all Sun3 (68020) machines running SunOS
Releases 3.0-3.5, and all Sun4 (SPARC) machines running SunOS
Release Sys4-3.2 FCS and Sys4-3.2L GAMMA. This problem does not
exist for Sun-2's.

As of Jan 1 00:00 1988, the clock routine in the kernel will put the
clock chip into an uncertain state if you attempt to set the date.
The visible effects of this is to 1) cause the message
  
        WARNING: TOD clock not initialized -- CHECK AND RESET THE DATE!  
  
to appear while booting vmunix, and to 2) cause the system date to start
to drift widely. Any attempts to actually *set* the date will have only a
temporary effect (i.e., the date you set will be good for about 30 seconds).
  
In order to solve this problem, you must patch both the kernel and system
object files.

[[ NOTE that there are three separate patches.  Make sure you use the
right one.  --wnl ]]

==============================================================================

	Sun3 System Patch
	Releases 3.2, 3.3, 3.4, 3.5
  
  This is for Diskful and Server Machines only. Diskless machines need to
  be fixed on the server.

As root, run the follwing command:

	echo 'resettodr+c0?i' | adb /vmunix - | grep reset

You should see the following printed out:

	_resettodr+c0:	bnes	_resettodr+0xca

If you see instead:

	_resettodr+c0:	bnes	_resettodr+0xce

the patch has already been applied to this system.
Proceed with the rest of the patch procedure anyway!

If you do not see either of these messages, go no further with this patch,
and please contact Sun Microsystems Customer Service.

If you do see either of those messages, then run, as root,
the following commands:

	echo 'resettodr+c0?w 660c' | adb -w /vmunix

Reboot and then *set* the date.

If you build kernels for your system, or are a server for diskless clients,
do, as root

	cp /sys/OBJ/clock.o /sys/OBJ/clock.o- 
	echo 'resettodr+c0?w 660c' | adb -w /sys/OBJ/clock.o


and then rebuild your kernel and/or the kernels for your diskless clients.

==============================================================================

        Sun3 System Patch
	Release SunOS Release 3.0

  This is for Diskful and Server Machines only. Diskless machines need to
  be fixed on the server.

As root, run the following command:

        echo 'todset+0xb4?i' | adb /vmunix -

You should see the following printed out:

        _todset+0xb4:   bnes    _todset+0xbe

If you see instead:

        _todset+0xb4:   bnes    _todset+0xc2

the patch has already been applied to this system.
Proceed with the rest of the patch procedure anyway!

If you do not see either of these messages, go no further with this patch,
and please contact Sun Microsystems Customer Service.

If you do see either of those messages, then run, as root,
the following command:

        echo 'todset+0xb4?w 0x660c' | adb -w /vmunix

Reboot and then *set* the date.

If you build kernels for your system, or are a server for diskless clients,
do, as root

        cp /sys/OBJ/clock.o /sys/OBJ/clock.o-
        echo 'todset+0xb4?w 0x660c' | adb -w /sys/OBJ/clock.o

and then rebuild your kernel and/or the kernels for your diskless clients.

==============================================================================

	Sun4 System Patch
	Release Sys4-3.2 FCS, Sys4-3.2L GAMMA
  
  This is for Diskful and Server Machines only. Diskless machines need to
  be fixed on the server.
	
	echo 'resettodr+0x110?i' | adb /vmunix -

You should see the following printed out:

	_resettodr+0x110:               sub     %i5, 0x1, %i5

If you see instead:

	_resettodr+0x110:               sub     %i5, 0x0, %i5

the patch has already been applied to this system.
Proceed with the rest of the patch procedure anyway!

If you do not see either of these messages, go no further with this patch,
and please contact Sun Microsystems Customer Service.

If you do see either of those messages, then run, as root,
the following command:

	echo 'resettodr+0x110?W ba276000' | adb -w -k /vmunix /dev/mem

Reboot and then *set* the date.

If you build kernels for your system, or are a server for diskless clients,
do, as root

	cp /sys/sun4/OBJ/clock.o /sys/sun4/OBJ/clock.o- 
	echo 'resettodr+0x110?W ba276000' | adb -w /sys/sun4/OBJ/clock.o 

and then rebuild your kernel and/or the kernels for your diskless clients.

-- 
Mike Clarkson						mike at ists.UUCP
Institute for Space and Terrestrial Science		mike at ists.yorku.ca
York University, North York, Ontario,
CANADA M3J 1P3						(416) 736-5611



More information about the Comp.unix.wizards mailing list