Hi,
there are different solutions for NTP available for the foxboard,
e.g. the ntpclient or the ported version of NTP 4.1.1a. For our
product we need the actual version 4.2.4 of NTP. The problem with the
already ported version 4.1.1a is, that this version is not complete
and NTP tools like ntpdc are missing.
If you just want to use NTP to set the clock of your foxboard I
recommend to give ntpclient a try. It comes included with the
foxboard, no effort is needed to use it. Porting of the complete NTP
stuff is necessary only if you have special requirements (like we
have). You can enable NTP client with "make menuconfig" in the group
"Applications".
Additionally there is a description from kaffbeemer http://
tech.groups.yahoo.com/group/foxboard/message/3016, which shows how to
use the already ported NTP version 4.1.1a. I learned a lot from this
contribution.
I want to give a description of the porting steps I made:
1. I downloaded the actual source from www.ntp.org and decompressed
it into /path/to/devboard-R2_01/bigblue/ntp-4.2.4/ Of course you may
choose any path inside your development system.
2. NTP source come with autoconf. Here a configure-Tool adapts the
source code to your environment and creates a makefile automatically.
All you need are the right options for the configure-tool to make the
cross-compile work correctly. It took me some time to find a set of
environment variables and options which works. I wrote a small script
which has to run in the ntp-4.2.4 directory from above. The script
sets the environment variables and starts the configure-tool with the
options:
#!/bin/sh
#
export prefix=/home/fox/devboard-R2_01/target/cris-axis-linux-gnu
env \
CC="gcc-cris -mlinux -isystem ${prefix}/include" \
CPP="gcc-cris -mlinux -E -isystem ${prefix}/include" \
CXX="g++-cris -mlinux -xc++ -isystem ${prefix}/include" \
LDFLAGS="-L${prefix}/lib" \
OBJCOPY="objcopy-cris" \
LD="ld-cris -mcrislinux" \
AR="ar-cris" \
RANLIB="ranlib-cris" \
NM="nm-cris" \
STRIP="cris-strip" \
\
./configure \
--host=cris-axis-linux \
--without-x \
--prefix=${prefix} \
--disable-debugging \
--disable-debug-timing \
--disable-BANCOMM \
--disable-GPSVME \
--disable-all-clocks \
--enable-DUMBCLOCK \
--enable-LOCAL-CLOCK \
--disable-parse-clocks \
--enable-RAWDCF \
--without-electricfence
exit
All environment parameters and the first options deal with the
internal of the foxboad development system and the cross-compiler.
All options starting from "--disable-debugging" until "--without-
electricfence" deal with NTP internal stuff. These options are not
needed if you try the same method to port something else than NTP.
Please note that all the foxboard and cross-compiler stuff was
written by me on a trial-and-error base. If you see any wrong things
here, please tell me.
If you want to optimize the NTP options, try "./configure --help" in
the ntp-4.2.4 directory. All possible options are explained a little
bit, further documentation is available at www.ntp.org.
After configuration you can start "make" in the ntp-4.2.4 directory.
The compiled programs and daemons you can find in subdirectories,
e.g. you can find the ntpd daemon in the ntpd subdirectory.
Normally the next step would be to run "make install". In principle
this works, but what is missing is the stripping of unnecessary code
from the executables. I was not able to do the correct stripping in
the make or install scripts. Therefore I stripped manually, "cris-
strip --unneeded ntpd", for example. This reduced the size by a
factor of three.
I did not include the make of NTP programs into the make of an
fimage. Instead I included the installation of the necessary NTP
executables in the post file, where I simply copied the already
compiled executables:
directory /usr/local/bin
file bigblue/ntp-4.2.4/ntpdate/ntpdate /usr/local/bin/ntpdate mode=0755
file bigblue/ntp-4.2.4/ntpdc/ntpdc /usr/local/bin/ntpdc mode=0755
file bigblue/ntp-4.2.4/ntpd/ntpd /usr/local/bin/ntpd mode=0755
directory /etc/default
file bigblue/configs/ntp.conf /etc/ntp.conf mode=0666
file bigblue/configs/timezone /etc/timezone mode=0666
file bigblue/configs/localtime /etc/localtime mode=0755
file bigblue/configs/rcS /etc/default/rcS mode=0666
#file bigblue/configs/ntpdate /etc/init.d/ntpdate mode=0755
#symlink ../init.d/ntpdate $prefix/etc/rc3.d/S32ntpdate
file bigblue/configs/ntpd /etc/init.d/ntpd mode=0755
symlink ../init.d/ntpd $prefix/etc/rc0.d/K24ntpd
symlink ../init.d/ntpd $prefix/etc/rc1.d/K24ntpd
symlink ../init.d/ntpd $prefix/etc/rc2.d/K24ntpd
symlink ../init.d/ntpd $prefix/etc/rc3.d/S33ntpd
symlink ../init.d/ntpd $prefix/etc/rc6.d/K24ntpd
NTP seems to work fine for me, and I can supervise the activity of
the ntpd daemon with the ntpdc tool. All I have is a "kernel time
sync error 0001" every 90 minutes, but I have some hope, that this
problem vanishes after connecting a real-time hw clock to the foxboard.
....................
Thomas Treyer
[EMAIL PROTECTED]
Fon: +49 89 7854715
Voice Mail: +49 721 151273565
Mobil: +49 175 2377256
Boschetsrieder Straße 63
81379 München
[Non-text portions of this message have been removed]