Reference Clock Audio Drivers

vxWorks Port of NTP

VxWorks port of NTP

Creating a port for vxWorks posed some problems. This port may help as a starting point for similar ports to real-time OS's and other embeddable kernels, particularly where main() is not allowed, and where the configure scripts need to be altered.

Configuration issues

I decided to do as little invasive surgery as possible on the NTP code, so I brought the vxWorks header tree in line with the standard Unix tree. The following changes were needed, as a side effect these changes will allow for easy porting of other autoconfigure enabled code.

Where I have 386 you will need to put in your target type. The vxWorks tree entry point is /usr/wind. If these are the same for your system, you should be able to cut and paste the changes.

WARNING: Check you are not overwriting files, before entering the following: there should be no conflict, but check first...

            export CC="cc386 -nostdlib -m486 -DCPU=I80486 -I/usr/wind/target/h"
            export RANLIB=ranlib386
            export AR=ar386
            export VX_KERNEL=/usr/wind/target/config/ims_std_bsp/vxWorks
cd /usr/wind/target/sys ln -s ../signal.h ln -s ../time.h ln -s socket.h sockio.h ln -s ../selectLib.h select.h ln -s ../timers.h touch file.h param.h resource.h utsname.h var.h ../netdb.h ../a.out.h ../termios.h echo " ******ADD #include \"sys/times.h\" to sys/time.h "
The configure script must be changed in the following way to get the linking tests to work, once in the correct directory issue the following commands:
      sed -e 's%main.*()%vxmain()%' configure > configure.vxnew
            mv configure.vxnew configure
            chmod 755 configure
      

The new version 4 of NTP requires some maths functions so it links in the maths library (-lm) in the ./ntpd/Makefile.am file change the line ntpd_LDADD = $(LDADD) -lm by removing the "-lm".

>You are now ready to compile

The ./configure.in file needed to be altered to allow for a host-target configuration to take place.

Unfortunately I have had to make use of the ./include/ntp_machine.h file to add in the checks that would have been checked at linking stage by autoconf, a better method should be devised.

Unfortunately there are still quite a few SYS_VXWORKS type defines in the source, but I have eliminated as many as possible. You have the choice of using the usrtime.a library avaliable from the vxworks archives or forgoing adjtime() and using the clock_[get|set]time(). The ./include/ntp_machine.h file clearly marks how to do this.

Compilation issues

You will need autoconf and automake ... available free from the gnu archives worldwide.

The variable arch is the target architecture (e.g. i486)

            mkdir A.vxworks)
            cd A.vxworks
            ../configure --target=arch-wrs-vxworks
            make
       

Options I normally use are the --disable-all-clocks --enable-LOCAL-CLOCK flags. The program should proceed to compile without problem. The daemon ntpd, ntpdate, ntptrace, ntpdc, ntpq programs and of course the libraries are all fully ported. The other utilities are not, but they should be easy to port.

Running the software

Load in the various files, call them in the normal vxWorks function type manner. Here are some examples. Refer to the man pages for further information.

            ld < ntpdate/ntpdate
            ld < ntpd/ntpd
            ld < ntptrace/ntptrace
            ld < ntpq/ntpq
            ld < ntpdc/ntpdc
            ntpdate ("-b", "192.168.0.245")
            sp(ntpd, "-c", "/export/home/casey/ntp/ntp.conf")
            ntpdc("-c", "monlist", "192.168.0.244")
            ntpq("-c", "peers", "192.168.0.244")
            ntptrace("192.168.0.244")
        

Casey Crellin, casey@csc.co.za

./usr/share/doc/ntp-doc/html/hints/rs60000000644000000000000000000000440111307651603016704 0ustar rootroot15.7.1993 xntp3 compiles now again on AIX. I have disabled prototyping and added the switch -D_NO_PROTO which disables prototyping in the system include files. Matthias Ernst maer@nmr.lpc.ethz.ch -------------------------------------------------------------------------------- Xntp version 3 now support the cc compiler for AIX. The Config.aix will now use cc by default. You can still compile xntp with the bsd compiler by changing "COMP= cc" to "COMP= bsdcc" and and removing the "-DSTUPID_SIGNAL" option from the "DEFS" option. xntp and tickadj was also modified so that the value of tickadj is read form the kernel and can be set by tickadj. For now I would not set tickadj below 40 us. Bill Jones jones@chpc.utexas.edu ------------------------------------------------------------------------------- This is a modified version of xntp version 3 for the RS6000. It works for AIX 3.2 and these are the same changes as have been applied tothe version 2 implementation of xntp. It works fine for us but I have not tested all of the features, especially the local clock support for the RS6000 is not tested at all. Matthias Ernst, ETH-Zuerich, Switzerland - maer@nmr.lpc.ethz.ch -------------------------------------------------------------------------------- Here the original README.rs6000 for the version 2 implementation: A hacked version of xntp for the IBM RS/6000 under AIX 3.1 can be found in xntp.rs6000.tar.Z. [ if still available at all - Frank Kardel 93/12/3 ] This will not work on older versions of AIX due to a kernel bug; to find out whether you have the kernel bug, compile and run testrs6000.c (see comments in the code for instructions). xntp and testrs6000 require "bsdcc" to compile. This is simply another entry point into the xlc compiler with various options set for BSD compatibility. If your system does not have bsdcc, do the following: link /bin/bsdcc to /bin/xlc put the following into /etc/xlc.cfg: * BSD compatibility bsdcc: use = DEFLT crt = /lib/crt0.o mcrt = /lib/mcrt0.o gcrt = /lib/gcrt0.o libraries = -lbsd, -lc proflibs = -L/lib/profiled,-L/usr/lib/profiled options = -H512,-T512, -qlanglvl=extended, -qnoro, -D_BSD, -D_NONSTD_TYPES, -D_NO_PROTO, -tp,-B/lib/ ./usr/share/doc/ntp-doc/html/hints/svr4-dell0000644000000000000000000000025011307651603017564 0ustar rootrootNotes on the DELL SVR4. You should use -DSETTIMEOFDAY_BROKEN. Philip.Gladstone@mail.citicorp.com (XXX But there is no checking for SETTIMEOFDAY_BROKEN in the code) ./usr/share/doc/ntp-doc/html/hints/svr4_package