[ Printer Friendly Page ]
[ E-mail this Document to Someone ]
[ Was this document useful? Yes or No ]
SRDB ID |
|
Synopsis |
|
Date |
14688 |
|
Disabling L1-A |
|
7 Jan 1997 |
FOR INTERNAL USE ONLY - DO NOT DISTRIBUTE TO CUSTOMERS
======================================================
Some customers wish to disable the break key on the console, to stop
users pressing L1-A whenever they feel like it.
It took me ages to find the answer, so I'm recording it in SunSolve for others
benefit.
I've tested it on 4.1.4 & 2.5 in the lab and it works, but *only* where there
is a directly connected keyboard & monitor.
The problem is addressed in Sol 2.6 by a /etc/default/kbd file (RFEID# 1204365)
If you want to know how to stop a BREAK singal when a dumb terminal console
is switched off or disconnected see INTSRDB 14687
Please note that these procedures are neither recommended nor supported by Sun
for the following reasons:
If L1-A and BREAK are both disabled
- It is impossible for the customer to sync the machine should it soft-hang.
- You could lose data.
- It is impossible to generate a crash dump for analysis.
- It is not possible to distinguish between a soft hang and a hard hang for
diagnostic purposes.
Before letting anyone have this source please ensure that they are aware of all
the possible implications.
Please distribute the disclaimer comment header along with the source under all
circumstances.
Please contact your local Sun Microsystems Answer Centre for more details
/*
* The contents of this file are intended to be read as an example.
* This is not a supported product of Sun Microsystems and no hotline
* calls will be accepted which directly relate to this information.
*
* NO LIABILITY WILL BE ACCEPTED BY SUN MICROSYSTEMS FOR ANY LOSS (DIRECT
* OR CONSEQUENTIAL) INCURRED IN ANY WAY BY ANY PARTY THROUGH THE USE OF
* THIS INFORMATION.
*
* NO WARRANTY OF ANY SORT IS IMPLIED OR GIVEN FOR ANY CODE DERIVED
* FROM THIS INFORMATION.
I
*/
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sundev/kbd.h>
#include <sundev/kbio.h>
main(argc, argv)
int argc;
char *argv[];
{
struct kiockey key;
int fd;
int mode;
char *c;
if (argc != 2) {
printf("\nUSAGE: abort_key y|n \n\n");
exit(1);
}
switch (*(c= argv[1])) {
case 'y':
mode = 1;
break;
case 'n':
mode = 0;
break;
default:
printf("\nINVALID ARGUMENT\n");
printf("USAGE: abort_key y|n \n\n");
exit(1);
}
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 was disabled\n");
else if (key.kio_station == 1)
printf("L1-A reset sequence was enabled\n");
if (mode == 1)
key.kio_station = 1;
else
key.kio_station = 0;
ioctl(fd, KIOCSETKEY, &key); /* map it t a 'hole' in map */
if (key.kio_station == 0)
printf("L1-A reset sequence now disabled\n");
else if (key.kio_station == 1)
printf("L1-A reset sequence now enabled\n");
}
INTERNAL SUMMARY:
/*
* The contents of this file are intended to be read as an example.
* This is not a supported product of Sun Microsystems and no hotline
* calls will be accepted which directly relate to this information.
*
* NO LIABILITY WILL BE ACCEPTED BY SUN MICROSYSTEMS FOR ANY LOSS (DIRECT
* OR CONSEQUENTIAL) INCURRED IN ANY WAY BY ANY PARTY THROUGH THE USE OF
* THIS INFORMATION.
*
* NO WARRANTY OF ANY SORT IS IMPLIED OR GIVEN FOR ANY CODE DERIVED
* FROM THIS INFORMATION.
I
*/
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sundev/kbd.h>
#include <sundev/kbio.h>
main(argc, argv)
int argc;
char *argv[];
{
struct kiockey key;
int fd;
int mode;
char *c;
if (argc != 2) {
printf("\nUSAGE: abort_key y|n \n\n");
exit(1);
}
switch (*(c= argv[1])) {
case 'y':
mode = 1;
break;
case 'n':
mode = 0;
break;
default:
printf("\nINVALID ARGUMENT\n");
printf("USAGE: abort_key y|n \n\n");
exit(1);
}
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 was disabled\n");
else if (key.kio_station == 1)
printf("L1-A reset sequence was enabled\n");
if (mode == 1)
key.kio_station = 1;
else
key.kio_station = 0;
ioctl(fd, KIOCSETKEY, &key); /* map it t a 'hole' in map */
if (key.kio_station == 0)
printf("L1-A reset sequence now disabled\n");
else if (key.kio_station == 1)
printf("L1-A reset sequence now enabled\n");
}
Top
Sun Proprietary/Confidential: Internal Use Only
Feedback to SunSolve Team