freebsd-dev/contrib/ntp/html/hints/winnt
1999-12-09 13:01:21 +00:00

208 lines
8.4 KiB
Plaintext

-------------
INTRODUCTION:
-------------
Last revision 27 July 1999 Version 4.0.95.
This version compiles under WINNT with Visual C 6.0.
Greg Brackley and Sven Dietrich
Significant changes:
-Visual Studio v6.0 support
-Winsock 2.0 support
-Use of I/O completion ports for sockets and comm port I/O
-Removed the use of multimedia timers (from ntpd, others need removing)
-Use of waitable timers (with user mode APC) and performance counters to fake getting a better time
-Trimble Palisade NTP Reference Clock support
-General cleanup, prototyping of functions
-Moved receiver buffer code to a separate module (removed unused members from the recvbuff struct)
-Moved io signal code to a separate module
Compiling Instructions:
1. Requires Perl to be installed, and the Perl environment variable to be set correctly
2. Open the .\ports\winnt\ntp.dsw
3. Batch build of all debug projects compile
Last revision: 20-Oct-1996
This version corrects problems with building the XNTP
version 3.5-86 distribution under Windows NT.
The following files were modified:
blddbg.bat
bldrel.bat
include\ntp_machine.h
xntpd\ntp_unixclock.c
xntpd\ntp_refclock.c
scripts\wininstall\build.bat
scripts\wininstall\setup.rul
scripts\wininstall\readme.nt
scripts\wininstall\distrib\ntpog.wri
html\hints\winnt (this file)
In order to build the entire Windows NT distribution you
need to modify the file scripts\wininstall\build.bat
with the installation directory of the InstallShield
software. Then, simply type "bldrel" for non-debug
or "blddbg" for debug executables.
Greg Schueman
<schueman@acm.org>
Last revision: 07-May-1996
This set of changes fixes all known bugs, and it includes
several major enhancements.
Many changes have been made both to the build environment as
well as the code. There is no longer an ntp.mak file, instead
there is a buildntall.bat file that will build the entire
release in one shot. The batch file requires Perl. Perl
is easily available from the NT Resource Kit or on the Net.
The multiple interface support was adapted from Larry Kahn's
work on the BIND NT port. I have not been able to test it
adequately as I only have NT servers with one network
interfaces on which to test.
Enhancements:
* Event Logging now works correctly.
* Version numbers now work (requires Perl during build)
* Support for multiple network interface cards (untested)
* NTP.CONF now default, but supports ntp.ini if not found
* Installation procedure automated.
* All paths now allow environment variables such as %windir%
Bug fixes:
* INSTSRV replaced, works correctly
* Cleaned up many warnings
* Corrected use of an uninitialized variable in XNTPD
* Fixed ntpdate -b option
* Fixed ntpdate to accept names as well as IP addresses
(Winsock WSAStartup was called after a gethostbyname())
* Fixed problem with "longjmp" in xntpdc/ntpdc.c that
caused a software exception on doing a Control-C in xntpdc.
A Cntrl-C now terminates the program.
See below for more detail:
Note: SIGINT is not supported for any Win32 application including
Windows NT and Windows 95. When a CTRL+C interrupt occurs, Win32
operating systems generate a new thread to specifically handle that
interrupt. This can cause a single-thread application such as UNIX,
to become multithreaded, resulting in unexpected behavior.
Possible enhancements and things left to do:
* Reference clock drivers for NT (at least Local Clock support)
* Control Panel Applet
* InstallShield based installation, like NT BIND has
* Integration with NT Performance Monitor
* SNMP integration
* Fully test multiple interface support
Known problems:
* bug in ntptrace - if no Stratum 1 servers are available,
such as on an IntraNet, the application crashes.
Last revision: 12-Apr-1995
This NTPv3 distribution includes a sample configuration file and the project
makefiles for WindowsNT 3.5 platform using Microsoft Visual C++ 2.0 compiler.
Also included is a small routine to install the NTP daemon as a "service"
on a WindowsNT box. Besides xntpd, the utilities that have been ported are
ntpdate and xntpdc. The port to WindowsNT 3.5 has been tested using a Bancomm
TimeServe2000 GPS receiver clock that acts as a strata 1 NTP server with no
authentication (it has not been tested with any refclock drivers compiled in).
Following are the known flaws in this port:
1) currently, I do not know of a way in NT to get information about multiple
network interface cards. The current port uses just one socket bound to
INADDR_ANY address. Therefore when dealing with a multihomed NT time server,
clients should point to the default address on the server (otherwise the
reply is not guaranteed to come from the same interface to which the
request was sent). Working with Microsoft to get this resolved.
2) There is some problem with "longjmp" in xntpdc/ntpdc.c that causes a
software exception on doing a Control-C in xntpdc. Be patient!
3) The error messages logged by xntpd currently contain only the numerical
error code. Corresponding error message string has to be looked up in
"Books Online" on Visual C++ 2.0 under the topic "Numerical List of Error
Codes".
----------------------------------------------------
MAKING XNTPD FOR WindowsNT 3.5 using Visual C++ 2.0:
----------------------------------------------------
Separate projects are needed for xntpd, ntpdate, xntpdc, and the library
containing routines used by them.
1) First build the static library composed of routines in the lib
subdirectory of the distribution. Load the project by opening the
corresponding makefile libntp.mak (in the lib subdirectory of the
distribution) by choosing the Open option in the File menu. This should
display a list of files contained in this project. Then choose the
"Rebuild All" option from the Project menu in order to compile the
routines into a library. The libntp.lib static library is created in
the lib/WinDebug directory
You can now choose to build xntpd, ntpdate, and xntpdc in any order.
2) To build xntpd, load the project by opening the corresponding makefile
xntpd.mak (in the xntpd subdirectory of the distribution), and rebuild
all files. The xntpd.exe executable is created in the xntpd/WinDebug
directory.
3) repeat the above step for ntpdate and xntpdc
-------------------------------------------------
INSTALLING XNTPD AS A SERVICE UNDER WindowsNT 3.5
-------------------------------------------------
At this point you need to install 'xntpd' as a service. First modify the
sample configuration file conf/config.winnt35 in the distribution to
suit your needs. Then install it as "%SystemRoot%\NTP.INI" (%SystemRoot%
is an environmental variable that can be determined by typing "set" at
the "Command Prompt" or from the "System" icon in the "Control Panel",
NTP.INI is the suggested name for the "ntp.conf" file in Windows environment).
The instsrv.c program in the util subdirectory of the distribution can
be used to install 'xntpd' as a service and start automatically at boot
time. Compile instsrv.c, and enter form the command prompt
"instsrv.exe NetWorkTimeProtocol <pathname_for_xntd.exe>"
Clicking on the "Services" icon in the "Control Panel" ("Main" group
in the "Program Manager") will display the list of currently installed
services in a dialog box. The NetworkTimeProtocol service should show
up in this list. Select it in the list and hit the "Start" button in
the dialog box. The NTP service should start. View the event log by
clicking on the "Event Viewer" icon in the "Administrative Tools" group
of the "Program Manager", there should be several successful startup
messages from NTP. NTP will keep running and restart automatically when
the machine is rebooted.
You can change the start mode (automatic/manual) and other startup
parameters correponding to the NTP service (eg. location of conf file)
also in the "Services" dialog box if you wish.
There is no clean way to run 'ntpdate' before starting 'xntpd' at boot
time, unlike the Unix environment. 'xntpd' will step the clock upto
a 1000 seconds. While there is no reason that the system clock should
be that much off during bootup if 'xntpd' was running before bootup,
you may want to increase the CLOCK_WAYTOOBIG parameter in include/ntp.h
from 1000 to, say, MAXINT.
You can also use instsrv.c to delete the NTP service
"instsrv.exe NetworkTimeProtocol remove"
Viraj Bais
<vbais@mailman1.intel.com>