[ntp:questions] Re: NTP for dummies

Danny Mayer mayer at gis.net
Mon Oct 3 01:59:27 UTC 2005


David Woolley wrote:
> In article <433E8CD6.7000904 at gis.net>, mayer at gis.net (Danny Mayer) wrote:
> 
> 
>>ntpd on Windows does set the CMOS clock, at least it's supposed to.
> 
> 
> Not in version 4.2.0 and I would consider it a bug for it to set
> in a later version as it would be redundant, would risk a conflict [A]
> with the kernel code that already does this, and might fail to
> implement the policy that only the low order part of the hardware
> clock is adjusted, to allow people to dual boot Windows, which
> requires the hardware clock to be in wall clock time.
> 

I have no idea why you would consider this a bug or redundant. I was 
talking about Windows. This has nothing to do with other O/S's.

> This code in the linux kernel (2.4.26) already ensures that the CMOS clock
> tracks a synchronised software clock (arch/i386/kernel/time.c):
> 
>         /*
>          * If we have an externally synchronized Linux clock, then update
>          * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
>          * called as close as possible to 500 ms before the new second starts.
>          */
>         if ((time_status & STA_UNSYNC) == 0 &&
>             xtime.tv_sec > last_rtc_update + 660 &&
>             xtime.tv_usec >= 500000 - ((unsigned) tick) / 2 &&
>             xtime.tv_usec <= 500000 + ((unsigned) tick) / 2) {
>                 if (set_rtc_mmss(xtime.tv_sec) == 0)
>                         last_rtc_update = xtime.tv_sec;
>                 else
>                         last_rtc_update = xtime.tv_sec - 600; /* do it again in
> 60 s */
>         }
> 
> 
> [A] not all versions of linux support /dev/rtc, which would be necessary, but
> possibly not sufficient, for user space code to update the clock atomically.
> 

This is Linux and is specific to that O/S.

Danny



More information about the questions mailing list