termio vs. termios (was: Re: midi player? & more)

David Mosberger-Tang (davidm@azstarnet.com)
Sat, 17 Feb 1996 17:22:32 -0700


OK, here is the scoop:

The OSF/1 (and System V?) version of termio interprets termio.c_cc[4]
and termio.c_cc[5] as VEOF and VEOL if ICANON is set in
termio.c_lflag. If ICANON is not set, those fields are interpreted as
VMIN and VTIME, respectively. What more does is get the current
termio structure, turn off ICANON (as well as making some other
changes), and then it sets the new termio structure. Since the old
structure was gotten with ICANON set, the values in termio.c_cc[4]/[5]
are the VEOF and VEOL values but when they are set, they are
interpreted as VMIN and VTIME... So it really is necessary to set
VMIN and VTIME in more---it's not a kernel problem (but it sure is
ugly...).

I guess the solution is to encourage everyone to use termios (that's
why less is more... :-)

--david

PS: Here is a small patch that makes console unblanking work. A workaround
for an unpatched kernel is to switch to a different console, that will
bring it back to life as well...

--- 386/drivers/char/keyboard.c Sat Feb 17 10:31:09 1996
+++ linux/drivers/char/keyboard.c Sat Feb 17 16:33:45 1996
@@ -35,6 +35,7 @@
#include "kbd_kern.h"
#include "diacr.h"
#include "vt_kern.h"
+#include "selection.h"

/*
* On non-x86 hardware we do a full keyboard controller
@@ -1161,6 +1162,8 @@
if (!send_data(0xed) || !send_data(leds))
send_data(0xf4); /* re-enable kbd if any errors */
}
+ if (console_blanked)
+ show_console();
}

int kbd_init(void)