leo@marco.UUCP (Matthias Pfaller) (08/03/90)
There seem to be some bugs in tty.c.
1. Try to type a ^S followd by a ^D (but do a sync before).
now you will get many login prompts but the tty-task is still blocked.
After receiving of a ^D the following code is executed
/* CTRL-D means end-of-file, unless it is escaped. It
* is stored in the text as MARKER, and counts as a
* line feed in terms of knowing whether a full line
* has been typed already.
*/
if (ch == tp->tty_eof) {
ch = MARKER;
tp->tty_lfct++; /* counts as LF */
}
this relies on the fact that at the end of in_char ch will be inserted
in tty_inqueue.
But if the line is in STOPPED state the following code is executed after
the receiption of any character:
/* Check for and process CTRL-Q (terminal start). */
if (tp->tty_inhibited == STOPPED) {
tp->tty_inhibited = RUNNING;
(*tp->tty_devstart)(tp); /* resume output */
return;
}
So MARKER gets never inserted in tty_inqueue.
The code should (I think) look like
/* Check for and process CTRL-Q (terminal start). */
if (tp->tty_inhibited == STOPPED) {
tp->tty_inhibited = RUNNING;
(*tp->tty_devstart)(tp); /* resume output */
if (ch == tp->tty_xoff)
return;
}
else if (ch == tp->tty_xoff)
return;
After this correction minix behaves like our Unix-box in ixany-mode.
2. If you have connected a terminal to tty1 type a ^S there. Now go to
your console, do some output and type a ^S followd by a ^Q.
Now tty1 hangs.
I do not the cause of this problem, but if anyone allready has solved
this problem, I would like to know it.
Matthias Pfaller (leo@verw.marco.de)