Path: utzoo!mnetor!uunet!munnari!kre From: kre@munnari.oz (Robert Elz) Newsgroups: comp.protocols.tcp-ip Subject: Re: WARNING: TOD clock not initialized -- CHECK AND RESET THE DATE! Message-ID: <1944@munnari.oz> Date: 3 Jan 88 08:25:17 GMT References: <8801020627.AA19752@uc.msc.umn.edu> <8801022203.AA25123@uc.msc.umn.edu> Organization: Comp Sci, Melbourne Uni, Australia Lines: 57 Summary: An alternative binary patch (for SunOS 3.4), which will work forever In article <8801020627.AA19752@uc.msc.umn.edu>, slevy@UC.MSC.UMN.EDU (Stuart Levy) writes: > I believe I have a fix for this.. Probably the easiest way to > distribute it without annoying SUN too much is as a binary patch. Then, In article <8801022203.AA25123@uc.msc.umn.edu>, slevy@UC.MSC.UMN.EDU (Stuart Levy) writes again: > I forgot to mention in sending out the SUN kernel binary patch that > it ONLY works in leap years -- if you just apply the patch, it will break > in January 1989. Here's an alternative (binary) patch that will work in both leap years, and in boring old ordinary years. # adb -w -k /vmunix /dev/mem resettodr+0xca?X (It should contain 0x536efff4, a subqw #1,a6@(-0xc) instruction. If you applied Stuart's patch it will contain 0x4e714e71, 2 nop's so put back the subw in both the kernel a.out, and memory) .?W 536efff4 ./W 536efff4 (next, apply a slightly better fix) resettodr+0xc0?i (it should contain "bnes resettodr+0xca", which we will change to be "bnes resettodr+0xce" and avoid the incorrect subw) .?w 660c (now verify that its correct) .?i (and assuming it is "bnes resettodr+0xca", change the running kernel) ./w 660c $q I can't verify that this actually fixes the reported problem, but it clearly does fix a bug, and should have the same effect this year as Stuart's fix, while not hurting next year. I used SunOS 3.4 to do this, in case other versions of SunOS deviate (3.3 is apparently the same), here is the original section of binary ... _resettodr+0xa6: movw a6@(-0x10),d0 _resettodr+0xaa: moveq #3,d1 _resettodr+0xac: andw d1,d0 _resettodr+0xae: andl #0xffff,d0 _resettodr+0xb4: bnes _resettodr+0xca _resettodr+0xb6: subqw #1,a6@(-0xc) _resettodr+0xba: cmpw #2,a6@(-0xc) _resettodr+0xc0: bnes _resettodr+0xca <<<< change this to _resettodr+0xc2: movl #0x263b80,d0 _resettodr+0xc8: bras _resettodr+0xde _resettodr+0xca: subqw #1,a6@(-0xc) _resettodr+0xce: moveq #0,d0 <<<< branch to here _resettodr+0xd0: movw a6@(-0xc),d0 _resettodr+0xd4: lea _monthsec:l,a0 _resettodr+0xda: movl a0@(-4,d0:l:4),d0 _resettodr+0xde: addl d0,d7 kre