Subject: Re: BIOS and CD-ROM problems
To: None <perry@piermont.com>
From: None <drochner@zel459.zel.kfa-juelich.de>
List: port-i386
Date: 01/11/1999 13:20:08
[NVRAM century at nonstandard place]
perry@piermont.com said:
> Is there any way we could *detect* this sort of PS/2 descended BIOS?
> If not...
Perhaps check for a PS-2 stule checksum... but there is no
guarantee that other BIOSes make trouble too.
What do you think about the following?
best regards
Matthias
Index: clock.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/isa/clock.c,v
retrieving revision 1.55
diff -c -r1.55 clock.c
*** clock.c 1998/10/13 15:14:13 1.55
--- clock.c 1999/01/11 12:17:27
***************
*** 489,494 ****
--- 489,502 ----
static int timeset;
/*
+ * patchable to control century byte handling:
+ * 1: always update in resettodr()
+ * -1: never touch
+ * 0: try to figure out itself
+ */
+ int rtc_update_century = 0;
+
+ /*
* Initialize the time of day register, based on the time base which is, e.g.
* from a filesystem.
*/
***************
*** 539,554 ****
century, yr);
/* Kludge to roll over century. */
! if ((century == 19) && (tcentury == 20) && (yr == 00)) {
printf("WARNING: Setting NVRAM century to 20\n");
s = splclock();
/* note: 0x20 = 20 in BCD. */
mc146818_write(NULL, NVRAM_CENTURY, 0x20); /*XXXsoftc*/
splx(s);
- } else {
- printf("WARNING: CHECK AND RESET THE DATE!\n");
}
! }
yr = (tcentury == 20) ? yr+100 : yr;
/*
--- 547,563 ----
century, yr);
/* Kludge to roll over century. */
! if ((century == 19) && (tcentury == 20) && (yr == 00) &&
! rtc_update_century >= 0) {
printf("WARNING: Setting NVRAM century to 20\n");
s = splclock();
/* note: 0x20 = 20 in BCD. */
mc146818_write(NULL, NVRAM_CENTURY, 0x20); /*XXXsoftc*/
splx(s);
}
! } else if (century == 19 && rtc_update_century == 0)
! rtc_update_century = 1; /* will update later in resettodr() */
!
yr = (tcentury == 20) ? yr+100 : yr;
/*
***************
*** 654,660 ****
s = splclock();
rtcput(&rtclk);
! mc146818_write(NULL, NVRAM_CENTURY, century); /* XXX softc */
splx(s);
}
--- 663,670 ----
s = splclock();
rtcput(&rtclk);
! if (rtc_update_century > 0)
! mc146818_write(NULL, NVRAM_CENTURY, century); /* XXX softc */
splx(s);
}