SUMMARY -- Remapping L1-A

From: Sheila Hollenbaugh (shollen@valhalla.cs.wright.edu)
Date: Wed Feb 26 1992 - 14:09:19 CST


Recently I posted a query as to how the abort sequencs L1-a can be
remapped in order to prevent users from easily rebooting the machine at
the least sign of trouble. (It was pointed out that recycling the power
will accomplish the same purpose, but we still were interested in
remapping L1-a.)

Here are all the solutions that were received. We are using the first
one, it appears to be working fine. I have not checked the answers for
redundency, but I have received a LOT of "me too" responses so I assume
that people are interested enough to sort through them and choose the
most appropriate. Once again, thanks to all who have responded!!!!!
-------------------------

>From erickson@laguna.ICS.UCI.EDU Fri Feb 21 17:51:55 1992
Received: from laguna.ics.uci.edu by Paris.ics.uci.edu id aa25171;
          21 Feb 92 13:50 PST
To: shollen@valhalla
Subject: Re: Disabling L1-A????
Newsgroups: comp.sys.sun.admin
References: <1992Feb21.133709.17922@cs.wright.edu>
Date: Fri, 21 Feb 92 13:50:32 -0800
From: Scott Erickson <erickson@laguna.ICS.UCI.EDU>
Message-Id: <9202211350.aa25171@Paris.ics.uci.edu>
Status: R

In comp.sys.sun.admin you write:

>We are having a problem with students using L1-A every time they think
>a workstation is not functioning properly. I know this has probably
>been answered before, but I would like to disable L1-A or at least remap
>the interrupt sequence to something people do not know well. If anyone
>out there has a summary of previous coverage or has done this, please
>email me. If a summary is desired, I will be glad to provide one.

Here's a package we use on our Lab 3/50's. The package consists of
setabort and abortkey. The command we use in our rc.local file is:

        if [ -f /usr/local/etc/setabort ] ; then
                /usr/local/etc/setabort 1 81
        fi

This sets the abort sequence to L1-g. The abortkey program turns on
and off the sequence, I belive. We set the abort to L1-g so that we
in the support group could still abort.

/se
University of California Irvine | 714/856-4035
Information and Computer Science Department | erickson@ics.uci.edu
Support Group | ucbvax!ucivax!erickson

#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of shell archive."
# Contents: Makefile abortkey.c setabort.c
# Wrapped by erickson@laguna.ics.uci.edu on Fri Feb 21 13:31:59 1992
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Makefile' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(1904 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X#############################################################################
X#
X# Makefile for setabort
X#
X# $Id: Makefile,v 1.3 1989/10/20 10:48:21 sources Exp $
X#############################################################################
X#
X# If you move this makefile, update the variable below
X# or else depend won't work.
X#############################################################################
XMAKEFILE = Makefile
XRCSDIR = ./RCS
XCC = cc
XCFILES = setabort.c abortkey.c
XOFILES = setabort.o abortkey.o
XMANFILE =
XPROGRAM = setabort
XPROGRAM2 = abortkey
X#############################################################################
X# Flags for Installation
X#############################################################################
XBINDIR = /usr/local/etc
XMANDIR =
XCURSUFFIX =
XMANSUFFIX =
X#############################################################################
X
XLIBS =
XDFLAGS =
XOPTFLAGS = -O
XLDFLAGS = -s
XCFLAGS = $(OPTFLAGS) $(DFLAGS)
XLINTFLAGS = -bchxz
X
Xall: $(PROGRAM) $(PROGRAM2)
X
X$(PROGRAM):
X $(CC) $(CFLAGS) $(LDFLAGS) $@.c -o $@ $(LIBS)
X
X$(PROGRAM2):
X $(CC) $(CFLAGS) $(LDFLAGS) $@.c -o $@ $(LIBS)
X
Xlint:
X lint $(LINTFLAGS) $(CFILES)
X
Xinstall: $(PROGRAM) $(PROGRAM2)
X install -o root -g staff -c -m 710 $(PROGRAM) $(BINDIR)
X install -o root -g staff -c -m 710 $(PROGRAM2) $(BINDIR)
X
Xinst-man: $(MANFILE)
X install -c -m 644 $(MANFILE) $(MANDIR)/`basename $(MANFILE) $(CURSUFFIX)`$(MANSUFFIX)
X
Xinst-all: install inst-man
X
XTAGS: $(CFILES)
X etags $(CFILES) > TAGS
X
Xtags: $(CFILES)
X ctags $(CFILES) > tags
X
Xcheckin:
X -@for i in $(CFILES) $(MANFILE) ; do \
X ( if test -f $$i ; then ( echo "Checking in $$i" ; ci -q $$i ) \
X ; fi ) ; done
X
Xcheckout: $(CFILES) $(MANFILE)
X
X$(CFILES) $(MANFILE):
X co -q $@
X
Xclean:
X rm -f *.o *.out *~ core $(PROGRAM) $(PROGRAM2)
X
Xclean-all: clean checkin
X rm -f tags TAGS
X
Xdepend:
X /usr/ucb/mkdep -f $(MAKEFILE) $(CFILES)
X
END_OF_FILE
if test 1904 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'abortkey.c' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'abortkey.c'\"
else
echo shar: Extracting \"'abortkey.c'\" \(1411 characters\)
sed "s/^X//" >'abortkey.c' <<'END_OF_FILE'
X/* $Id: abortkey.c,v 1.2 1989/10/20 10:47:21 sources Exp $
X */
X
X#include <sys/types.h>
X#include <sys/ioctl.h>
X#include <sundev/kbd.h>
X#include <sundev/kbio.h>
X
X
Xmain(argc, argv)
Xint argc;
Xchar *argv[];
X{
X struct kiockey key;
X int fd;
X int mode = -1,
X verb = 0;
X char **av;
X
X for (av = &argv[1]; *av ; av++ ){
X switch (av[0][0]) {
X case 'y':
X mode = 1;
X break;
X case 'n':
X mode = 0;
X break;
X case '-':
X if (av[0][1] == 'v') {
X verb = 1;
X break;
X }
X default:
X printf("unknown flag: %s\n",av[0]);
X printf("usage: %s [-v] y|n\n",argv[0]);
X exit(1);
X }
X }
X fd = open("/dev/kbd", 1);
X if (fd < 0) {
X perror("/dev/kbd");
X exit(1);
X }
X key.kio_tablemask = KIOCABORT1;
X
X ioctl( fd, KIOCGETKEY, &key); /* read abort key entry */
X
X if (key.kio_station == 0 && (verb || mode == -1))
X printf("L1-A reset sequence was disabled\n");
X else if (key.kio_station == 1 && (verb || mode == -1))
X printf("L1-A reset sequence was enabled\n");
X
X
X switch (mode) {
X case 1:
X key.kio_station = 1;
X break;
X case 0:
X key.kio_station = 0;
X break;
X default:
X exit(0);
X }
X
X ioctl(fd, KIOCSETKEY, &key); /* map it t a 'hole' in map */
X
X if (key.kio_station == 0 && verb)
X printf("L1-A reset sequence now disabled\n");
X else if (key.kio_station == 1 && verb)
X printf("L1-A reset sequence now enabled\n");
X}
END_OF_FILE
if test 1411 -ne `wc -c <'abortkey.c'`; then
    echo shar: \"'abortkey.c'\" unpacked with wrong size!
fi
# end of 'abortkey.c'
fi
if test -f 'setabort.c' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'setabort.c'\"
else
echo shar: Extracting \"'setabort.c'\" \(2856 characters\)
sed "s/^X//" >'setabort.c' <<'END_OF_FILE'
X/* $Id: setabort.c,v 1.2 1989/10/20 10:47:42 sources Exp $
X */
X#include <stdio.h>
X#include <sys/types.h>
X#include <sundev/kbio.h>
X#include <sundev/kbd.h>
X
Xstruct kiockey kiockey;
X
Xmain(argc, argv)
Xregister argc;
Xregister char *argv[];
X
X{
X register fd, key1, key2;
X int mode; /* 0: set to L1-A, 1: set to key1 key2, 2: disable */
X int was_set = 0,
X verb = 0;
X char *prog;
X
X prog = argv[0];
X if (strcmp(argv[1],"-v") == 0) {
X verb = 1;
X argc--;
X argv++;
X }
X
X if (argc > 3 || argc < 2) {
X printf("usage: %s [-v] touche1 touche2\n",prog);
X printf(" or: %s [-v] std | off\n",prog);
X exit(1);
X }
X
X if ((fd = open("/dev/kbd", 2)) < 0) {
X perror("/dev/kbd");
X exit(1);
X }
X if (argc == 3) {
X key1 = atoi(argv[1]);
X key2 = atoi(argv[2]);
X mode = 1;
X if (key1 < 0 || key1 > 127 || key2 < 0 || key2 > 127) {
X printf("%s: INVALID KEY: key stations must be in range 0-127\n",prog);
X close(fd);
X exit(1);
X }
X } else if ( strcmp("std", argv[1]) == 0)
X mode = 0;
X else if (strcmp("off", argv[1]) == 0)
X mode = 2;
X else {
X printf("usage: %s [-v] touche1 touche2\n",prog);
X printf(" or: %s [-v] std | off\n",prog);
X exit(1);
X }
X
X
X kiockey.kio_tablemask = KIOCABORT1;
X
X ioctl( fd, KIOCGETKEY, &kiockey); /* read abort key entry */
X
X if (kiockey.kio_station == 0) {
X if (verb)
X printf("Abort sequence was disabled\n");
X }
X else {
X was_set = 1;
X if (verb)
X printf("Abort sequence was enabled and set to %d",
X kiockey.kio_station);
X }
X
X switch (mode) {
X case 0:
X kiockey.kio_station = 0x01;
X break;
X case 1:
X kiockey.kio_station = key1;
X break;
X case 2:
X kiockey.kio_station = 0x00;
X break;
X
X }
X if (ioctl(fd, KIOCSETKEY, &kiockey) < 0) {
X perror("kbd: KIOCSETKEY: KIOCABORT1:");
X close(fd);
X exit(1);
X }
X
X kiockey.kio_tablemask = KIOCABORT2;
X
X if (was_set == 1) {
X ioctl( fd, KIOCGETKEY, &kiockey); /* read abort key entry */
X if (verb)
X printf(" %d\n", kiockey.kio_station);
X }
X
X switch (mode) {
X case 0:
X kiockey.kio_station = 0x4d;
X break;
X case 1:
X kiockey.kio_station = key2;
X break;
X case 2:
X kiockey.kio_station = 0x00;
X break;
X
X }
X if (ioctl(fd, KIOCSETKEY, &kiockey) < 0) {
X perror("kbd: KIOCSETKEY: KIOCABORT2:");
X close(fd);
X exit(1);
X }
X
X
X kiockey.kio_tablemask = KIOCABORT1;
X ioctl( fd, KIOCGETKEY, &kiockey); /* read abort key entry */
X
X if (kiockey.kio_station == 0) {
X if (verb)
X printf("Abort sequence disabled\n");
X }
X else {
X if (verb)
X printf("Abort sequence enabled and set to %d",
X kiockey.kio_station);
X kiockey.kio_tablemask = KIOCABORT2;
X ioctl( fd, KIOCGETKEY, &kiockey); /* read abort key entry */
X if (verb)
X printf(" %d\n", kiockey.kio_station);
X }
X close(fd);
X exit(0);
X}
END_OF_FILE
if test 2856 -ne `wc -c <'setabort.c'`; then
    echo shar: \"'setabort.c'\" unpacked with wrong size!
fi
# end of 'setabort.c'
fi
echo shar: End of shell archive.
exit 0

>From richard@borneo Mon Feb 24 08:25:36 1992
Received: from borneo.gmd.de (borneo) by gmdzi.gmd.de with SMTP id AA04027
  (5.65c/IDA-1.4.4 for <shollen@valhalla.cs.wright.edu>); Mon, 24 Feb 1992 14:25:11 +0100
Received: by borneo.gmd.de id AA04629; Mon, 24 Feb 92 14:25:21 +0100
Date: Mon, 24 Feb 92 14:25:21 +0100
From: richard@borneo (Richard Czech)
Message-Id: <9202241325.AA04629@borneo.gmd.de>
Received: by hawaii.gmd.de id AA06095; Mon, 24 Feb 92 14:25:22 +0100
To: shollen@valhalla (Sheila Hollenbaugh)
Reply-To: czech@gmdzi.gmd.de
Subject: Re: Disabling L1-A????
Status: R

Hi Sheila!

In article <1992Feb21.133709.17922@cs.wright.edu> you write:
>We are having a problem with students using L1-A every time they think
>a workstation is not functioning properly.

I didn't tell anybody here in our institute about L1-A, but somebody
heared something about it. The result was that some people press L1-A
because the machine gives an error message after they typed something
wrong...

Take a look at the attached program. It was posted a while ago in the news.
If you invoke it the L1-A sequence will be disabled. I installed this little
program into rc.local.

There only one problem with it: If the machine really hangs and you can't
do anything you have to pull the power switch.

= ============================== l1a.c ================================
/*
 * The reset sequence disable program.
 */
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sundev/kbd.h>
#include <sundev/kbio.h>

main()
{
  struct kiockey key ;
  int fd ;
  int z,i ;

  fd = open( "/dev/kbd", 1 ) ;
  if( fd < 0 ) {
    perror("Open") ;
    exit( 1 ) ;
  }
  key.kio_tablemask = KIOCABORT1 ;
  ioctl( fd, KIOCGETKEY, &key ) ; /* read abort key entry */
  if (key.kio_station == 0)
    printf("L1-A reset sequence already disabled\n");
  else if (key.kio_station == 1)
    printf("L1-A reset sequence enabled\n");
  key.kio_station = 0 ;
  ioctl( fd, KIOCSETKEY, &key ) ; /* map it to a 'hole' in map */
  ioctl( fd, KIOCGETKEY, &key ) ; /* verify the change */
  if (key.kio_station == 0)
    printf("L1-A reset sequence disabled\n");
  else if (key.kio_station == 1)
    printf("L1-A reset sequence still enabled\n");
}
= ========================================================================

----------------------------------------------------------------------
        Richard Czech e-mail: richard@borneo.gmd.de
          GMD-E.I.S.
        P.O.Box 13 16 phone: (+49) 2241 14 2039
D-5205 St. Augustin 1, Germany fax: (+49) 2241 14 2342
----------------------------------------------------------------------
Hey, I am the signature virus. Copy me into your .sig, help me spread!

>From nishino@tdo.sps.mot.com Sun Feb 23 21:55:59 1992
Received: from spsgate.sps.mot.com by relay1.UU.NET with SMTP
        (5.61/UUNET-internet-primary) id AA25724; Sun, 23 Feb 92 21:55:44 -0500
Received: by spsgate.sps.mot.com (4.1/SMI-4.1)
        id AA26527; Sun, 23 Feb 92 19:54:39 MST
Received: from tdo.tdo.sps.mot.com (tdo.sps.mot.com) by motsps (4.1/SMI-4.0)
        id AA26765; Sun, 23 Feb 92 19:46:53 MST
Received: by tdo.tdo.sps.mot.com (4.1/6.4J-motj3.7)
        id AA02189; Mon, 24 Feb 92 11:46:37 JST
Date: Mon, 24 Feb 92 11:46:37 JST
From: nishino@tdo.sps.mot.com (NISHINO-Kazuyuki)
Message-Id: <9202240246.AA02189@tdo.tdo.sps.mot.com>
To: shollen@valhalla
Subject: Re: Disabling L1-A????
Newsgroups: comp.sys.sun.admin
In-Reply-To: <1992Feb21.133709.17922@cs.wright.edu>
Organization: Nippon MOTOROLA Ltd. Tokyo, Japan
Cc:
Status: RO

In article <1992Feb21.133709.17922@cs.wright.edu> you write:
>I would like to disable L1-A or at least remap
>the interrupt sequence to something people do not know well.

 Please try following program. This program change abort sequence to 'L3+R5'.
But, anyone can read/change abort sequence. This program is not so strong
efftct.

/*
        special_setup.c $Revision: 1.1 $
        $Date: 1991/02/07 14:56:31 $ $Author: nishino $
*/

#include <stdio.h>
#include <sys/types.h>
#include <sys/file.h>
#include <sundev/kbio.h>
#include <sundev/kbd.h>

struct kiockey key;
int fd;

main()
{
        if ((fd = open("/dev/kbd", O_RDWR)) == -1)
                exit (9);

        key.kio_tablemask = KIOCABORT1;
        key.kio_station = 0x19;
        ioctl(fd, KIOCSETKEY, &key);

        key.kio_tablemask = KIOCABORT2;
        key.kio_station = 0x2e;
        ioctl(fd, KIOCSETKEY, &key);

        exit (0);
}

---
/*   NISHINO-kazuyuki / NIPPON MOTOROLA Ltd.  Tokyo Design Operations	*/
/*   nishino@tdo.sps.mot.com						*/
/*   nishino@tdo.sps.mot-j.co.jp (domestic only)			*/
/*   nishino@buttercup.e-tokyo.prug.or.jp (home)			*/

>From besancon@titus.polytechnique.fr Sun Feb 23 17:10:43 1992 Received: from poly.polytechnique.fr by chenas.inria.fr (5.65c8d/91.12.15) via Fnet-EUnet id AA09522; Sun, 23 Feb 1992 23:10:29 +0100 (MET) Received: by poly.polytechnique.fr (5.57/Ultrix3.0-C) id AA21159; Sun, 23 Feb 92 23:11:44 +0100 Received: by titus (4.0/Sun-4.0) id AA07453; Sun, 23 Feb 92 23:10:18 +0100 Date: Sun, 23 Feb 92 23:10:18 +0100 From: besancon@titus.polytechnique.fr (Thierry Besancon) Message-Id: <9202232210.AA07453@titus> Organization: LIX, Laboratoire d'Informatique de l'Ecole Polytechnique Ecole Polytechnique, 91128 Palaiseau Cedex, France tel: 69 33 34 85; fax: 69 33 30 14 To: shollen@valhalla Subject: L1A Status: RO

Hello from France,

I've juste read in the news you got problems with students using "L1A". Here are two C programs: "disable.c" suppresses the abort sequence whereas "enable.c" installs the abort sequence YOU want (though it must always be a 2 keystroke sequence). You must run one of these 2 programs each times you reboot the system if, of course, you want them activated. I personally run "enable" in /etc/rc.local and have rebound the abort sequence to "R1Z"...

Enjoy this, Thierry Besancon. -------------------- disable.c ---------------------- /* * disable.c disable kbd abort sequence */ #include <stdio.h> #include <sys/types.h> #include <sys/file.h> #include <sys/ioctl.h> #include <sundev/kbd.h> #include <sundev/kbio.h> #define setkey(a,b) ioctl(a,KIOCSETKEY,key)

main(argc, argv) int argc; int *argv[]; { struct kiockey keytable; register int console; register struct kiockey *key = &keytable; if ((console = open("/dev/kbd", O_RDONLY, 0)) <0) { perror("open()"); exit(1); } /* * First key in abort sequence. Set value of kio_station to * kbd location from kb(4). */ keytable.kio_station = 0; keytable.kio_tablemask = KIOCABORT1; keytable.kio_entry = 0xBE; keytable.kio_string[0] = 0; if (setkey(console, key) == -1) { perror("setkey()"); exit(1); } /* * Second key in abort sequence. Set value of kio_station to * kbd location from kb(4). */ keytable.kio_station = 0; keytable.kio_tablemask = KIOCABORT2; keytable.kio_entry = 0xBF; keytable.kio_string[0] = 0; if (setkey(console, key) == -1) { perror("setkey()"); exit(1); } } -------------------- disable.c ---------------------- /* * enable.c enable kbd abort sequence */ #include <stdio.h> #include <sys/types.h> #include <sys/file.h> #include <sys/ioctl.h> #include <sundev/kbd.h> #include <sundev/kbio.h> #define setkey(a,b) ioctl(a,KIOCSETKEY,key)

main(argc, argv) int argc; int *argv[]; { struct kiockey keytable; register int console; register struct kiockey *key = &keytable; if ((console = open("/dev/kbd", O_RDONLY, 0)) <0) { perror("open()"); exit(1); } /* * First key in abort sequence. Set value of kio_station to * kbd location from kb(4). */ keytable.kio_station = 0x01; keytable.kio_tablemask = KIOCABORT1; keytable.kio_entry = 0xBE; keytable.kio_string[0] = 0; if (setkey(console, key) == -1) { perror("setkey()"); exit(1); } /* * Second key in abort sequence. Set value of kio_station to * kbd location from kb(4). */ keytable.kio_station = 0x4D; keytable.kio_tablemask = KIOCABORT2; keytable.kio_entry = 0xBF; keytable.kio_string[0] = 0; if (setkey(console, key) == -1) { perror("setkey()"); exit(1); } }

>From dbm@mosaic.uncc.edu Sun Feb 23 14:58:16 1992 Received: from mosaic.uncc.edu by mcnc.mcnc.org (5.59/MCNC/6-25-91) id AA10089; Sun, 23 Feb 92 14:58:10 -0500 for shollen@cs.wright.edu Received: from ws1.uncc.edu by mosaic.uncc.edu (4.1/SMI-4.1) id AA04948; Sun, 23 Feb 92 14:58:08 EST Date: Sun, 23 Feb 92 14:58:08 EST From: dbm@mosaic.uncc.edu (dwayne mcneil) Message-Id: <9202231958.AA04948@mosaic.uncc.edu> To: shollen@valhalla Subject: L1A remap Status: RO

Per your recent request on some Sun mailing list or newsgroup (I forget which one...), attached is a short program which remaps the L1A abort sequence. I didn't write it... A guy at Sun gave it to me, and it's worked fine for us.

We put this in /etc/rc.local and enable a PROM password, so if users turn off the system, it will be out of commission until our workstation guy's reboot it.

Also note you can enable the kill sequence in OW3, L1-ALT-DEL I believe, so the user can unhang him/her self.

Good Luck... Dwayne

BTW: What is hanging your workstations?

---- /* * l1a.c * * Program to remap L1A to something else. For UNCC, we remap the keys * to non-existant keys. * * I don't know who orig wrote this (Janice? Jackson?). It was provided * to us by a guy at Sun. - Dwayne Mcneil. */

/* * Here's a program (courtesy of Jackson Wong) to change the ABORT1 * and ABORT2 keys (L1-A) to two different keys. If you wanted to disable * this completely, you could map these to non-existant key stations. * (Anything that says "HOLE" under the KB(4S) manpage tables). * Janice */

/* * move_abort.c * * The following program is an example on how to move the system * two-key abort sequence to somewhere else on the keyboard. * See the manual section under KB(4S) for more detail. * If you need to reset your keyboard to default, you can reboot * your system. * * Note: This program does not need to be run setuid-root. * (major security problem) * -jackson */

#include <stdio.h> #include <sys/types.h> #include <sys/file.h> #include <sys/ioctl.h> #include <sundev/kbd.h> #include <sundev/kbio.h>

main(argc, argv) int argc; char *argv[]; { struct kiockey keytable; struct kiockey *key; int keyboard;

if ((keyboard = open("/dev/kbd", O_RDONLY, 0)) < 0) { printf("can't open /dev/kbd \n"); perror("move_abort"); return; }

/* move first abort key to "no" key */ keytable.kio_tablemask = KIOCABORT1; key = &keytable; key->kio_station = 0 ; /* 0x4D */ if (setkey(keyboard, key) == -1) { perror("move_abort: KIOCABORT1"); }

/* move second abort key to "d" key */ keytable.kio_tablemask = KIOCABORT2; key = &keytable; key->kio_station = 79; /* 0x4F */ if (setkey(keyboard, key) == -1) { perror("move_abort: KIOCABORT2"); }

}

setkey(keyboard, kk) int keyboard; struct kiockey *kk; { return((ioctl((keyboard), KIOCSETKEY, kk))); }

>From Shane.Sigler@Eng.Sun.COM Fri Feb 21 21:07:33 1992 Received: from Eng.Sun.COM (zigzag-bb.Corp.Sun.COM) by Sun.COM (4.1/SMI-4.1) id AA21484; Fri, 21 Feb 92 18:07:25 PST Received: from fullbore.Eng.Sun.COM by Eng.Sun.COM (4.1/SMI-4.1) id AA15719; Fri, 21 Feb 92 18:07:39 PST Received: by fullbore.Eng.Sun.COM (4.1/SMI-4.1) id AA04066; Fri, 21 Feb 92 18:07:29 PST Date: Fri, 21 Feb 92 18:07:29 PST Message-Id: <9202220207.AA04066@fullbore.Eng.Sun.COM> To: shollen@valhalla Subject: Re: Disabling L1-A???? From: Shane.Sigler@Eng.Sun.COM (Shane Sigler) Status: RO

Sheila, I have a C program that some else wrote that will disable the L1-A key on a Sun, if you want I can send you the C code or the compiled program.

Shane Sigler System Support Specialist

In article 17922@cs.wright.edu, shollen@valhalla.cs.wright.edu (Sheila Hollenbaugh) writes: > >We are having a problem with students using L1-A every time they think >a workstation is not functioning properly. I know this has probably >been answered before, but I would like to disable L1-A or at least remap >the interrupt sequence to something people do not know well. If anyone >out there has a summary of previous coverage or has done this, please >email me. If a summary is desired, I will be glad to provide one. > >Thanks!! >-- >Sheila Hollenbaugh Computer Systems Engineer >Wright State University Department of Computer Science & Engineering >3171 Research Blvd., Kettering, OH 45420 (513) 259-1384 >shollen@cs.wright.edu or shollen@valhalla.cs.wright.edu

>From setzer@math.ncsu.edu Mon Feb 24 11:37:18 1992 Received: from math.ncsu.edu by ncsuvx.ncsu.edu (5.65b/2 4/27/87) id AA10968; Mon, 24 Feb 92 11:36:31 -0500 Received: by math.ncsu.edu (4.1/SAM 07-20-90 10:07:54/m) id AA00320; Mon, 24 Feb 92 11:36:22 EST Date: Mon, 24 Feb 92 11:36:22 EST From: setzer@math.ncsu.edu (William Setzer) Posted-Date: Mon, 24 Feb 92 11:36:22 EST Message-Id: <9202241636.AA00320@math.ncsu.edu> To: shollen@valhalla (Sheila Hollenbaugh) In-Reply-To: shollen@valhalla.cs.wright.edu's message of 21 Feb 92 13:37:09 GMT Subject: Disabling L1-A???? Status: R

: We are having a problem with students using L1-A every time they think : a workstation is not functioning properly.

Here's something I wrote to do "everything you've ever wanted to do with L1-A". It's not "distributable"-level code or anything, but it should be able to do what you want. Comments, flames, and improvements are welcome.

William

PS: BTP stands for "break to prom".

8<-8<-8<-8<- Cut 8<-8<-8<-8<- #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 1 (of 1)." # Contents: Makefile README btp.c keymap.c.type3 keymap.c.type4 # keymap.h makekeymap # Wrapped by setzer@math.ncsu.edu on Mon Feb 24 11:35:13 1992 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Makefile'\" else echo shar: Extracting \"'Makefile'\" \(87 characters\) sed "s/^X//" >'Makefile' <<'END_OF_FILE' XCFLAGS=-g X XOBJS=btp.o keymap.o X Xall: $(OBJS) X cc -o btp $(OBJS) X Xkeymap.c: X makekeymap END_OF_FILE if test 87 -ne `wc -c <'Makefile'`; then echo shar: \"'Makefile'\" unpacked with wrong size! fi # end of 'Makefile' fi if test -f 'README' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'README'\" else echo shar: Extracting \"'README'\" \(1226 characters\) sed "s/^X//" >'README' <<'END_OF_FILE' XCongratulations! You're now the proud owner of `btp', a program to do Xeverything you've ever wanted to do to the "break to prom" key Xsequence (L1-A). This code has been lightly tested under SunOS 4.1.1, Xand appears to work OK. X XThe only weird configuration problem is with the file `keymap.c'. The Xprogram `makekeymap' uses the output of `dumpkeys' to see what each Xkey does, and sets up `keymap.c' appropriately. I've included a X`keymap.c' for type 3 and type 4 keyboards though, so you probably Xwon't need to worry about it. If you have a different type of Xkeyboard, mail me and I'll see if I can remember what everything in X`keymap.c' means. X XIf you try to set your BTP key sequence to a "bad" value, `btp' will Xcomplain and exit, but you can override this behavior. I haven't Xactually tested all the "bad" configurations to see if they're "bad" X-- the warnings are from a theoretical standpoint. So feel free to Xset your BTP key sequence to `Control-C'. :-) X XThis code certainly isn't "distributable" quality, but it's good enough Xto be useful. I haven't written a man page or anything, but a quick Xperusal through the code should get you going. Comments, flames, and Ximprovements are welcome. Enjoy. X X XWilliam END_OF_FILE if test 1226 -ne `wc -c <'README'`; then echo shar: \"'README'\" unpacked with wrong size! fi # end of 'README' fi if test -f 'btp.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'btp.c'\" else echo shar: Extracting \"'btp.c'\" \(4072 characters\) sed "s/^X//" >'btp.c' <<'END_OF_FILE' X#include <stdio.h> X#include <ctype.h> X#include <string.h> X#include <varargs.h> X#include <errno.h> X#include <fcntl.h> X#include <sys/types.h> X#include <sundev/kbio.h> X#include <sundev/kbd.h> X#include "keymap.h" X Xint BtpFd = -1; X Xvoid BtpFatal(va_alist) Xva_dcl X{ X va_list args; X char *fmt; X char buf[512]; X X va_start(args); X fmt = va_arg(args, char *); X vprintf(fmt, args); X va_end(args); X X if (BtpFd >= 0) X close(BtpFd); X exit(1); X} X X Xchar *usage[] = X{ X "Usage: btp <option>\n", X " Where <option> is one of:\n", X " q[uery] prints current BTP setting\n", X " d[efault] sets BTP back to L1-A\n", X " o[ff] disables BTP\n", X " l[ist] lists possible keys by name and station\n", X " [#]key1 [#]key2 [f] sets BTP to key1-key2\n\n", X " `#' means that key is a station number rather than a name\n", X " `f' means set BTP to keys even though program thinks it's a bad idea\n", X NULL, X}; X Xvoid BtpUsage() X{ X char **ptr; X X ptr = &usage[0]; X while (*ptr) X printf(*ptr++); X X BtpFatal(""); X} X Xvoid BtpListKeyNames() X{ X int i; X X for (i = 0; keyMap[i].name; i++) X { X printf("%3d) %10s ", i, keyMap[i].name); X if (i % 4 == 3) X printf("\n"); X } X} X Xint BtpNameToStation(str) Xchar *str; X{ X register int i; X X for (i = 0; keyMap[i].name; i++) X if (!strcmp(str, keyMap[i].name)) X break; X X if (keyMap[i].name) X return i; X BtpFatal("Unknown key name <%s>\n", str); X} X Xvoid BtpSanityCheck(key, force) Xint key, force; X{ X if (key < 0 || key > 127) X BtpFatal("<%d> is out of range (0-127).\n", key); X X switch (keyMap[key].type) X { X case MOD: X printf("<%d (%s)> is a modifier key.\n", key, keyMap[key].name); X break; X case NONE: X printf("<%d> is a `null' key. It will disable BTP.\n", key); X printf("`btp off' would be better if that's what you intend.\n"); X break; X case RESERVED: X printf("<%d (%s)> is reserved.\n", key, keyMap[key].name); X break; X case UNKNOWN: X printf("I don't know what <%d> is.\n", key); X break; X case OK: X return; X break; X default: X BtpFatal("Internal sanity check error.\n"); X } X if (force) X printf("Continuing anyway...\n"); X else X BtpFatal(""); X} X Xvoid BtpQuery(fd) Xint fd; X{ X struct kiockeymap kiockey1, kiockey2; X int key1, key2; X X kiockey1.kio_tablemask = KIOCABORT1; X kiockey2.kio_tablemask = KIOCABORT2; X ioctl(BtpFd, KIOCGKEY, &kiockey1); X ioctl(BtpFd, KIOCGKEY, &kiockey2); X key1 = kiockey1.kio_station; X key2 = kiockey2.kio_station; X if (keyMap[key1].type == NONE) X printf("BTP key sequence is disabled\n"); X else X printf("BTP key sequence is set to #%d-#%d (%s-%s)\n", key1, key2, X keyMap[key1].name, keyMap[key2].name); X} X Xvoid BtpSet(key1, key2) Xint key1, key2; X{ X struct kiockeymap kiockey1, kiockey2; X X kiockey1.kio_tablemask = KIOCABORT1; X kiockey2.kio_tablemask = KIOCABORT2; X kiockey1.kio_station = key1; X kiockey2.kio_station = key2; X ioctl(BtpFd, KIOCSKEY, &kiockey1); X ioctl(BtpFd, KIOCSKEY, &kiockey2); X} X Xmain(argc, argv) Xint argc; char **argv; X{ X int key1, key2, force; X extern char *sys_errlist[]; X X if ((BtpFd = open("/dev/kbd", O_RDWR)) < 0) X BtpFatal("Couldn't open /dev/kbd: %s", sys_errlist[errno]); X X if (argc == 2) X switch (*argv[1]) X { X case 'd': BtpSet(L1_KEY, A_KEY); break; X case 'l': BtpListKeyNames(); break; X case 'o': BtpSet(NONE_KEY, NONE_KEY); break; X case 'q': /* done below */ break; X default: BtpUsage(); break; X } X else if (argc == 3 || argc == 4) X { X X#define IsNumericArgv(X) (argv[X][0] == '#' && isdigit(argv[X][1])) X X force = (argc == 4 && argv[3][0] == 'f'); X key1 = (IsNumericArgv(1) ? atoi(argv[1]+1) : BtpNameToStation(argv[1])); X key2 = (IsNumericArgv(2) ? atoi(argv[2]+1) : BtpNameToStation(argv[2])); X BtpSanityCheck(key1, force); X BtpSanityCheck(key2, force); X BtpSet(key1, key2); X } X else X BtpUsage(); X X BtpQuery(); X close(BtpFd); X} END_OF_FILE if test 4072 -ne `wc -c <'btp.c'`; then echo shar: \"'btp.c'\" unpacked with wrong size! fi # end of 'btp.c' fi if test -f 'keymap.c.type3' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'keymap.c.type3'\" else echo shar: Extracting \"'keymap.c.type3'\" \(1608 characters\) sed "s/^X//" >'keymap.c.type3' <<'END_OF_FILE' X/* This file is generated automatically. X * Make sure you know what you're doing if you edit it. */ X#include "keymap.h" Xstruct keymapinfo keyMap[] = { X"none", NONE, X"L1", OK, X"none", NONE, X"L2", OK, X"none", NONE, X"F1", OK, X"F2", OK, X"none", NONE, X"F3", OK, X"none", NONE, X"F4", OK, X"none", NONE, X"F5", OK, X"none", NONE, X"F6", OK, X"none", NONE, X"F7", OK, X"F8", OK, X"F9", OK, X"alt", MOD, X"none", NONE, X"R1", OK, X"R2", OK, X"R3", OK, X"none", NONE, X"L3", OK, X"L4", OK, X"none", NONE, X"none", NONE, X"ESC", OK, X"1", OK, X"2", OK, X"3", OK, X"4", OK, X"5", OK, X"6", OK, X"7", OK, X"8", OK, X"9", OK, X"0", OK, X"-", OK, X"=", OK, X"`", OK, X"BS", OK, X"none", NONE, X"R4", OK, X"R5", OK, X"R6", OK, X"none", NONE, X"L5", OK, X"none", NONE, X"L6", OK, X"none", NONE, X"TAB", OK, X"q", OK, X"w", OK, X"e", OK, X"r", OK, X"t", OK, X"y", OK, X"u", OK, X"i", OK, X"o", OK, X"p", OK, X"[", OK, X"]", OK, X"DEL", OK, X"none", NONE, X"R7", OK, X"uparrow", OK, X"R9", OK, X"none", NONE, X"L7", OK, X"L8", OK, X"none", NONE, X"none", NONE, X"leftctrl", MOD, X"a", OK, X"s", OK, X"d", OK, X"f", OK, X"g", OK, X"h", OK, X"j", OK, X"k", OK, X"l", OK, X";", OK, X"\'", OK, X"\\", OK, X"RET", OK, X"none", NONE, X"leftarrow", OK, X"R11", OK, X"rightarrow", OK, X"none", NONE, X"L9", OK, X"none", NONE, X"L10", OK, X"none", NONE, X"leftshift", MOD, X"z", OK, X"x", OK, X"c", OK, X"v", OK, X"b", OK, X"n", OK, X"m", OK, X",", OK, X".", OK, X"/", OK, X"rightshift", MOD, X"LFD", OK, X"R13", OK, X"downarrow", OK, X"R15", OK, X"none", NONE, X"none", NONE, X"none", NONE, X"none", NONE, X"capslock", MOD, X"meta", MOD, X"'", OK, X"meta", MOD, X"none", NONE, X"none", NONE, X"none", NONE, X"error", RESERVED, X"idle", RESERVED, X0,0 }; END_OF_FILE if test 1608 -ne `wc -c <'keymap.c.type3'`; then echo shar: \"'keymap.c.type3'\" unpacked with wrong size! fi # end of 'keymap.c.type3' fi if test -f 'keymap.c.type4' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'keymap.c.type4'\" else echo shar: Extracting \"'keymap.c.type4'\" \(1584 characters\) sed "s/^X//" >'keymap.c.type4' <<'END_OF_FILE' X/* This file is generated automatically. X * Make sure you know what you're doing if you edit it. */ X#include "keymap.h" Xstruct keymapinfo keyMap[] = { X"none", NONE, X"L1", OK, X"none", NONE, X"L2", OK, X"none", NONE, X"F1", OK, X"F2", OK, X"F10", OK, X"F3", OK, X"F11", OK, X"F4", OK, X"F12", OK, X"F5", OK, X"altgraph", MOD, X"F6", OK, X"none", NONE, X"F7", OK, X"F8", OK, X"F9", OK, X"alt", MOD, X"none", NONE, X"R1", OK, X"R2", OK, X"R3", OK, X"none", NONE, X"L3", OK, X"L4", OK, X"none", NONE, X"none", NONE, X"ESC", OK, X"1", OK, X"2", OK, X"3", OK, X"4", OK, X"5", OK, X"6", OK, X"7", OK, X"8", OK, X"9", OK, X"0", OK, X"-", OK, X"=", OK, X"`", OK, X"BS", OK, X"none", NONE, X"R4", OK, X"R5", OK, X"R6", OK, X"B13", OK, X"L5", OK, X"B10", OK, X"L6", OK, X"none", NONE, X"TAB", OK, X"q", OK, X"w", OK, X"e", OK, X"r", OK, X"t", OK, X"y", OK, X"u", OK, X"i", OK, X"o", OK, X"p", OK, X"[", OK, X"]", OK, X"DEL", OK, X"compose", MOD, X"R7", OK, X"uparrow", OK, X"R9", OK, X"B15", OK, X"L7", OK, X"L8", OK, X"none", NONE, X"none", NONE, X"leftctrl", MOD, X"a", OK, X"s", OK, X"d", OK, X"f", OK, X"g", OK, X"h", OK, X"j", OK, X"k", OK, X"l", OK, X";", OK, X"\'", OK, X"\\", OK, X"RET", OK, X"B11", OK, X"leftarrow", OK, X"R11", OK, X"rightarrow", OK, X"B8", OK, X"L9", OK, X"none", NONE, X"L10", OK, X"numlock", MOD, X"leftshift", MOD, X"z", OK, X"x", OK, X"c", OK, X"v", OK, X"b", OK, X"n", OK, X"m", OK, X",", OK, X".", OK, X"/", OK, X"rightshift", MOD, X"LFD", OK, X"R13", OK, X"downarrow", OK, X"R15", OK, X"none", NONE, X"none", NONE, X"none", NONE, X"L16", OK, X"capslock", MOD, X"meta", MOD, X"'", OK, X"meta", MOD, X"none", NONE, X"none", NONE, X"B14", OK, X"error", RESERVED, X"idle", RESERVED, X0,0 }; END_OF_FILE if test 1584 -ne `wc -c <'keymap.c.type4'`; then echo shar: \"'keymap.c.type4'\" unpacked with wrong size! fi # end of 'keymap.c.type4' fi if test -f 'keymap.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'keymap.h'\" else echo shar: Extracting \"'keymap.h'\" \(189 characters\) sed "s/^X//" >'keymap.h' <<'END_OF_FILE' Xstruct keymapinfo X{ X char *name; X int type; X}; X Xenum {OK, MOD, NONE, RESERVED, UNKNOWN}; X X#define L1_KEY 1 X#define A_KEY 77 X#define NONE_KEY 0 X Xextern struct keymapinfo keyMap[]; END_OF_FILE if test 189 -ne `wc -c <'keymap.h'`; then echo shar: \"'keymap.h'\" unpacked with wrong size! fi # end of 'keymap.h' fi if test -f 'makekeymap' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'makekeymap'\" else echo shar: Extracting \"'makekeymap'\" \(1417 characters\) sed "s/^X//" >'makekeymap' <<'END_OF_FILE' X#!/home/local/bin/perl X X@keys=`dumpkeys`; X Xopen (KM, ">keymap.c") || die "Can't open 'keymap.c'!"; Xselect(KM); Xprint "/* This file is generated automatically.\n"; Xprint " * Make sure you know what you're doing if you edit it. */\n"; Xprint "#include \"keymap.h\"\n"; Xprint "struct keymapinfo keyMap[] = {\n"; X Xfor (@keys) X{ X X if (/error/) { print qq|"error", RESERVED|; } X elsif (/idle/) { print qq|"idle", RESERVED|; } X elsif (/hole/) { print qq|"none", NONE|; } X elsif (/base (.) /) { print qq|"$1", OK|; } X elsif (/\^\[/) { print qq|"ESC", OK|; } X elsif (/lf.(\d+)/) { print qq|"L$1", OK|; } X elsif (/rf.(\d+)/) { print qq|"R$1", OK|; } X elsif (/tf.(\d+)/) { print qq|"F$1", OK|; } X elsif (/bf.(\d+)/) { print qq|"B$1", OK|; } X elsif (/compose/) { print qq|"compose", MOD|; } X elsif (/\+system/) { print qq|"L1", OK|; } X elsif (/\+home/) { print qq|"home", OK|; } X elsif (/\+meta/) { print qq|"meta", MOD|; } X elsif (/\+(\w+arrow)/){ print qq|"$1", OK|; } X elsif (/\+(\w+)/) { print qq|"$1", MOD|; } X elsif (/\\177/) { print qq|"DEL", OK|; } X elsif (/\\n/) { print qq|"LFD", OK|; } X elsif (/\\r/) { print qq|"RET", OK|; } X elsif (/\\t/) { print qq|"TAB", OK|; } X elsif (/\\b/) { print qq|"BS", OK|; } X elsif (/'\\(.)/) { print qq|"\\$1", OK|; } X else { print qq|"unknown", UNKNOWN|; } X X print ",\n"; X} Xprint "0,0 };\n"; Xclose(KM); X END_OF_FILE if test 1417 -ne `wc -c <'makekeymap'`; then echo shar: \"'makekeymap'\" unpacked with wrong size! fi chmod +x 'makekeymap' # end of 'makekeymap' fi echo shar: End of archive 1 \(of 1\). cp /dev/null ark1isdone MISSING="" for I in 1 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have the archive. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0

>From <@rock.db.toronto.edu:jdd@db.toronto.edu> Mon Feb 24 13:30:56 1992 Received: by rock.db.toronto.edu via suspension id <9048>; Mon, 24 Feb 1992 13:30:38 -0500 Received: by rock.db.toronto.edu id <9047>; Mon, 24 Feb 1992 13:06:59 -0500 From: John DiMarco <jdd@db.toronto.edu> To: shollen@valhalla Subject: Re: Disabling L1-A???? Newsgroups: comp.sys.sun.admin References: <1992Feb21.133709.17922@cs.wright.edu> Message-Id: <92Feb24.130659est.9047@rock.db.toronto.edu> Date: Mon, 24 Feb 1992 13:06:50 -0500 Status: R

In comp.sys.sun.admin you write:

>We are having a problem with students using L1-A every time they think >a workstation is not functioning properly. I know this has probably >been answered before, but I would like to disable L1-A or at least remap >the interrupt sequence to something people do not know well. If anyone >out there has a summary of previous coverage or has done this, please >email me. If a summary is desired, I will be glad to provide one.

Yes, it's possible: adb your kernel as follows:

#! /bin/sh # Patch to disable the BREAK key and L1-A in one fell swoop adb -w -k /vmunix /dev/mem << EOF montrap?w0x4e75 montrap/w0x4e75 EOF

However, you probably don't want to do this, since users will just powercycle the machine instead. That's worse!

John -- John DiMarco jdd@cdf.toronto.edu Computing Disciplines Facility Systems Manager jdd@cdf.utoronto.ca University of Toronto EA201B,(416)978-1928

-- Sheila Hollenbaugh Computer Systems Engineer Wright State University Department of Computer Science & Engineering 3171 Research Blvd., Kettering, OH 45420 (513) 259-1384 shollen@cs.wright.edu or shollen@valhalla.cs.wright.edu



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:36 CDT