In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (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.

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.

_______________________________________________
questions mailing list
[email protected]
https://lists.ntp.isc.org/mailman/listinfo/questions

Reply via email to