~ubuntu-branches/debian/squeeze/ntp/squeeze-201010051545

« back to all changes in this revision

Viewing changes to html/hints/vxworks.htm

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2004-10-11 16:10:27 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041011161027-icyjbji8ujym633o
Tags: 1:4.2.0a-10ubuntu2
Use ntp.ubuntulinux.org instead of pool.ntp.org

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<HTML>
2
 
<HEAD>
3
 
   <TITLE>vxWorks Port of NTP</TITLE>
4
 
</HEAD>
5
 
<BODY LINK="#00008B" VLINK="#8B0000">
6
 
 
7
 
<H1>VxWorks port of NTP </H1>
8
 
 
9
 
<P>Creating a port for vxWorks posed some problems. This port may help
10
 
as a starting point for similar ports to real-time OS's and other embeddable
11
 
kernels, particularly where main() is not allowed, and where the configure
12
 
scripts need to be altered. </P>
13
 
 
14
 
<H1><B>Configuration issues</B></H1>
15
 
 
16
 
<P>I decided to do as little invasive surgery as possible on the NTP code,
17
 
so I brought the vxWorks header tree in line with the standard unix tree.
18
 
The following changes were needed, as a side effect these changes will
19
 
allow for easy porting of other autoconfigure enabled code. </P>
20
 
 
21
 
<P>Where I have 386 you will need to put in your target type. The vxWorks
22
 
tree entry point is /usr/wind. If these are the same for your system, you
23
 
should be able to cut and paste the changes. </P>
24
 
 
25
 
<P><BLINK>WARNING: Check you are not overwriting files, before entering
26
 
the following: there should be no conflict, but check first... </BLINK></P>
27
 
 
28
 
<P>export CC=&quot;cc386 -nostdlib -m486 -DCPU=I80486 -I/usr/wind/target/h&quot;
29
 
<BR>
30
 
export RANLIB=ranlib386 <BR>
31
 
export AR=ar386 <BR>
32
 
export VX_KERNEL=/usr/wind/target/config/ims_std_bsp/vxWorks <BR>
33
 
cd /usr/wind/target/sys <BR>
34
 
ln -s ../signal.h <BR>
35
 
ln -s ../time.h <BR>
36
 
ln -s socket.h sockio.h <BR>
37
 
ln -s ../selectLib.h select.h <BR>
38
 
ln -s ../timers.h <BR>
39
 
touch file.h param.h resource.h utsname.h var.h ../netdb.h ../a.out.h ../termios.h
40
 
<BR>
41
 
echo &quot; ******ADD #include \&quot;sys/times.h\&quot; to sys/time.h
42
 
&quot; </P>
43
 
 
44
 
<P>The configure script must be changed in the following way to get the
45
 
linking tests to work, once in the correct directory issue the following
46
 
commands: <BR>
47
 
sed -e 's%main.*()%vxmain()%' configure &gt; configure.vxnew <BR>
48
 
mv configure.vxnew configure <BR>
49
 
chmod 755 configure </P>
50
 
<P>The new version 4 of NTP requires some maths functions so it links in the
51
 
maths library (-lm) in the ntpd <a href="../ntpd/Makefile.am">Makefile.am</a>
52
 
change the line "ntpd_LDADD = $(LDADD) -lm" by removing the "-lm".<BR>
53
 
You are now ready to compile</P>
54
 
 
55
 
 
56
 
<P><BR>
57
 
The <A HREF="../configure.in">configure.in </A>file needed to be altered
58
 
to allow for a host-target configuration to take place. </P>
59
 
 
60
 
<UL>
61
 
<LI>The define SYS_VXWORKS was added to the compilation flags. </LI>
62
 
 
63
 
<LI>Little endianess is set if the target is of type iX86. </LI>
64
 
 
65
 
<LI>The size of char, integer, long values are all set. If Wind River ever
66
 
changes these values they will need to be updated. </LI>
67
 
 
68
 
<LI>clock_settime() is defined to be used for setting the clock. </LI>
69
 
 
70
 
<LI>The Linking flags have -r added to allow for relinking into the vxWorks
71
 
kernel </LI>
72
 
</UL>
73
 
 
74
 
<P>Unfortunately I have had to make use of the <A HREF="../include/ntp_machine.h">ntp_machine.h
75
 
</A>file to add in the checks that would have been checked at linking stage
76
 
by autoconf, a better method should be devised. </P>
77
 
 
78
 
<UL>
79
 
<LI>There is now a NO_MAIN_ALLOWED define that simulates command line args,
80
 
this allows the use of the normal startup sysntax. </LI>
81
 
 
82
 
<LI>POSIX timers have been added. </LI>
83
 
 
84
 
<LI>Structures normally found in netdb.h have been added with, the corresponding
85
 
code is in <A HREF="../libntp/machines.c">machines.c </A>. Where possible
86
 
the defines for these have been kept non-vxWorks specific.</LI>
87
 
</UL>
88
 
 
89
 
<P>Unfortunately there are still quite a few SYS_VXWORKS type defines in
90
 
the source, but I have eliminated as many as possible. You have the choice
91
 
of using the usrtime.a library avaliable from the vxworks archives or forgoing
92
 
adjtime() and using the clock_[get|set]time().The <A HREF="../include/ntp_machine.h">ntp_machine.h
93
 
</A>file clearly marks how to do this. </P>
94
 
 
95
 
<H1><B>Compilation issues</B> </H1>
96
 
 
97
 
<P>You will need autoconf and automake ... available free from the gnu
98
 
archives worldwide. </P>
99
 
 
100
 
<P>The variable arch is the target architecture (e.g. i486) </P>
101
 
 
102
 
<P>mkdir A.vxworks (or whatever....) <BR>
103
 
cd A.vxworks <BR>
104
 
../configure --target=arch-wrs-vxworks [any other options] <BR>
105
 
make </P>
106
 
 
107
 
<P>Options I normally use are the --disable-all-clocks --enable-LOCAL-CLOCK flags.
108
 
The program should proceed to compile without problem. The daemon ntpd,
109
 
ntpdate, ntptrace, ntpdc, ntpq programs and of course the libraries are
110
 
all fully ported. The other utilities are not, but they should be easy
111
 
to port. </P>
112
 
 
113
 
<H1>Running the software </H1>
114
 
 
115
 
<P>Load in the various files, call them in the normal vxWorks function
116
 
type manner. Here are some examples. Refer to the man pages for further
117
 
information. </P>
118
 
 
119
 
<P>ld &lt; ntpdate/ntpdate <BR>
120
 
ld &lt; ntpd/ntpd <BR>
121
 
ld &lt; ntptrace/ntptrace <BR>
122
 
ld &lt; ntpq/ntpq <BR>
123
 
ld &lt; ntpdc/ntpdc <BR>
124
 
ntpdate (&quot;-b&quot;, &quot;192.168.0.245&quot;) <BR>
125
 
sp(ntpd, &quot;-c&quot;, &quot;/export/home/casey/ntp/ntp.conf&quot;)
126
 
<BR>
127
 
ntpdc(&quot;-c&quot;, &quot;monlist&quot;, &quot;192.168.0.244&quot;)
128
 
<BR>
129
 
ntpq(&quot;-c&quot;, &quot;peers&quot;, &quot;192.168.0.244&quot;) <BR>
130
 
ntptrace(&quot;192.168.0.244&quot;) <BR>
131
 
</P>
132
 
 
133
 
<H1>Bugs and such </H1>
134
 
 
135
 
<P>Should you happen across any bugs, please let me know, or better yet
136
 
fix them and submit a patch. Remember to make you patch general for Vxworks,
137
 
not just for your particular architecture.
138
 
<A HREF="http://www.ccii.co.za">CCII Systems
139
 
(Pty) Ltd</A>, my ex employers, sponsored the time to this port.
140
 
Please let me know how it goes, I would be most interested in offsets
141
 
and configurations. </P>
142
 
 
143
 
<P><BR>
144
 
</P>
145
 
 
146
 
<P>Casey Crellin</A> <BR>
147
 
<A HREF="mailto:casey@csc.co.za">casey@csc.co.za</A> </P>
148
 
 
149
 
<P><BR>
150
 
</P>
151
 
 
152
 
</BODY>
153
 
</HTML>