* stty < /dev/modem blocks???
@ 1999-09-14 3:33 Lou Langholtz
1999-09-15 17:27 ` Randall R Schulz
0 siblings, 1 reply; 5+ messages in thread
From: Lou Langholtz @ 1999-09-14 3:33 UTC (permalink / raw)
To: linuxppc-dev
On my 2.2.12 kernel with some hacks I've added I can't use stty to get
the configuration info for /dev/ttyS0. stty < /dev/ttyS0 (aka
/dev/modem) just hangs. strace stty < /dev/ttyS0 does the same thing.
strace doesn't even show me any output. Ctrl-C kills the stty or strace
but shouldn't stty work on the modem serial device to get the config
info? Is it just the hacks I've added in my kernel perhaps? stty
< /dev/pts/0 works just fine. Ideas?
Thanks!!
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: stty < /dev/modem blocks???
1999-09-14 3:33 stty < /dev/modem blocks??? Lou Langholtz
@ 1999-09-15 17:27 ` Randall R Schulz
1999-09-16 7:22 ` Michel Lanners
0 siblings, 1 reply; 5+ messages in thread
From: Randall R Schulz @ 1999-09-15 17:27 UTC (permalink / raw)
To: Lou Langholtz, linuxppc-dev
Lou,
As you know, the less-than (<) operator in all Unix shells opens the
file name given as an argument before it executes the command. In
order for an open() call on a TTY device to complete, the RS232
hardware signals that indicate the presence of an active device
connected to the port. In practice, this means that the DTR (data
terminal ready) signal must be asserted before the open call will
return. Because the TTY drivers are "slow" devices, the kernel wait
call that synchronizes the application program's open() call with the
serial hardware state is interruptable. That is why you can get out
of the "hang" with a SIGINT (control-C).
The reason you're able to make the analogous thing work with
/dev/pts/0 is that in place of waiting for a hardware signal, the PTY
driver slave side (/dev/pts/nn) waits for an open on the
corresponding controlling side (/dev/ptc/nn). If you're running X and
you have a terminal window open, then there's a terminal emulator
with the controlling side of /dev/pts/0 open and that allows your
"stty </dev/pts/0" command to complete.
Randy Schulz
Mountain View, CA USA
At 21:33 -0600 9/13/99, Lou Langholtz wrote:
>On my 2.2.12 kernel with some hacks I've added I can't use stty to get
>the configuration info for /dev/ttyS0. stty < /dev/ttyS0 (aka
>/dev/modem) just hangs. strace stty < /dev/ttyS0 does the same thing.
>strace doesn't even show me any output. Ctrl-C kills the stty or strace
>but shouldn't stty work on the modem serial device to get the config
>info? Is it just the hacks I've added in my kernel perhaps? stty
>< /dev/pts/0 works just fine. Ideas?
>
>Thanks!!
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: stty < /dev/modem blocks???
1999-09-15 17:27 ` Randall R Schulz
@ 1999-09-16 7:22 ` Michel Lanners
1999-09-16 20:14 ` Randall R Schulz
1999-09-17 0:36 ` Paul Mackerras
0 siblings, 2 replies; 5+ messages in thread
From: Michel Lanners @ 1999-09-16 7:22 UTC (permalink / raw)
To: rrschulz; +Cc: ldl, linuxppc-dev
On 15 Sep, this message from Randall R Schulz echoed through cyberspace:
> As you know, the less-than (<) operator in all Unix shells opens the
> file name given as an argument before it executes the command. In
> order for an open() call on a TTY device to complete, the RS232
> hardware signals that indicate the presence of an active device
> connected to the port. In practice, this means that the DTR (data
> terminal ready) signal must be asserted before the open call will
> return.
OK, this sounds right, but how do you explain that I can get at the tty
settings with
stty -a < /dev/ttySx
for both of my serial ports, with absolutely nothing connected to them?
;-)
Michel
-------------------------------------------------------------------------
Michel Lanners | " Read Philosophy. Study Art.
23, Rue Paul Henkes | Ask Questions. Make Mistakes.
L-1710 Luxembourg |
email mlan@cpu.lu |
http://www.cpu.lu/~mlan | Learn Always. "
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: stty < /dev/modem blocks???
1999-09-16 7:22 ` Michel Lanners
@ 1999-09-16 20:14 ` Randall R Schulz
1999-09-17 0:36 ` Paul Mackerras
1 sibling, 0 replies; 5+ messages in thread
From: Randall R Schulz @ 1999-09-16 20:14 UTC (permalink / raw)
To: mlan; +Cc: ldl, linuxppc-dev
Michel,
It depends on the serial hardware and possibly on the defaults for
the driver associated with those ports. Not all serial hardware
behaves identically. I may be wrong about this, but it might be
possible that a floating input (one connected neither to ground or
+12) might get interpreted differently on different serial controller
chips.
Without poring over the pertinent kernel driver code and knowing the
details of the serial hardware and it's incorporation into your
computer, I cannot give a more definitive answer.
Randy Schulz
Mountain View, CA USA
At 09:22 +0200 9/16/99, Michel Lanners wrote:
>On 15 Sep, this message from Randall R Schulz echoed through cyberspace:
> > As you know, the less-than (<) operator in all Unix shells opens the
> > file name given as an argument before it executes the command. In
> > order for an open() call on a TTY device to complete, the RS232
> > hardware signals must indicate the presence of an active device
> > connected to the port. In practice, this means that the DTR (data
> > terminal ready) signal must be asserted before the open call will
> > return.
>
>OK, this sounds right, but how do you explain that I can get at the tty
>settings with
>
>stty -a < /dev/ttySx
>
>for both of my serial ports, with absolutely nothing connected to them?
>
>;-)
>
>Michel
>
>-------------------------------------------------------------------------
>Michel Lanners | " Read Philosophy. Study Art.
>23, Rue Paul Henkes | Ask Questions. Make Mistakes.
>L-1710 Luxembourg |
>email mlan@cpu.lu |
>http://www.cpu.lu/~mlan | Learn Always. "
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: stty < /dev/modem blocks???
1999-09-16 7:22 ` Michel Lanners
1999-09-16 20:14 ` Randall R Schulz
@ 1999-09-17 0:36 ` Paul Mackerras
1 sibling, 0 replies; 5+ messages in thread
From: Paul Mackerras @ 1999-09-17 0:36 UTC (permalink / raw)
To: linuxppc-dev
Michel Lanners <mlan@cpu.lu> wrote:
> OK, this sounds right, but how do you explain that I can get at the tty
> settings with
>
> stty -a < /dev/ttySx
>
> for both of my serial ports, with absolutely nothing connected to them?
It depends on the state of the CLOCAL flag. If it's set, which is
the default on boot, you can open it without waiting. If it's clear,
an open will normally block until the CD (carrier detect) input is
asserted. (To open it without waiting when CLOCAL is clear, you put
O_NONBLOCK in the flags on the open system call.)
When you run pppd, it will normally clear the CLOCAL flag (unless you
give it the `local' option), so that it can tell when the modem hangs
up. It tries to restore the settings on exit, but this can fail if
the modem has already hung up, since after a hangup, the linux tty
driver won't let you do anything at all with the fd you had open to
the tty except close it.
Paul.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1999-09-17 0:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-09-14 3:33 stty < /dev/modem blocks??? Lou Langholtz
1999-09-15 17:27 ` Randall R Schulz
1999-09-16 7:22 ` Michel Lanners
1999-09-16 20:14 ` Randall R Schulz
1999-09-17 0:36 ` Paul Mackerras
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).