[comp.sys.sgi] NTP and IRIX

scp@acl.lanl.gov (Stephen C. Pope) (12/11/90)

	I've managed to get NTP running under IRIX 3.3.1/2, and it
works, but not well.  The problem has to do with whatever the IRIX
equivalent of BSD's ``tickadj'' variable is - the quantum is set far
too large, and NTP has a hard time getting the kernel zeroed in on the
correct value to adjtime(2).

	Can anyone out there suggest what is the correct kernel
variable to tweak, and what a reasonable value(s) might be for a 380
and a personal?

	(BTW: looking in /usr/sysgen, it appears that the ``fastclock''
is off, but without adb, who can tell?!?)

stephen pope
advanced computing lab, lanl
scp@acl.lanl.gov

jdh@bu-pub.bu.edu (Jason Heirtzler) (12/11/90)

or.. how about XNTP?   Hello SGI?

jdh

srp@babar.mmwb.ucsf.edu (Scott R. Presnell) (12/11/90)

scp@acl.lanl.gov (Stephen C. Pope) writes:


>	I've managed to get NTP running under IRIX 3.3.1/2, and it
>works, but not well.  The problem has to do with whatever the IRIX
>equivalent of BSD's ``tickadj'' variable is - the quantum is set far
>too large, and NTP has a hard time getting the kernel zeroed in on the
>correct value to adjtime(2).

>	Can anyone out there suggest what is the correct kernel
>variable to tweak, and what a reasonable value(s) might be for a 380
>and a personal?

I hacked up ntpd on the on our iri to accept the "tickadj" var, multiply by
1000 and use it to set timetrim via the syssgi() function and
SGI_SETTIMETRIM (there is also a SGI_GETTIMETRIM). Tickadj is in uS/S
timetrim is in nS/S.  I've been using a value of about -400000 nS/S (so
tickadj = -400) for our 4D/20's and a 25: the logical clock stays synced
with that.  timetrim is a signed long.

	- Scott

	
--
Scott Presnell				        +1 (415) 476-9890
Pharm. Chem., S-926				Internet: srp@cgl.ucsf.edu
University of California			UUCP: ...ucbvax!ucsfcgl!srp
San Francisco, CA. 94143-0446			Bitnet: srp@ucsfcgl.bitnet

vjs@rhyolite.wpd.sgi.com (Vernon Schryver) (12/13/90)

In article <SCP.90Dec10100929@grizzly.acl.lanl.gov>, scp@acl.lanl.gov (Stephen C. Pope) writes:
>...
> 	(BTW: looking in /usr/sysgen, it appears that the ``fastclock''
> is off, but without adb, who can tell?!?)

Anyone with dbx and the root password.  Sorry--couldn't resist.

Try `dbx -k /unix /dev/kmem` followed by "p <your favorite variable>".  You
can use assignements to change things, including code.  (I've done it.) 
I don't think dbx has the primitive assembler found in the ddt-->adb linage,
but then RISC code is easy to assembler, particularly if you use
"<addr>/50i" to find examples.  You can even use line numbers in the <addr>
by putting a "#" either before or after the number (I forget).

I'd guess that running with the 1000Hz clock will cause you NTP grief on
slower IRIS's.  1 msec is not much time to be absolutely, positively sure
you handle all interrupts every time, so that you don't miss a clock
interrupt.



I don't remember what tickadj did in 4.3BSD, but I doubt you're going to
find something sufficiently similar in IRIX to be of interest.  The IRIS
adjtime() code in os/clock.c is different and better, IMInsufficentlyHO.

Someday, in some future release, I hope to see an NTP implementation.  It
is not in 3.3.2.  It may not be in the following releases.  It may be based
on someone's existing code, or it may be based on the Postscript  (After
all, Dave Mills has written that the RFC is as good as an implementation.)
One requirement for a product is support for multicasting and elections
analogous to timed, since the vast majority of those who buy IRIS's do not
want to set up yet another configuration file.  I am interested in strong
opinions on ntpd and xntpd.

Until and unless an NTP implementation appears in IRIX near you, and if you
are more interested in keeping time than in fiddling with it (I'm more
interested in the fiddling), you should use timeslave to synchronize one
IRIS to an NTP or other good clock and use -F or -G to build a hierarchy of
timed-synchronized IRIS's.


Vernon Schryver,   vjs@sgi.com

olson@anchor.esd.sgi.com (Dave Olson) (12/13/90)

In <SCP.90Dec10100929@grizzly.acl.lanl.gov> scp@acl.lanl.gov (Stephen C. Pope) writes:
| 	I've managed to get NTP running under IRIX 3.3.1/2, and it
| works, but not well.  The problem has to do with whatever the IRIX
| equivalent of BSD's ``tickadj'' variable is - the quantum is set far
| too large, and NTP has a hard time getting the kernel zeroed in on the
| correct value to adjtime(2).

The only limitation on adjustment value is that it not cause the number
of seconds converted to microsecs to overflow a long.  The clock itself
is skewed at a rate whose maximum value is a #defined in the clock code;
this value is currently the same as the default tickadj in 4.3 BSD at
240 msec/minute.  There is a bit more code to deal with very small and
very large adjustments.  Since it isn't a variable, you can't change
it unless you are adventurous enough to patch the clock code.

There is also the timetrim variable in master.d/kernel, which lets you set
the number of nanoseconds/second of clock skew, independent of adjtime()
and any time daemons.

| 	(BTW: looking in /usr/sysgen, it appears that the ``fastclock''
| is off, but without adb, who can tell?!?)

Try the ftimer command.  It will tell you whether it is on or off, as
well as allowing you to change it on the fly.  You could also use
dbx -k /unix /dev/kmem if you really wanted to do so...
--

	Dave Olson

Life would be so much easier if we could just look at the source code.