lkml.org 
[lkml]   [1996]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Why touch the CMOS clock?
On Wed, 8 May 1996, Ulrich Windl wrote:

> On 6 May 96 at 14:21, Johan Myréen wrote:
>
> > My question is: Why does the kernel have to update the RTC? It is my
> > understanding that the kernel only reads the RTC at boot time and does its
> > timekeeping using the timer interrupt. (Correct me if I'm wrong.) Why can't
> > the RTC be left running on its own and the RTC time be used only as an
> > approximation of the real time of day when the machine is power-cycled? You
> > can't trust the RTC anyway if the machine is down for a longer period of
> > time.
>
> The RTC usually is more precise than the interrupt driven clock.

True. But the CMOS clock isn't used for timekeeping in the kernel. It is only
read at boot time to initialize the system time. The only reason to update
the CMOS clock periodically is so it can be used more accurately to
initialize the system time at the next boot. Setting the CMOS clock is not
essential in synchronizing the system time with an external source.

> In Addidion as long as the RTC runs local time, you will have to change
> it when entering/leaving DST.

The clock on Unix machines traditionally runs UTC. Setting the RTC to local
time is just a hack to keep DOS users happy, not a high priority, IMHO...

> I think the RTC should be updated, even when the hardware is somewhat
> broken: Setting the time shouldn't affect periodic interrupts.

No it shouldn't, but if it _does_ make the interrupts unreliable, I'd say
the CMOS clock updating code should be removed.

--
Johan Myreen
jem@iki.fi


\
 
 \ /
  Last update: 2005-03-22 13:37    [from the cache]
©2003-2011 Jasper Spaans