jonas@lkbpyr.UUCP (Jonas Heyman) (12/20/90)
Hi, I have a problem concerning stty in the "att" universe. I recently uppgraded from 4.1 to 5.0 on a 9820 Pyramid. On this machine I tried to do following: stty < /dev/tty104 (shows 300 baud) stty 9600 < /dev/tty104 (trying to change to 9600 baud) stty < /dev/tty104 (still 300 baud ?) When I do the following on a machine with OS 4.1 it works fine,is there something I'm doing wrong ? or is there a difference between the OS versions. (The port tty104 is marked "off" in inittab). Jonas -- /jonas@lkbpyr.lkb.se/
rick@ptcburp.ptcbu.oz.au (Rick Stevenson) (12/22/90)
jonas@lkbpyr.UUCP (Jonas Heyman) writes: >I have a problem concerning stty in the "att" universe. >I recently uppgraded from 4.1 to 5.0 on a 9820 Pyramid. >On this machine I tried to do following: > stty < /dev/tty104 (shows 300 baud) > stty 9600 < /dev/tty104 (trying to change to 9600 baud) > stty < /dev/tty104 (still 300 baud ?) >When I do the following on a machine with OS 4.1 it works fine,is there >something I'm doing wrong ? or is there a difference between the OS versions. >(The port tty104 is marked "off" in inittab). The behaviour you are seeing on OSx 5.0 is what I would have expected. The default baud rate for a tty device is 300 baud, and when you open a tty that is not already open the baud rate will be reset. Changing the speed with stty will only "stick" while the tty is kept open. Try this and see if it works: sleep 120 > /dev/ttyi04 & (keep tty device open for a while) stty 9600 < /dev/ttyi04 stty < /dev/ttyi04 The device will be reset to 300 baud again if you open it after the sleep has completed. I'm not sure why see different behaviour on 4.1. I suspect that the difference is not directly related to the OS version (perhaps there is a spooler or something which holds the device open on the 4.1 machine?). The 4.1 kernel should behave as described above, but I can't guarantee it - 4.1 was before my time. Rick. -- -m------- Rick Stevenson ---mmm----- Pyramid Technology +61 75 522475 FAX -----mmmmm--- Research Park, Bond University +61 75 950249 VOICE -------mmmmmmm- Gold Coast, Q 4229, AUSTRALIA rick@ptcburp.ptcbu.oz.au
bob@pta.oz.au (Bob Vernon) (12/24/90)
In article <1283@lkbpyr.UUCP> jonas@lkbpyr.UUCP (Jonas Heyman) writes: >Hi, > >I have a problem concerning stty in the "att" universe. >I recently uppgraded from 4.1 to 5.0 on a 9820 Pyramid. >On this machine I tried to do following: > > stty < /dev/tty104 (shows 300 baud) > stty 9600 < /dev/tty104 (trying to change to 9600 baud) > stty < /dev/tty104 (still 300 baud ?) The stty settings are not maintained unless the port is held open continuosly. The three lines above will open and close the port each time. Try the following :- ( stty stty 9600 stty ) < /dev/tty104 Thats in the att universe and assuming Bourne shell syntax. >When I do the following on a machine with OS 4.1 it works fine,is there >something I'm doing wrong ? or is there a difference between the OS versions. >(The port tty104 is marked "off" in inittab). Should be the same. Maybe there is something running on the 4.1 system holding the port open. >Jonas Bob V! -m------- Robert Vernon DOMAIN: bob@pta.oz.au ---mmm----- Pyramid Technology (Australia) UUCP: pyramid!pta!bob -----mmmmm--- 328 High Street PHONE: +61 2 415 0515 -------mmmmmmm- Chatswood 2067 Australia FAX: +61 2 417 8232
csg@pyramid.pyramid.com (Carl S. Gutekunst) (12/25/90)
>I'm not sure why see different behaviour on 4.1.
OSx 4.1 was broken.
This is one of those really ugly cases where UNIX shows its weaknesses. The
only way to "reserve" a device or file is for a process to hold it open. In
Version 7, the tty device would pretty much keep whatever modes had been set
by the last process that had it open. This meant, of course, that the modes
on a newly opened device were indeterminate. SVR3 went the more reliable, if
less useful route: all the modes are reset to a known state when the device
is opened is opened for the first time. Which means that if you want to set
modes on joe random device from a shell script, you need to spawn a subshell
just to hold the device open and to keep the modes from going away.
Why AT&T chose 300 baud for the default line speed is a different issue
entirely. (I think my RSX-11 system in 1977 already had the good sense to
default to 9600.)
<csg>