Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Aug 2010 10:55:35 +0300
From:      phil hefferan <wdef200@gmail.com>
To:        bf1783@gmail.com
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: How to read cmos clock - what is gettimeofday reading?
Message-ID:  <AANLkTinpyOe%2BkLPGYqobfKA_xTR8PNk50t55O9gVwUiE@mail.gmail.com>
In-Reply-To: <AANLkTimNLAdPYQ0-yqyvR4YEuUsEG%2Bmc7rFQ%2BWZUAvYh@mail.gmail.com>
References:  <AANLkTimNLAdPYQ0-yqyvR4YEuUsEG%2Bmc7rFQ%2BWZUAvYh@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 20, 2010 at 5:17 AM, b. f. <bf1783@googlemail.com> wrote:

> >To further confuse matters there appears to be a common misconception on
> the web
> >that the cmos time is automatically synced to system time on FreeBSD. This
> is
> >incorrect: see msg03414 on freebsd-hardware at freebsd.org.
>
> The situation has changed in 8-STABLE and 9-CURRENT since the above
> message was written.  The timekeeping code was changed (by the person
> who wrote the message that you cited) to periodically (every
> machdep.rtc_save_period seconds) adjust the value of the rtc if ntp is
> used to update the system time, machdep.disable_rtc_set=0, and the rtc
> driver hasn't been disabled:
>
> http://svnweb.freebsd.org/viewvc/base?view=revision&revision=207360
> http://svnweb.freebsd.org/viewvc/base?view=revision&revision=208297
>
> atrtc_{get,set}time, now in /usr/src/sys/x86/isa/atrtc.c, could serve
> as a basis for your own code:
>
> http://svn.freebsd.org/viewvc/base/head/sys/x86/isa/atrtc.c?view=markup
>
> There are of course *_rtc_{get,set}time variants for other
> architectures as well.
>
> Thanks for that.  I'll look at atrtc_gettime.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinpyOe%2BkLPGYqobfKA_xTR8PNk50t55O9gVwUiE>