diff options
author | yokota <yokota@FreeBSD.org> | 1999-12-10 04:30:58 +0000 |
---|---|---|
committer | yokota <yokota@FreeBSD.org> | 1999-12-10 04:30:58 +0000 |
commit | ea70ddbc7ebf9ea257c1659822de64baf3e8c753 (patch) | |
tree | c0f17bc52e9ff5e6c95c5fce54d4be5d57981a49 /sys/dev/syscons | |
parent | 86222d7d6a2ab23d5ffcc3a13b463b0363d9903b (diff) | |
download | FreeBSD-src-ea70ddbc7ebf9ea257c1659822de64baf3e8c753.zip FreeBSD-src-ea70ddbc7ebf9ea257c1659822de64baf3e8c753.tar.gz |
Add "panic key" function to syscons. When this key is defined in a
keymap and pressed, the system panic will be forced.
This feature must be specifically enabled by a new sysctl variable:
machdep.enable_panic_key. Its default value is 0. The panic key
won't do anything unless this variable is set to non-zero.
To use the panic key, add a keyword 'panic' to a key in your
keymap file. The following example assigns the panic function
to SysReq (Alt-PrintScreen) key (keycode 84).
083 del '.' '.' '.' '.' '.' boot boot N
084 panic nop nop nop panic nop nop nop O
085 nop nop nop nop nop nop nop nop O
PR: kern/13721
Diffstat (limited to 'sys/dev/syscons')
-rw-r--r-- | sys/dev/syscons/syscons.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index f3ffa83..7c5958e 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -44,6 +44,7 @@ #include <sys/conf.h> #include <sys/proc.h> #include <sys/signalvar.h> +#include <sys/sysctl.h> #include <sys/tty.h> #include <sys/kernel.h> #include <sys/malloc.h> @@ -114,6 +115,10 @@ static void (*current_saver)(sc_softc_t *, int) = none_saver; static bios_values_t bios_value; +static int enable_panic_key; +SYSCTL_INT(_machdep, OID_AUTO, enable_panic_key, CTLFLAG_RW, &enable_panic_key, + 0, ""); + #define SC_MOUSE 128 #define SC_CONSOLECTL 255 @@ -3738,6 +3743,11 @@ next_code: #endif /* SC_DISABLE_DDBKEY */ break; + case PNC: + if (enable_panic_key) + panic("Forced by the panic key"); + break; + case NEXT: this_scr = scp->index; for (i = (this_scr - sc->first_vty + 1)%sc->vtys; |