Bugtraq mailing list archives

Re: Regarding Mudge's OBP/FORTH root hack (PHRACK53)


From: Eric.Johnson () Central Sun COM (Eric Johnson)
Date: Wed, 15 Jul 1998 10:51:01 -0400


If you want to actually stop the break being sent at all then under
Solaris 2.6 you can do this by running: `kbd -a disable`

[snip]

The following program, written by a colleague who wishes to remain
anonymous, lets one toggle between Stop-A enabled/disabled.  It has
been tested under Solaris 2.5 and SunOS 4.1.4.  I thought the list
might find it interesting.

--Eric Johnson

/*
 * Do not distribute this file without this disclaimer.
 *
 *  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.
 *
 * Warning!!
 *
 * If L1-A and BREAK are both disabled:
 *
 *   - It is impossible to sync the machine should it soft-hang.
 *              - You could lose data.
 *              - It is difficult to generate a crash dump for analysis.
 *
 *   -  It will be very difficult to distinguish between a soft hang and a
 *      hard hang for diagnostic purposes.
 *
 *
 */

#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");
}



Current thread: