From owner-freebsd-bugs Wed Jan 13 23:03:27 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA29581 for freebsd-bugs-outgoing; Wed, 13 Jan 1999 23:03:27 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from ceia.nordier.com (m1-34-dbn.dial-up.net [196.34.155.34]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA29562 for ; Wed, 13 Jan 1999 23:03:13 -0800 (PST) (envelope-from rnordier@nordier.com) Received: (from rnordier@localhost) by ceia.nordier.com (8.8.7/8.6.12) id JAA02866; Thu, 14 Jan 1999 09:00:58 +0200 (SAT) From: Robert Nordier Message-Id: <199901140700.JAA02866@ceia.nordier.com> Subject: Re: Year 2000 Compliance In-Reply-To: <199901140547.WAA11845@gongshow.masterplan.org> from Jason George at "Jan 14, 99 05:47:48 am" To: jbg@masterplan.org (Jason George) Date: Thu, 14 Jan 1999 09:00:46 +0200 (SAT) Cc: freebsd-bugs@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Jason George wrote: > I decided to try a rollover on the non-compliant Compaq. I had never > done this before, figuring there was no point. I was quite surprised in > my results. The Compaq, while running 2.2.8+, rolled over correctly! > > y2k# date > Fri Dec 31 23:53:22 MST 1999 > y2k# date > Sat Jan 1 00:00:03 MST 2000 > y2k# > > A reboot into the BIOS screen yields a 01/01/00 CMOS date, a reboot > under DOS yields a 01/01/80 system date, and a reboot into FreeBSD > yields 01/01/2000. > > > Is this just luck? Am I playing with fire here? Have I stumbled onto a > new possible source for cheap NATD packet filters for the new millenium? > :-) It's not luck. FreeBSD doesn't rely on the BIOS but reads the PC real-time clock (RTC) directly. The RTC keeps track on the year (00-99), though not the century (which is simply stored in CMOS and not updated by the hardware). Because the "century" value is unreliable -- and isn't really needed to answer the question "What's today's date?" -- it's usually ignored. See src/sys/i386/isa/clock.c: #ifdef USE_RTC_CENTURY year = readrtc(RTC_YEAR) + readrtc(RTC_CENTURY) * 100; #else year = readrtc(RTC_YEAR) + 1900; if (year < 1970) year += 100; #endif if (year < 1970) goto wrong_time; -- Robert Nordier To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message