[net.unix-wizards] Disabling Break

saf (11/18/82)

I am on a BSD 4.1 system and have a problem running 1200 baud from home.
New Jersey Bell insists on sending crackling noises to my phone which the 
modem apparently translates into <break>. This is obviously annoying as
it blows away long compiles, aborts letters and netnews, etc.

I tried to disable it by doing "stty intr u" which undefines the interrupt
character.  This does disable break (although it still echos as ^?) but
also disables "delete".  Thus, to get out of a stuck program, I have to
use ^\ which does an unwanted coredump.

There should be some way to turn off the break key without turning off
the intr function completely.  Any help/comments would be appreciated.
Once again, if anything profitable results from this inquiry, I will
post the results...
	Steve Falco (floyd!saf) BTL WH (201) 386-4865

txr.usc-cse@Usc-Ecl@sri-unix (11/25/82)

Date:         23 Nov 1982 10:28-PST
Funny you should mention it, we see this problem all the time, noise on
the lines.  The "breaks" are really framing errors, translated into
interrupts (or nulls in raw mode) by a "friendly" exec.  And if you
just pull the translation, Surprise!  getty stops working, since it
depends on the nulls for speed switching.

To make a long story short, I have a fix, a change to dh.c (and
analagously dz.c), plus some ancillary changes in tty.c and getty.c (to
enable or disable the "feature" of turning the breaks into interrupts).
I plan on packaging the fix and shipping it to Berkeley, hoping that
they will integrate it into 4.2, since it really should have more done
to make it right (changes to stty, tty(4), etc.).  [Shortly after I
installed the code here, a guest from another system asked me for the
code, so I suspect that the problem is fairly widespread -- I think the
change would be appreciated by all, especially since it can be turned
on and off.]

Tim

 

mark.umcp-cs@Udel-Relay@sri-unix (11/26/82)

From:     Mark Weiser <mark.umcp-cs@Udel-Relay>
Date:     23 Nov 82 11:28:40 EST  (Tue)
I once had a problem with a bad modem which kept thinking it had seen a 
break.  Of course, an actual BREAK is supposed to be a tug on the
transmission line for x milliseconds, which looked like a framing error
to our modem, so it had code to convert all framing errors into
whatever the DEL character.  Interestingly, in the DH device driver
for 4.1bsd, there is some #ifdef'd out code which throws away framing
errors rather than returning them as the DEL character.  Unfortunately,
recompiling to fix this means that other peoples BREAK keys will not longer
work because the framing error will not be noticed.  Oh well.  Maybe 
some of this information will be useful to you.  (It is possible that
the ifdef'ed out code has not been attached to a mode bit.  Take a look.)

chris.umcp-cs@UDel-Relay@sri-unix (11/26/82)

From:     Chris Torek <chris.umcp-cs@UDel-Relay>
Date:     23 Nov 82 15:17:55 EST  (Tue)
I was thinking about something very similar.  It turns out
that if you really want to do it, you can translate breaks
(which look like framing errors) to any character you please,
or even always send SIGINT.  (The code I've looked at is for
Berkeley 4.1BSD.)  When a framing error occurs, the device
driver does a (*cdevsw[tp->t_dev].l_rint) (tp->t_intr)
[or whatever the names are] to insert an interrupt character
into the input stream.  If it were to call the l_rint with
a minus one, and all the rint routines understood this, you
could have many "break" protocols.  I'd like to be able to
generate SIGINT with the break key even in raw mode, and this
could do it.