On Monday 14 July 2003 08:11 pm, W. D. wrote:
> At 19:24 7/14/2003, David Kelly, wrote:
> >Another thing we saw with Soekris and FreeBSD 4.x was that FreeBSD
> > wrote Sunday as 0 but would accept 0 or 7 on read, Soekris clock
> > hardware was happy with 0, but BIOS demanded 7 else it assumed the
> > clock was corrupt and reset its time to Jan 1, 1980. This only
> > mattered if you rebooted on Sunday. Its a 2 byte patch to FreeBSD
> > 4.x, already included in 5.x.
> Where would one find this 2 byte patch for 4.7?

Look for messages from phk in the soekris-tech mail list archives at 
http://www.soekris.com/ to be sure of finding the right thing. Nosing 
around a bit I believe the file is /usr/src/sys/i386/isa/clock.c.

The fixed version (copied from 5.1):

        writertc(RTC_WDAY, (tm + 4) % 7 + 1);  /* Write back Weekday */

The old version ("+ 1" hacked out of above):

        writertc(RTC_WDAY, (tm + 4) % 7    );  /* Write back Weekday */

% cvs log /usr/src/sys/i386/isa/clock.c says:
revision 1.191
date: 2002/12/04 13:46:49;  author: phk;  state: Exp;  lines: +1 -1
Use the correct value when writing the Day Of Week byte in the CMOS.
The correct range is [1...7] with Sunday=1, but we have been writing
[0...6] with Sunday=0.

The Soekris computers flagged the zero, zapped the date, so if you
rebooted your soekris on a sunday, it would come up with a wrong

Bruce has a more extensive rework of this code, but we will stick with
the minimalist fix for now.

Spotted by:     Soren Kristensen <[EMAIL PROTECTED]>
Thanks to:      Michael Sierchio <[EMAIL PROTECTED]>.
Confirmed by:   bde
Approved by:    re

IIRC the comment above about Sunday is incorrect. Have been using 0, but 
7 (not 1) is correct. I believe 1-6 is still Monday thru Saturday in 
both versions. But I'm not going to sweat it tonight. Both versions 
work on most BIOS's.

The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.
[EMAIL PROTECTED] mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to