From: larroze@cli00pa.edf.fr (A. LARROZE)
Newsgroups: comp.unix.admin
Subject: Re: How to control/disable the L1-A key sequence for Sun/Sparc ?
Date: 8 Apr 92 08:15:51 GMT
Reply-To: larroze@cli00pa.edf.fr (A. LARROZE)
Organization: Electricite de France, DER, Clamart FRANCE


Here are 2 programs that allow you to 'control' the L1-A key sequence.
They come from .... I don't remember, thanks to the author :-)

The first one is : offL1a.c to inhibit the key,
the second one is onL1a.c to restore it.

No problem to compile them in Sun/Sparc running SUN OS 4.1.1

	cc -o offL1a offL1a.c
	cc -o onL1a onL1a.c

 	............................................
 	. Alain LARROZE - Conseil UNIX Independant .
 	.  e-mail: larroze@cli00pa.edf.fr          .
 	............................................
 
 
------------------------------- Cut Here -----------------------------------
/* offL1a.c */
#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;
char	*argv[];
{
	struct	kiockey	keytable;
	register int	console;
	register struct	kiockey *key = &keytable;

	if(getuid() != 0) {
		fprintf(stderr,"root usage only\n");
		exit(1);
	}
	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);
	}
}
------------------------------- Cut Here -----------------------------------
/* onL1a.c */
#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;
char	*argv[];
{
	struct	kiockey	keytable;
	register int	console;
	register struct	kiockey *key = &keytable;

	if(getuid() != 0) {
		fprintf(stderr,"root usage only\n");
		exit(1);
	}
	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);
	}
}
------------------------------- Cut Here -----------------------------------
 
Newsgroups: comp.unix.admin