Port-sparc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: DCD as an alternate /dev device?



On 8/26/2011 13:22, Greg A. Woods wrote:
At Wed, 24 Aug 2011 13:34:32 -0700, AGC<agcarver+netbsd%acarver.net@localhost>  
wrote:
Subject: Re: DCD as an alternate /dev device?

 From some of the discussions on the ntpd list it appears that there
should be an ability to open the port twice.  However, the discussions
it also appears that the port is actually split in two pieces by the
underlying OS.  The TX/RX is available via one device and the signals
(especially DCD) is available by a separate device.  One user
commented that FreeBSD happens to perform this breakout.

I don't know if this will help for your specific problem, but in general
NetBSD does have two /dev interfaces for each physical port, one which
blocks waiting for DCD and the other which does not.  See tty(4) on
NetBSD and pay attention to the description of /dev/dtyXX and note the
differences between that interface and the one for /dev/ttyXX.

Note though that assertion of DCD will be ignored on /dev/ttyXX
(i.e. leaving the blocked process blocked) if the corresponding
/dev/dtyXX is open -- and subsequent loss of DCD will be reported to
/dev/dtyXX while the latter is open (and the process blocked on
/dev/ttyXX will wait until the next DCD event which occurs without the
corresponding /dev/dtyXX being open).

This is of course exactly what you want for bi-directional use of a
proper modem that's used for normal dial-up logins, uucp, cu/kermit,
etc.

I'm not sure how the kernel PPS_SYNC and NTP options affect this.

I would think you want to use /dev/dtya at the very least as the PPS
device, but I didn't read through enough of sys/ic/com.c to see how that
would affect the PPS_SYNC stuff, if at all.

There's very little good documentation about this kernel NTP and
PPS_SYNC stuff with nothing in tty(4) and very little in options(4), and
nothing about the pps mentioned in conf/majors (no pps(4), though is it
the pps "driver" for ppbus(4)?).


I tried using the dty and tty separately for the configuration but it didn't seem to work. I symlinked /dev/gps1 to /dev/ttyb and /dev/pps1 to /dev/dtyb. However, the port was not broken up so once the /dev/gps1 port was opened, /dev/pps1 became unavailable for use. The PPS reference clock in ntpd stayed offline even when using kernel PPS routines.

So I'm not entirely sure how to make the OS provide access to the GPS with PPS when ntpd tries to open the port twice.

Home | Main Index | Thread Index | Old Index