Add missing file /.profile.

Simplify stty utility, remove unused options.
This commit is contained in:
Serge Vakulenko
2015-09-13 01:59:42 -07:00
parent 967ec35fd2
commit 0087168ba6
6 changed files with 31 additions and 95 deletions

3
.gitignore vendored
View File

@@ -24,8 +24,5 @@
*.dis *.dis
*.0 *.0
*.img *.img
sdcard.rd
.profile
*~
Makefile.user Makefile.user

7
.profile Normal file
View File

@@ -0,0 +1,7 @@
echo 'erase ^?, kill ^U, intr ^C'
stty dec
PATH=/bin:/sbin:/etc
export PATH
HOME=/
export HOME
export TERM

View File

@@ -59,32 +59,32 @@ first rows and then columns.
.PP .PP
\fIOperands\fP are selected from the following: \fIOperands\fP are selected from the following:
.TP 10 .TP 10
.B even .B even
allow even parity input allow even parity input
.br .br
.ns .ns
.TP 10 .TP 10
.B \-even .B \-even
disallow even parity input disallow even parity input
.TP 10 .TP 10
.B odd .B odd
allow odd parity input allow odd parity input
.br .br
.ns .ns
.TP 10 .TP 10
.B \-odd .B \-odd
disallow odd parity input disallow odd parity input
.TP 10 .TP 10
.B raw .B raw
raw mode input raw mode input
(\fBno\fR input processing (erase, kill, interrupt, ...); parity bit passed back) (\fBno\fR input processing (erase, kill, interrupt, ...); parity bit passed back)
.br .br
.ns .ns
.TP 10 .TP 10
.B \-raw .B \-raw
negate raw mode negate raw mode
.TP 10 .TP 10
.B cooked .B cooked
same as `\-raw' same as `\-raw'
.TP 10 .TP 10
.B cbreak .B cbreak
@@ -96,29 +96,29 @@ but all other processing (interrupt, suspend, ...) is performed
.ns .ns
.TP 10 .TP 10
.B \-cbreak .B \-cbreak
make characters available to make characters available to
.I read .I read
only when newline is received only when newline is received
.TP 10 .TP 10
.B \-nl .B \-nl
allow carriage return for new-line, allow carriage return for new-line,
and output CR-LF for carriage return or new-line and output CR-LF for carriage return or new-line
.br .br
.ns .ns
.TP 10 .TP 10
.B nl .B nl
accept only new-line to end lines accept only new-line to end lines
.TP 10 .TP 10
.B echo .B echo
echo back every character typed echo back every character typed
.br .br
.ns .ns
.TP 10 .TP 10
.B \-echo .B \-echo
do not echo characters do not echo characters
.TP 10 .TP 10
.B tandem .B tandem
enable inbound software (xon/xoff) flow control, so that the system sends enable inbound software (xon/xoff) flow control, so that the system sends
out the stop character when out the stop character when
its internal queue is in danger of overflowing on input, and sends the its internal queue is in danger of overflowing on input, and sends the
start character when it is ready to accept further input start character when it is ready to accept further input
@@ -128,12 +128,12 @@ start character when it is ready to accept further input
.B \-tandem .B \-tandem
disable inbound software (xon/xoff) flow control disable inbound software (xon/xoff) flow control
.TP 10 .TP 10
.B \-tabs .B \-tabs
replace tabs by spaces when printing replace tabs by spaces when printing
.br .br
.ns .ns
.TP 10 .TP 10
.B tabs .B tabs
preserve tabs preserve tabs
.br .br
.PP .PP
@@ -201,11 +201,10 @@ This character is an additional character causing wakeup.
.TP 10 .TP 10
.B dec .B dec
set all modes suitable for Digital Equipment Corp. operating systems set all modes suitable for Digital Equipment Corp. operating systems
users; (erase, kill, and interrupt characters to ^?, ^U, and ^C, users; (erase, kill, and interrupt characters to ^?, ^U, and ^C, and ``crt''.)
decctlq and ``newcrt''.)
.ns .ns
.TP 10 .TP 10
.B 0 .B 0
hang up phone line immediately hang up phone line immediately
.br .br
.ns .ns
@@ -235,11 +234,6 @@ and more functionality than the basic driver is fully described in
.IR tty (4). .IR tty (4).
The following options apply only to it. The following options apply only to it.
.TP 10 .TP 10
.B new
Use new driver (switching flushes typeahead).
.br
.ns
.TP 10
.B crt .B crt
Set options for a CRT (crtbs, ctlecho and, if >= 1200 baud, Set options for a CRT (crtbs, ctlecho and, if >= 1200 baud,
crterase and crtkill.) crterase and crtkill.)
@@ -276,18 +270,6 @@ Print two backspaces following the EOT character (control D).
Control characters echo as themselves; in cooked mode EOT (control-D) Control characters echo as themselves; in cooked mode EOT (control-D)
is not echoed. is not echoed.
.TP 10 .TP 10
.B decctlq
After output is suspended (normally by ^S), only a start character
(normally ^Q) will restart it. This is compatible with DEC's vendor
supplied systems.
.br
.ns
.TP 10
.B \-decctlq
After output is suspended, any character typed will restart it;
the start character will restart output without providing any input.
(This is the default.)
.TP 10
.B tostop .B tostop
Background jobs stop if they attempt terminal output. Background jobs stop if they attempt terminal output.
.br .br
@@ -305,7 +287,7 @@ Output is being discarded usually because user hit control O (internal state bit
Output is not being discarded. Output is not being discarded.
.TP 10 .TP 10
.B pendin .B pendin
Input is pending after a switch from cbreak to cooked Input is pending after a switch from cbreak to cooked
and will be re-input when a read becomes pending or more input arrives and will be re-input when a read becomes pending or more input arrives
(internal state bit). (internal state bit).
.br .br
@@ -346,9 +328,7 @@ Don't send hangup signal if carrier drops.
.B \-nohang .B \-nohang
Send hangup signal to control process group when carrier drops. Send hangup signal to control process group when carrier drops.
.PP .PP
The following special characters are applicable only to the new The following special characters are not normally changed.
teletype driver
and are not normally changed.
.TP 10 .TP 10
.BI susp \ c\fR .BI susp \ c\fR
set suspend process character to \fIc\fR (default control Z). set suspend process character to \fIc\fR (default control Z).

View File

@@ -106,8 +106,6 @@ struct MODES lmodes[] = {
"-ctlecho", 0, LCTLECH, "-ctlecho", 0, LCTLECH,
"pendin", LPENDIN, 0, "pendin", LPENDIN, 0,
"-pendin", 0, LPENDIN, "-pendin", 0, LPENDIN,
"decctlq", LDECCTQ, 0,
"-decctlq", 0, LDECCTQ,
"noflsh", LNOFLSH, 0, "noflsh", LNOFLSH, 0,
"-noflsh", 0, LNOFLSH, "-noflsh", 0, LNOFLSH,
0 0
@@ -223,33 +221,9 @@ args:
while (argc-- > 0) { while (argc-- > 0) {
arg = *argv++; arg = *argv++;
if (eq("new")){
ldisc = NTTYDISC;
if (ioctl(1, TIOCSETD, &ldisc)<0)
perror("ioctl");
continue;
}
if (eq("newcrt")){
ldisc = NTTYDISC;
lmode &= ~LPRTERA;
lmode |= LCRTBS|LCTLECH;
if (mode.sg_ospeed >= B1200)
lmode |= LCRTERA|LCRTKIL;
if (ioctl(1, TIOCSETD, &ldisc)<0)
perror("ioctl");
continue;
}
if (eq("crt")){ if (eq("crt")){
lmode &= ~LPRTERA; crt: lmode &= ~LPRTERA;
lmode |= LCRTBS|LCTLECH; lmode |= LCRTBS | LCTLECH | LCRTERA | LCRTKIL;
if (mode.sg_ospeed >= B1200)
lmode |= LCRTERA|LCRTKIL;
continue;
}
if (eq("old")){
ldisc = 0;
if (ioctl(1, TIOCSETD, &ldisc)<0)
perror("ioctl");
continue; continue;
} }
if (eq("sane")){ if (eq("sane")){
@@ -261,14 +235,7 @@ args:
mode.sg_erase = 0177; mode.sg_erase = 0177;
mode.sg_kill = CTRL('u'); mode.sg_kill = CTRL('u');
tc.t_intrc = CTRL('c'); tc.t_intrc = CTRL('c');
ldisc = NTTYDISC; goto crt;
lmode &= ~LPRTERA;
lmode |= LCRTBS|LCTLECH|LDECCTQ;
if (mode.sg_ospeed >= B1200)
lmode |= LCRTERA|LCRTKIL;
if (ioctl(1, TIOCSETD, &ldisc)<0)
perror("ioctl");
continue;
} }
for (sp = special; sp->name; sp++) for (sp = special; sp->name; sp++)
if (eq(sp->name)) { if (eq(sp->name)) {
@@ -387,11 +354,7 @@ prmodes(all)
fprintf(stderr, "net discipline, "); fprintf(stderr, "net discipline, ");
else else
#endif #endif
if (ldisc==NTTYDISC) if (ldisc!=NTTYDISC)
fprintf(stderr, "new tty, ");
else if (ldisc == 0)
fprintf(stderr, "old tty, ");
else
fprintf(stderr, "discipline %d, "); fprintf(stderr, "discipline %d, ");
if(mode.sg_ispeed != mode.sg_ospeed) { if(mode.sg_ispeed != mode.sg_ospeed) {
@@ -435,8 +398,7 @@ prmodes(all)
} }
if (ldisc == NTTYDISC) { if (ldisc == NTTYDISC) {
int newcrt = (lmode & (LCTLECH|LCRTBS)) == (LCTLECH|LCRTBS) && int newcrt = (lmode & (LCTLECH|LCRTBS)) == (LCTLECH|LCRTBS) &&
(lmode & (LCRTERA|LCRTKIL)) == (lmode & (LCRTERA|LCRTKIL)) == (LCRTERA|LCRTKIL);
((mode.sg_ospeed > B300) ? LCRTERA|LCRTKIL : 0);
int nothing = 1; int nothing = 1;
if (newcrt) { if (newcrt) {
if (all) if (all)
@@ -468,7 +430,6 @@ prmodes(all)
nothing = 0; nothing = 0;
} }
lpit(LPENDIN, "-pendin "); lpit(LPENDIN, "-pendin ");
lpit(LDECCTQ, "-decctlq ");
lpit(LNOFLSH, "-noflsh "); lpit(LNOFLSH, "-noflsh ");
if (any || nothing) if (any || nothing)
fputc('\n', stderr); fputc('\n', stderr);

View File

@@ -161,7 +161,6 @@ struct ttysize {
#define PASS8 0x08000000 #define PASS8 0x08000000
#define CTLECH 0x10000000 /* echo control chars as ^X */ #define CTLECH 0x10000000 /* echo control chars as ^X */
#define PENDIN 0x20000000 /* tp->t_rawq needs reread */ #define PENDIN 0x20000000 /* tp->t_rawq needs reread */
#define DECCTQ 0x40000000 /* only ^Q starts after ^S */
#define NOFLSH 0x80000000 /* no output flush on signal */ #define NOFLSH 0x80000000 /* no output flush on signal */
/* locals, from 127 down */ /* locals, from 127 down */
#define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */ #define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */
@@ -181,7 +180,6 @@ struct ttysize {
#define LPASS8 ((int)(PASS8>>16)) #define LPASS8 ((int)(PASS8>>16))
#define LCTLECH ((int)(CTLECH>>16)) #define LCTLECH ((int)(CTLECH>>16))
#define LPENDIN ((int)(PENDIN>>16)) #define LPENDIN ((int)(PENDIN>>16))
#define LDECCTQ ((int)(DECCTQ>>16))
#define LNOFLSH ((int)(NOFLSH>>16)) #define LNOFLSH ((int)(NOFLSH>>16))
#define TIOCSBRK _IO ('t', 123) /* set break bit */ #define TIOCSBRK _IO ('t', 123) /* set break bit */
#define TIOCCBRK _IO ('t', 122) /* clear break bit */ #define TIOCCBRK _IO ('t', 122) /* clear break bit */

View File

@@ -1225,13 +1225,6 @@ erasenb:
} }
} }
endcase: endcase:
/*
* If DEC-style start/stop is enabled don't restart
* output until seeing the start character.
*/
if (t_flags & DECCTQ && tp->t_state & TS_TTSTOP &&
tp->t_startc != tp->t_stopc)
return;
restartoutput: restartoutput:
tp->t_state &= ~TS_TTSTOP; tp->t_state &= ~TS_TTSTOP;
tp->t_flags &= ~FLUSHO; tp->t_flags &= ~FLUSHO;