[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-developers] Time Problems :: FIX



"Jim J." wrote:
> 
> > Any ideas why changes to the system time do not survive a reboot?  We have
> > tried changing the time in both the Cobalt control panels and from the
> > command line without success.
 
> It is a bug that no one talks about. Our Raq3 has been like that since the
> first day it was received. Each time the system is rebooted, the time
> changes on it. After that, all web logs are screwed.
> 
> We have decided to dump all the sites on the Raq3 and sell it. We have had
> it since Feb., and are through with it. We even have a restore disc for it.
> 
> If anyone is interested, we are taking offers off list.
> 
> raq@xxxxxxxxxxxxxxxxx

Sorry to not see this post sooner.  There are two seperate RTC issues -
you are seeing the second, but may be seeing the first also, so I'll
answer both:

1) Some batches of RTC hardware are not initialized at manufacturing. 
The program below fixes that.  Save the file and compile it on your raq3
with 
	gcc -O2 mfg-fix-rtc.c -o mfg-fix-rtc
then run
	./mfg-fix-rtc

2) The default linux Clock software handles clock initialization in a
somewhat odd way.  When you initialize your clock, it saves a skew
number.  Each reboot (or just run clock --adjust) will look at the skew,
and adjust the clock appropriately.  The fix is this:
	rm /etc/adjtime
	(set clock in the Web UI)
	rm /etc/adjtime
	(set clock in the Web UI again)

After these steps, all known clock issues are fixed.  I believe the
second fix is in one of the RaQ3 patches, also.

Tim
-- 
Tim Hockin
Software Engineer / OS Engineer
Cobalt Networks
thockin@xxxxxxxxxx
gcc -O2 mfg-fix-rtc.c -o mfg-fix-rtc
./mfg-fix-rtc

/* ------------------ mfg-fix-rtc.c ------------------*/
/* original by Tim Hockin, Cobalt Networks            */
#include <stdio.h>
#include <sys/io.h>

int main(int argc, char *argv[])
{
        unsigned char tmp;

        if (ioperm(0x70, 2, 1)) {
                perror("ioperm");
                return 2;
        }

        outb(0xb, 0x70);
        tmp = inb(0x71);
        outb(tmp | 0x80, 0x71);

        outb(0xa, 0x70);
        outb(0x26, 0x71);

        outb(0xb, 0x70);
        outb(0x2, 0x71);

        outb(0xb, 0x70);
        tmp = inb(0x71);
        outb(tmp & ~0x80, 0x71);

        return 0;
}
/* ------------------ mfg-fix-rtc.c ------------------ */