stailey@iris613.gsfc.nasa.gov (Ken Stailey) (03/07/89)
I have run into some snags with rs232. When the system boots it works fine. I can type "cat -u </dev/tty1" and get normal results. But after I run my terminal program (which I'm using now) it can get very messed up and won't let me read from /dev/tty1 (writes always work fine). I think that it had to do with not closing /dev/tty1 after the program terminated. Is there an ioctl (or something) that will reset this? Concerned, Ken
hcj@lzaz.ATT.COM (HC Johnson) (03/09/89)
In article <122@dftsrv.gsfc.nasa.gov>, stailey@iris613.gsfc.nasa.gov (Ken Stailey) writes: > > I have run into some snags with rs232. When the system boots it works fine. > I can type "cat -u </dev/tty1" and get normal results. But after I run my > terminal program (which I'm using now) it can get very messed up and won't > let me read from /dev/tty1 (writes always work fine). I think that it had > to do with not closing /dev/tty1 after the program terminated. > > Is there an ioctl (or something) that will reset this? > > Concerned, > Ken Two undocumented ioctls affect the rs232; TIOCSTART, and TIOCSTOP. This is what happened. Minix lacks the concept of how many times a device is opened, so there is no way to due a 'final' close. For example, cat -u < /dev/tty1 will do 4 opens and 3 closes before reading a single byte. I added TIOCSTART and TIOCSTOP when i would run a separate program to send these. This seemed awkward, so I attempted to get rs232 to start up better on open. Also, cu has problems, especially if you do not terminate it with ~. . If all else fails, and you need to run cat -u < /dev/tty1 after cu, I would think that ~%local /bin/cat -u executed from within cu will do the job. As the shell executes this line I would also expect ~%local /bin/cat -u > myfile to work. But don't hold me to it. Howard C. Johnson ATT Bell Labs att!lzaz!hcj hcj@lzaz.att.com