Re: [ntp:questions] NTP client with ability to write Windows NT system time to hardware clock?

2011-02-01 Thread Brolin Empey

Martin Burnicki wrote:

Brolin,

sorry for the late reply. I've been offline due to a really bad cold.



I have kept deferring replying to your message, at least partly because 
of the nature of the medium.  However, I am glad to report my hardware 
clock has been sufficiently accurate since I ran “ntpdate-debian” 
followed by “hwclock -w --utc” on Ubuntu probably at least 2 weeks ago. 
 I know I should keep (better) records, but at least I am satisfied 
even without the ability to write the Windows NT system time to the 
hardware clock.  After synchronising brolin-N900 with time.windows.com , 
brolin-V13 is 8 seconds behind brolin-N900 .  I know this may be 
significant for certain applications, but it is good enough for me.


___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions

Re: [ntp:questions] NTP client with ability to write Windows NT system time to hardware clock?

2011-02-01 Thread Brolin Empey

Steve Kostecke wrote:

On 2011-02-01, Brolin Empeybro...@brolin.be  wrote:


After synchronising brolin-N900 with time.windows.com , brolin-V13
is 8 seconds behind brolin-N900 . I know this may be significant for
certain applications, but it is good enough for me.


FWIW ... NTP can typically keep your clock synced within +/- 0.01 sec
across a WAN (e.g. The Internet) and better than +/- 0.005 sec across a
LAN.


Apparently you have not redd the previous messages in this thread. 
Synchronising brolin-V13’s Windows NT system clock with NTP is only 
useful until I shut down Windows NT because the synchronised system 
clock’s time is /not/ written to the hardware clock when 
RealTimeIsUniversal=1 .



And your 8 second offset is well outside ntpd's 0.128 sec default
step threshold.


As I have already stated in a previous message in this thread, I am not 
using ntpd.  I do not need ntpd:  I need Microsoft to change Windows 7 
so it can write the system time to the hardware clock during the shut 
down process when RealTimeIsUniversal=1 .  Until that happens, I accept 
an 8 second offset as good enough.


___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] NTP client with ability to write Windows NT system time to hardware clock?

2010-12-18 Thread Brolin Empey

Martin Burnicki wrote:

Brolin,

Brolin Empey wrote:

I run Windows 7 Professional IA-32 with RealTimeIsUniversal=1 on
brolin-V13, my Dell Vostro V13 laptop. This means brolin-V13?s hardware
clock (RTC) runs in UTC, as it should, instead of the local time zone,
as Microsoft still uses for the completely illogical default
configuration.  RealTimeIsUniversal=1 is /finally/ fixed and fully
working beginning in Windows Vista SP2 + Windows 7, but there is still a
problem:  When RealTimeIsUniversal=0, which is also used when the
RealTimeIsUniversal key does not exist, Windows 7 writes the Windows NT
system time to the hardware clock during the shut down process.  When
RealTimeIsUniversal=1, though, the Windows NT system time is never
written to the hardware clock.


Hm, this sounds like a Windows bug ...


No, it is by design. :(




Consequently, I have to boot Ubuntu from
a USB flash drive (brolin-V13 has no optical disc drive (ODD).), then
use ntpdate-debian + hwclock to synchronise the Linux system clock with
an NTP server on the Internet, then write the
sufficiently-accurate-for-me Linux system time to the hardware clock so
Windows 7 will set the Windows NT system clock from the accurate time in
the hardware clock.  After some time (at least 1 week, not sure.),
though, my hardware clock is approximately 2 minutes behind the correct
time from an NTP server, but Windows 7 never writes the Windows NT
system time to the hardware clock when RealTimeIsUniversal=1, so I have
to use my Ubuntu USB flash drive again.


Do you need correct time for the on-board RTC for a special application?


No, but I still want my clocks to have accurate time.


As
far as I know this is only used to initialize the Windows system time when
Windows starts up, so your system time may be wrong until ntpd has a chance
to correct it, i.e. it can reach an NTP server.


I am using Microsoft’s w32time service, not ntpd.

I have configured the w32time service to start automatically, but it 
does not seem to start automatically, so my system time is approximately 
2 minutes behind until I run net start w32time  w32tm /resync in an 
elevated (with administrative privileges) cmd.exe session.





I know the proper solution is
to get Microsoft to change Windows 7 so it can write the Windows NT
system time to the hardware clock even when RealTimeIsUniversal=1, but
that has not yet happened.  I have at least asked a Microsoft employee
about it, though, so they know users (well, at least 1 user. :)) want
the feature.  I can use w32time to force a synchronisation, but then I
have to do that every time I boot Windows 7.  brolin-V13 travels with me
between home and work, so it is not always running.  Maybe this causes
the hardware clock to fall behind, but I do not think I can prevent
having to shut down and boot brolin-V13 on a daily basis.  Since I do
not know if Microsoft will ever enable Windows 7 to write the Windows NT
system time to the hardware clock when RealTimeIsUniversal=1, the next
best solution is probably to write a hwclock.exe application for Windows
NT, but I am hoping someone has already implemented this functionality
in an application such as an NTP client.  Googling ?hwclock.exe? returns
lots of noise because some malware uses this file name, but I have not
found any real hwclock.exe equivalent to hwclock used on Linux.


During normal operation the ntpd service should not call the Windows
SetSystemTime() API since doing so causes a time offset offset to be
applied to the system time.

As far as I know ntpd calls SetSystemTime() only when the Windows system
time needs to be stepped anyway, or when the ntpd service shuts down.

Calling SetSystemTime() should also set the HW clock. If this doesn't happen
then the Windows bug mentioned above is probably inside that Windows API
call.


Again, I am using w32time, not ntpd.  The behaviour you call a bug is by 
design.  I looked up SetSystemTime on MSDN but could not find anything 
even suggesting SetSystemTime is supposed to update the hardware clock. 
 I actually could not find any official documentation on how to set the 
hardware clock from a userspace application on Windows NT, but I have 
found how (see below).





So, is there an NTP client or any other application for Windows NT which
can write the Windows NT system time to the hardware clock so I do not
have to write hwclock.exe for Windows NT?


A proper solution would indeed be to write a program which just reads the
current system time without changing it, and then writes the system time to
the HW clock. However, this requires a devce driver to be able to write to
the CMOS chip. I'm not sure whether there is a documented or undocumented
software interface to the Windows kernel to call Windows' built-in driver.


The HalSetRealTimeClock function in the Windows NT kernel’s HAL needs to 
be called but, AFAICT, even a device driver cannot call HalSetRealTimeClock.


I actually downloaded and installed Microsoft’s Windows Driver

[ntp:questions] NTP client with ability to write Windows NT system time to hardware clock?

2010-12-11 Thread Brolin Empey
I run Windows 7 Professional IA-32 with RealTimeIsUniversal=1 on 
brolin-V13, my Dell Vostro V13 laptop. This means brolin-V13’s hardware 
clock (RTC) runs in UTC, as it should, instead of the local time zone, 
as Microsoft still uses for the completely illogical default 
configuration.  RealTimeIsUniversal=1 is /finally/ fixed and fully 
working beginning in Windows Vista SP2 + Windows 7, but there is still a 
problem:  When RealTimeIsUniversal=0, which is also used when the 
RealTimeIsUniversal key does not exist, Windows 7 writes the Windows NT 
system time to the hardware clock during the shut down process.  When 
RealTimeIsUniversal=1, though, the Windows NT system time is never 
written to the hardware clock.  Consequently, I have to boot Ubuntu from 
a USB flash drive (brolin-V13 has no optical disc drive (ODD).), then 
use ntpdate-debian + hwclock to synchronise the Linux system clock with 
an NTP server on the Internet, then write the 
sufficiently-accurate-for-me Linux system time to the hardware clock so 
Windows 7 will set the Windows NT system clock from the accurate time in 
the hardware clock.  After some time (at least 1 week, not sure.), 
though, my hardware clock is approximately 2 minutes behind the correct 
time from an NTP server, but Windows 7 never writes the Windows NT 
system time to the hardware clock when RealTimeIsUniversal=1, so I have 
to use my Ubuntu USB flash drive again.  I know the proper solution is 
to get Microsoft to change Windows 7 so it can write the Windows NT 
system time to the hardware clock even when RealTimeIsUniversal=1, but 
that has not yet happened.  I have at least asked a Microsoft employee 
about it, though, so they know users (well, at least 1 user. :)) want 
the feature.  I can use w32time to force a synchronisation, but then I 
have to do that every time I boot Windows 7.  brolin-V13 travels with me 
between home and work, so it is not always running.  Maybe this causes 
the hardware clock to fall behind, but I do not think I can prevent 
having to shut down and boot brolin-V13 on a daily basis.  Since I do 
not know if Microsoft will ever enable Windows 7 to write the Windows NT 
system time to the hardware clock when RealTimeIsUniversal=1, the next 
best solution is probably to write a hwclock.exe application for Windows 
NT, but I am hoping someone has already implemented this functionality 
in an application such as an NTP client.  Googling “hwclock.exe” returns 
lots of noise because some malware uses this file name, but I have not 
found any real hwclock.exe equivalent to hwclock used on Linux.


So, is there an NTP client or any other application for Windows NT which 
can write the Windows NT system time to the hardware clock so I do not 
have to write hwclock.exe for Windows NT?


Thanks for reading,
Brolin

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] NTP client with ability to write Windows NT system time to hardware clock?

2010-12-11 Thread Brolin Empey

David Woolley wrote:

unruh wrote:

On 2010-12-11, Jan Ceuleers janspam.ceule...@skynet.be wrote:

Piece of feedback below.



There's no way I'm going to read all that. If you have a question for
us, please can you put it a little more succinctly? Thanks.


Actually, I /did/ write my question succinctly at the end of my post.


To summarize as I understand it-- how do you keep the RTC
synced to the true time under Windows? (System running ntp so assume
that the system time is the true time).


He wants the RTC to contain UTC, even though Windows isn't in the GMT
timezone with DST disabled. Windows normally stores the system wall
clock time.


My RTC already runs in UTC, but my RTC is approximately 2 minutes behind 
because I have no way of writing the Windows NT system time to the 
hardware clock (RTC) after using an NTP client to synchronise the 
Windows NT system time.  On Ubuntu, I use ntpdate-debian + hwclock, but 
I cannot find a real hwclock for Windows NT, only malware which uses the 
name hwclock.exe as a disguise.  I need an hwclock.exe application for 
Windows NT so I can run “hwclock --utc --systohc” like on Ubuntu.  I am 
asking in this group because I thought someone may know of an NTP client 
for Windows NT with this functionality, now that Microsoft has finally 
fully fixed support for RealTimeIsUniversal=1 beginning in Windows Vista 
SP2 + Windows 7.


My original post (and this reply too) make perfect sense to me, but I 
suspect my readers did not have all of the required background knowledge.


If you are not already familiar with Windows NT’s RealTimeIsUniversal 
registry key, please read 
http://www.cl.cam.ac.uk/~mgk25/mswish/ut-rtc.html.


If you are not already familiar with the hwclock command from the 
util-linux(-ng) package, please read 
http://manpages.ubuntu.com/manpages/lucid/man8/hwclock.8.html.


___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions