Windows 7 - Local System Time Synchronization with Hardware RTC

Asked By jitendra.katari on 22-Feb-07 10:16 AM
In my CE image I have a problem that the Local System Time gains 30
secs every day. This gained time of 30 sec is again corrected by next
Local Time Synchronization with the Hardware RTC which takes place
after 24 hours by incrementing (((volatile DWORD *)UserKInfo)

Is it possible to configure my CE image to make this synchronisation
with the HW RTC for more then one time in a day?
Thanking you for your help,


Remi de Gravelaine replied on 22-Feb-07 10:43 AM
Check your SoftRTC value in Platform.reg:


SoftRTC"=dword:0 is probably what you need.

Ross Jordan [MSFT] replied on 23-Feb-07 02:01 AM
To add to what Remi said:

The kernel provides a SoftRTC mechanism that emulates an RTC in software by
using the system timer (GetTickCount()). On boot, if the
\HKLM\Platform\SoftRTC is set, then the kernel uses the SoftRTC mechanism,
otherwise it always queries hardware RTC. The SoftRTC initializes itself to
the hardware RTC time. Later, whenever the clock is queried through
GetSystemTime / GetLocalTime, the kernel simply returns the initial rtc +
the delta of ticks that has occurred.

Before CE6, we synchronize softRTC <== hardRTC during
GetLocalTime/GetSystemTime if TIMECHANGECOUNT was incremented. This would
1) On time change (SetSystemTime / SetLocalTime )
2) On timezone change
3) On wakeup from poweroff
4) On CreateProcess
5) Or, if nothing else, after one day of waiting

In CE6, this behaviour has changed somewhat. We don't synchronize on
GetLocalTime/GetSystemTime. We synchronize at least on:
1) Setting time (SetSystemTime / SetLocalTime ) - will always set both soft
and hard RTC to the same thing
2) On wakeup from poweroff
3) When kernel alarm fires
5) Or, if nothing else, after one day of waiting

Most platforms use "hard RTC" by default; softRTC has been enabled only on a
few platforms where either querying the hardware RTC is very slow, or the
hardware RTC is unreliable (high jitter or other issues). So, a possible
resolution is to disable softRTC, but you should do some analysis of the
impact to your system.