Subject: Re: Serial port of SPARCclassic doesn't work
To: Matthias Habl <ham03789@rss1.rz.uni-regensburg.de>
From: Klaus Klein <kleink@reziprozitaet.de>
List: port-sparc
Date: 10/04/2001 23:40:50
Matthias Habl <ham03789@rss1.rz.uni-regensburg.de> writes:

> But it isn't possible to change the parameters of /dev/tty{a,b} though
> the program 'stty' doesn't report any errors. Here is an example:
> 
> 	hostname# stty -f /dev/ttya
> 	ispeed 0 baud; ospeed 9600 baud;
> 	lflags: echoe echoke echoctl
> 	etc.
> 
> 	hostname# stty -f /dev/ttya ispeed 9600
> 
> 	hostname# stty -f /dev/ttya
> 	ispeed 0 baud; ospeed 9600 baud;
> 	lflags: echoe echoke echoctl
> 	etc.	
> 
> The parameter 'ispeed' has the same value as before.

There's nothing wrong with this behaviour.  When opening a terminal
device, a set of default is restored; for a change, give

        # ( stty; stty  ispeed 9600; stty  ) < /dev/dtya

a try.

Your example above isn't quite useful, BTW.  stty(1) reveals:

     ispeed number
                 Set terminal input baud rate to the number given, if possi-
                 ble.  If the input baud rate is set to zero, the input baud
                 rate is set to the value of the output baud rate.

For persistent changes to tty settings, see ttyflags(8).

> If I do something like
> 
> 	hostname# cat file >> /dev/ttya
> 
> the machine is hanging and it has to be powered down because
> interrupting by ^C and ^Z doesn't work any more.

While I don't observe this to be uninterruptible (it shouldn't be),
the first paragraph of termios(4) should explain why the shell may
block when opening the tty.  You can work around this using
ttyflags(8) as well, _if_ applicable.


- Klaus