[ntp:hackers] Any NetBSD and/or tty ioctl gurus?

Paul Vixie paul at vix.com
Tue Dec 27 19:10:33 UTC 2005


# Anybody recognize this quirk?

yes.  it's a posix "termios" problem.

# Does NetBSD just not support more than one refclock?

no correct implementation of termios will allow more than one refclock.

# Seems to be that way.  I found a note from the NetBSD on AMD-64 list that 
# says only one.  (0 if in debug mode.)  It also says:
#   For SIGIO you need a CTTY.
#     There can only be one CTTY.
#     Thus you can get only SIGIO from one CTTY. This seems
#     to be the case with many BSD derived systems (*BSD, Ultrix).
# 
# Looks like everybody agrees that this path won't work.

sigio is the wrong approach.  ntp needs to be using select() for this.
signals have a lot of timing jitter on their best day.  select() isn't
worse, jitter-wise.  if and when we re-do the I/O core of ntp to use
"eventlib", all of these I/O signals will go away for good.

# How does this work on FreeBSD?  Is there any good documentation for the tty 
# ioctls and/or is there a reasonable chance of fixing this on NetBSD?

bsd/os and freebsd have, due to my complaints, a way to behave noncompliantly
regarding this part of the posix "termios" specification.  apparently, nobody
in the netbsd community has yet tried to do what i tried to do all those years
ago.

# I've seen suggestions of using the parallel port.  (I don't remember if that 
# was for 1 PPS signal or several.)  I'd like to avoid that mostly for 
# mechanical reasons.

if you use the parallel port on freebsd, the kernel can do the PPS logic for
you, disciplining the clock without intervention from user space.  this is
thanks to dave mills' kernel-pll logic, about which there is an rfc i think.
it's the right approach, but it doesn't support multiple PPS's ttbomk.

# Maybe I should pop up a level.  Is this a strange configuration?  Is it
# silly to use more than one refclock on a system?  I was hoping to be able to
# compare clocks.

it's a reasonable thing to want to do.  or at least i thought so when i did
it.  most reasonable people these days buy ntp refclocks and put them on-net
and don't bother with PPS or source code.  i don't want to be reasonable in
that sense.


More information about the hackers mailing list