Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jul 2003 19:24:15 -0500
From:      David Kelly <dkelly@HiWAAY.net>
To:        FreeBSD-Questions@FreeBSD.org
Subject:   Re: Seting the hardware clock
Message-ID:  <200307141924.15522.dkelly@HiWAAY.net>
In-Reply-To: <20030714231604.GA27924@teddy.fas.com>
References:  <20030714231604.GA27924@teddy.fas.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 14 July 2003 06:16 pm, stan wrote:
> ;m struggling with getting the hardware clock (BIOS clock) equal to
> the kernels time.
>
> On my Linux boxes a utility called hwclock is run on the way down to
> synchronize the 2.
>
> The problem I'm running into is that if the time on the system gets
> to far out of date for ntpd to bring it into synch, then I can update
> the kernels clock with ntpdate. But when I reboot the old incorrect
> time comes back.
>
> I ran into this during some software testing, that required setting
> the clock pretty far off of real time, and it was a PIA to get the
> machine back to the correct time.
>
> How _should_ this be handled?

adjkerntz(8) holds the key to synchronizing kernel and BIOS/CMOS clock 
time.

As for your kernel clock not holding good time, there are ways to 
correct that too. Ntpd can not keep the popular Soekris boards (based 
on AMD Elan SC520) in sync without tuning the time standard used in the 
kernel. Forgot if it gains or loses 4 to 5 minutes per day without mod.

Because you are having problems keeping time, and other problems writing 
time, there may be something odd about your motherboard. Maybe there is 
something to protect the CMOS clock from being written to? Some sort of 
BIOS virus protection?

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.

-- 
David Kelly N4HHE, dkelly@hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307141924.15522.dkelly>