Serial ports...
On Wed, 7 Aug 1996, Richard G. Roberto wrote:
> On Wed, 7 Aug 1996, Mark Phillips wrote:
>
> > >When installing gpm, I set my mouse device to /dev/ttys0... Then, I =
> > >pointed everything else that wanted a mouse device to /dev/mouse. =
> >
> > What is the difference between
> >
> > /dev/ttys1, /dev/cua1 and /dev/mouse (a soft link)
> >
> > and when should each be used?
> >
> > Thanks,
> >
> > Mark Phillips. (mark@maths.flinders.edu.au)
> >
> >
>
> Mark,
>
> This is an old explanation that I'm not sure still holds
> true, but ...
>
> A cu device is for DCE devices (Data Communications
> Equiptment), basically modems, etc. A tty device is for DTE
> devices (Data Terminal Equiptment), basically terminals,
> serial input devices (mice), etc. The /dev/mouse should be
> a link to /dev/ttyxx where xx is probably S0 or S1, etc.
> You don't need to have /dev/mouse to have the mouse work,
> its just there to conveniently identify the mouse port.
>
> I hope that's helpful, and if anybody knows a better, more
> modern explanation, please do :-)
>
CAVEAT I'm an ignoramlepuss about Linux/Debian.
Under Nextstep, the serial ports work like this:
/dev/ttya /dev/ttya (/dev/ttyb) is used for "incoming"
connections from directly connected terminals
without CTS/RTS flow control.
When /dev/ttya is open(2)'ed, the device
driver asserts the DTR (data terminal ready)
signal. Opens of the /dev/ttya device name
do NOT block waiting for the RS-232 DCD (car-
rier detect) signal to be asserted.
/dev/ttya should be specified in the file
/etc/ttys for directly connected terminals.
If a serial line is opened with the /dev/ttya
device name, it may not be opened with the
/dev/ttyda or /dev/cua device names.
/dev/ttyfa /dev/ttyfa (/dev/ttyfb) operates identically
to /dev/ttya except that RTS/CTS flow control
is supported on 68040-based systems. See the
section below on RTC/CTS flow control.
/dev/ttyda /dev/ttyda (/dev/ttydb) is used for "incom-
ing" connections from modems.
When /dev/ttyda is opened, the device driver
asserts DTR and then blocks waiting for the
modem to assert DCD (indicating that a con-
nection has been established with a remote
modem). When DCD is asserted by the modem
the open system call returns. If DCD is
deasserted by the modem, further reads and
writes to the device will return the error
EIO (i/o error); if the tty is the control-
ling terminal for the process a SIGHUP will
be sent to the process.
/dev/ttyda is typically used in the file
/etc/ttys for connecting modems used for
dial-up logins.
If a serial line is opened with the
/dev/ttyda device name, it may not be opened
with the /dev/ttya. A serial line opened
with the /dev/ttyda device name may also be
opened with the /dev/cua device name. Inter-
locks between the /dev/ttyda and /dev/cua
device names are described below.
/dev/ttydfa /dev/ttydfa (/dev/ttydfb) operates identi-
cally to /dev/ttyda except that RTS/CTS flow
control is supported on 68040-based systems.
See the section below on RTC/CTS flow con-
trol.
/dev/cua /dev/cua (/dev/cub) is used for "outgoing"
connections to auto-dial modems.
When /dev/cua is opened, the device driver
asserts DTR and does NOT block waiting for
the modem to assert DCD. No action is taken
by the driver when the modem asserts or de-
asserts DCD.
/dev/cua is typically used by programs like
"uucp" and "tip" that need access to auto-
dial modems.
If a serial line is opened with the /dev/cua
device name, it may not be opened with
/dev/ttya. A serial line opened with the
/dev/cua device name may also be opened with
the /dev/ttyda device name. Interlocks
between the /dev/ttyda and /dev/cua device
names are described below.
/dev/cufa /dev/cufa (/dev/cufb) operates identically to
/dev/cua except that RTS/CTS flow control is
supported on 68040-based systems. See the
section below on RTC/CTS flow control. WARN-
ING: To avoid locking problems with tip and
uucp, all reference to the "cu" device for a
particular serial port must be of the same
flow control type. E.g. tip should not refer
to /dev/cua while uucp refers to /dev/cufa.
Sherwood Botsford |Unsolicited email that advertises commercial
Physics Dept |activities will consitute a request for
U of Alberta |spellchecking of all words of less than three
Edmonton, AB, |characters. I charge $US500 for this service.
T6G 2J1 |There is no warranty of correctness of this service.
Reply to: