[OpenIndiana-discuss] stty source code

Reginald Beardsley pulaskite at yahoo.com
Wed Sep 5 17:28:23 UTC 2012


This is an example of one symptom:

oi%rhb {9} stty -a | egrep opost
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel 
oi%rhb {10} stty -onlcr
oi%rhb {11} stty -a | egrep opost
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel 

Notice that stty did *not* toggle onlcr. As noted earlier, I can toggle olcuc and some other output modes, but there are several I can't.

I started checking just the xterm window stty settings when I couldn't get tip to do this by setting things in /etc/ttydefs.  It appears to me that something is broken in code which is common to stty and ttymon.

I'm using tip running in an xterm to connect to an USB<->RS-232 adapter connected to an MSP430G2553 installed in a TI MSP430 LaunchPad.  The 'G2553 is running a forth interpreter.

The example I gave looks like OBP because OBP is also a forth interpreter. I should probably have commented on that previously.  It's not really relevant, but could be confusing.

I have two different forth interpreters that run on the MSP430G2553, a 20 pin DIP w/ 16K flash & 512 byte RAM.  One was sending NL-CR and worked properly.  The second sent just NL which ttymon & tip *should* be able to convert to NL-CR for the display terminal, but did not.

As noted previously, I've now modified the second forth so that it sends NL-CR and things work fine for my purposes.

In summary, I'm connecting to a remote host over a serial line. Old and obsolete cruft to most these days, but the predominate means of communicating w/ microcontrollers today and probably always will be.  It only takes 2 pins, Rx & Tx. (Gnd doesn't require an MCU pin) In the microcontroller world MCU pins are very precious. It also doesn't even require a UART in the MCU, though many have them.  So *any* MCU w/ 2 free pins can use RS-232 to talk to the outside world.

This is what stty & ttymon exist for.  But it doesn't seem to work and appears to have been broken for some time as Solaris 10 has the same problem.  Nemeth et al note Solaris serial line discipline is a mess.  However, it appears to be worse than that.  It appears to be broken.

Have Fun!
Reg




More information about the OpenIndiana-discuss mailing list