[ntp:questions] Start of new GPS 1024 week epoch

Martin Burnicki martin.burnicki at meinberg.de
Sat Aug 24 19:03:07 UTC 2013

David Taylor wrote:
> On 23/08/2013 15:08, Martin Burnicki wrote:
> []
>> Indeed. I've just enabled the SHM refclock in the config.h file for
>> Windows, tried to build it with VS2008, and found that it builds after I
>> had fixed a tiny bug, a missing semicolon.
>> However, I have also no idea if it works.
>> David, if you want to give it a try you can simply unpack the current
>> -dev version. Then:
>> 1.) Open the solution (.sln file) in Visual Studio
>> 2.) Open the file ports\winnt\include\config.h, search for CLOCK_SHM,
>> and change the line
>> #undef CLOCK_SHM
>> to
>> #define CLOCK_SHM
>> 3.) Edit ntpd/refclock_shm.c and look around line 177. There is a line
>> starting with
>> msyslog(LOG_ERR, "SHM MapViewOfFile ...
>> and at the end of this line a semicolon is missing. Just add it and the
>> project should at least compile.
>> As said above, don't know if it works, though, and don't know if there
>> is another program which can feed the SHM driver under Windows.
>> If this turns out to work I can submit the fix to the code base.
>> Martin
> Martin,
> Thanks for that - the start of good news, I hope.  I can confirm your
> findings - as-supplied, there is an error in ntpd/refclock_shm.c which
> prevent compilation, but that's easily fixed just as you described and I
> also now have an ntpd.exe which has compiled correctly.  The fault
> should certainly have a bug-report submitted.

OK, I can do that. This was only a tiny syntax error in the source code, 
but even if this is fixed we still don't know if the SHM driver really 
works as expected under Windows until somebody has tested it.

> Unfortunately, I don't have any programs which could write into shared
> memory, so perhaps we would need to find a simple driver (the NMEA seems
> an possible choice to me as many devices can drive that) and convert it
> to shared memory operation.

I don't know if that makes much sense.

> I have a non-critical Windows XP box I
> could test on.  Would the first step, though, be to see a FreeBSD or
> Linux driver converted and working in SHM mode, and then provide similar
> modifications to the Windows driver?

Usually the SHM segment is fed by some other daemon/service, so if e.g 
gpsd could be built under Windows as service this could be used to do 
this. I don't know, though, if gpsd can also be used under Windows.

Extracting some refclock driver code from ntpd, modify it so that it 
uses the SHM interface instead of ntpd's "native" refclock interface, 
and putting all this into an own Windows service would be quite some effort.

Maybe it would make more sense to try to port gpsd or something similar 
to Windows, if this is not yet supported.

Martin Burnicki

Meinberg Funkuhren
Bad Pyrmont

More information about the questions mailing list