On Thu, 23 Mar 2000, Sven Denninghoff wrote:

> Hi,
> 
> 
> >
> > > Hi,
> > >
> > > I've a problem with the real-time clock. It detects digital unix epoch 1952,
> > > but sets
> > > my clock to year 2052 (even if SRM says 2000)!
> > > Any idea ?
> > yes, it seems to be something like a y2k-bug ...
> >
> > it's got to be close to these
> >
> > from linux-2.2.14/arch/alpha/kernel/time.c:309
> > [...]
> >         if ((year += 1900) < 1970)
> >                 year += 100;
> >         xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
> >         xtime.tv_usec = 0;
> > [...]
> >
> > from linux-2.2.14/drivers/char/rtc.c:
> > [...]
> > static unsigned long epoch = 1900;      /* year corresponding to 0x00   */
> > [...]
> >         if (year > 10 && year < 44) {
> >                 epoch = 1980;
> >                 guess = "ARC console";
> >         } else if (year < 96) {
> >                 epoch = 1952;
> >                 guess = "Digital UNIX";
> >         }
> > [...]
> >
> > --
> 
> It's not only a Y2K-bug it seems to be a little bit bigger.
The correct fix should be (as posted by Andries Brouwer on l-k):
--- rtc.c~      Sat Mar 18 23:25:12 2000
+++ rtc.c       Mon Mar 20 14:48:48 2000
@@ -670,10 +670,10 @@
        if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
                BCD_TO_BIN(year);       /* This should never happen... */
 
-       if (year > 10 && year < 44) {
+       if (year >= 20 && year < 48) {
                epoch = 1980;
                guess = "ARC console";
-       } else if (year < 96) {
+       } else if (year >= 48 && year < 100) {
                epoch = 1952;
                guess = "Digital UNIX";
        }

I hope this fixes the remaining issues.

> After shutting down linux and booting Tru Unix, there are some problems with
> setting the
> time. I think the linux rtc and time routines screw up the TOY (time of year)
> chip infos,
> because TRU Unix complains about that.
> If you have Tru Unix available, have a look in the kernel include files,
> there are some hints.
> 
> Regards
> 
> 
> Sven
> 
> 
> 
> 

-- 
with kind regards (mit freundlichem Grinsen),
                              Ruediger Oertel ([EMAIL PROTECTED])
----------------------------------------------------------
          does "DONT PANIC" give a hint ?

Reply via email to