- Ignore KBD_RAW_MODE and KBD_CODE_MODE in scgetc() when it's called

from the low-level console routines sccngetc() and sccncheckc().
Submitted by: bde (a long time ago)

- Don't try to ring bell and immediately return from do_bell() while
device probe is in progress at boot time; the timeout queue is not
functional yet.
PR: kern/2424

- Stop running the screen saver after panic() is called: check
if `panicstr' is non-NULL during scrn_timer().
PR: kern/5314

- A new option: SC_DISABLE_REBOOT
The reboot key (usually Ctl-Alt-Del) will be ignored if this option
is defined. You may still have the reboot key defined in the keymap and
it won't cause error when the keymap is loaded, but it will be quietly
treated as nop.

OKed by: sos
This commit is contained in:
yokota 1998-02-11 14:56:02 +00:00
parent db84a320ea
commit 9f03d5e495
3 changed files with 54 additions and 27 deletions

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: syscons.c,v 1.246 1998/01/20 03:37:27 yokota Exp $ * $Id: syscons.c,v 1.247 1998/01/24 02:54:26 eivind Exp $
*/ */
#include "sc.h" #include "sc.h"
@ -905,9 +905,6 @@ scintr(int unit)
int c, len; int c, len;
u_char *cp; u_char *cp;
/* make screensaver happy */
scrn_time_stamp = mono_time.tv_sec;
/* /*
* Loop while there is still input to get from the keyboard. * Loop while there is still input to get from the keyboard.
* I don't think this is nessesary, and it doesn't fix * I don't think this is nessesary, and it doesn't fix
@ -2221,6 +2218,8 @@ scrn_timer(void *arg)
} }
/* should we stop the screen saver? */ /* should we stop the screen saver? */
if (panicstr)
scrn_time_stamp = mono_time.tv_sec;
if (mono_time.tv_sec <= scrn_time_stamp + scrn_blank_time) if (mono_time.tv_sec <= scrn_time_stamp + scrn_blank_time)
if (scrn_blanked > 0) if (scrn_blanked > 0)
stop_scrn_saver(current_saver); stop_scrn_saver(current_saver);
@ -3420,12 +3419,17 @@ scgetc(u_int flags)
} }
scancode = (u_char)c; scancode = (u_char)c;
/* do the /dev/random device a favour */ /* make screensaver happy */
if (!(flags & SCGETC_CN)) if (!(scancode & 0x80))
scrn_time_stamp = mono_time.tv_sec;
if (!(flags & SCGETC_CN)) {
/* do the /dev/random device a favour */
add_keyboard_randomness(scancode); add_keyboard_randomness(scancode);
if (cur_console->status & KBD_RAW_MODE) if (cur_console->status & KBD_RAW_MODE)
return scancode; return scancode;
}
keycode = scancode & 0x7F; keycode = scancode & 0x7F;
switch (esc_flag) { switch (esc_flag) {
@ -3530,7 +3534,7 @@ scgetc(u_int flags)
break; break;
} }
if (cur_console->status & KBD_CODE_MODE) if (!(flags & SCGETC_CN) && (cur_console->status & KBD_CODE_MODE))
return (keycode | (scancode & 0x80)); return (keycode | (scancode & 0x80));
/* if scroll-lock pressed allow history browsing */ /* if scroll-lock pressed allow history browsing */
@ -3769,8 +3773,10 @@ scgetc(u_int flags)
#endif #endif
break; break;
case RBT: case RBT:
#ifndef SC_DISABLE_REBOOT
accents = 0; accents = 0;
shutdown_nice(); shutdown_nice();
#endif
break; break;
case SUSP: case SUSP:
#if NAPM > 0 #if NAPM > 0
@ -4851,6 +4857,9 @@ load_palette(char *palette)
static void static void
do_bell(scr_stat *scp, int pitch, int duration) do_bell(scr_stat *scp, int pitch, int duration)
{ {
if (cold)
return;
if (flags & VISUAL_BELL) { if (flags & VISUAL_BELL) {
if (blink_in_progress) if (blink_in_progress)
return; return;

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: syscons.c,v 1.246 1998/01/20 03:37:27 yokota Exp $ * $Id: syscons.c,v 1.247 1998/01/24 02:54:26 eivind Exp $
*/ */
#include "sc.h" #include "sc.h"
@ -905,9 +905,6 @@ scintr(int unit)
int c, len; int c, len;
u_char *cp; u_char *cp;
/* make screensaver happy */
scrn_time_stamp = mono_time.tv_sec;
/* /*
* Loop while there is still input to get from the keyboard. * Loop while there is still input to get from the keyboard.
* I don't think this is nessesary, and it doesn't fix * I don't think this is nessesary, and it doesn't fix
@ -2221,6 +2218,8 @@ scrn_timer(void *arg)
} }
/* should we stop the screen saver? */ /* should we stop the screen saver? */
if (panicstr)
scrn_time_stamp = mono_time.tv_sec;
if (mono_time.tv_sec <= scrn_time_stamp + scrn_blank_time) if (mono_time.tv_sec <= scrn_time_stamp + scrn_blank_time)
if (scrn_blanked > 0) if (scrn_blanked > 0)
stop_scrn_saver(current_saver); stop_scrn_saver(current_saver);
@ -3420,12 +3419,17 @@ scgetc(u_int flags)
} }
scancode = (u_char)c; scancode = (u_char)c;
/* do the /dev/random device a favour */ /* make screensaver happy */
if (!(flags & SCGETC_CN)) if (!(scancode & 0x80))
scrn_time_stamp = mono_time.tv_sec;
if (!(flags & SCGETC_CN)) {
/* do the /dev/random device a favour */
add_keyboard_randomness(scancode); add_keyboard_randomness(scancode);
if (cur_console->status & KBD_RAW_MODE) if (cur_console->status & KBD_RAW_MODE)
return scancode; return scancode;
}
keycode = scancode & 0x7F; keycode = scancode & 0x7F;
switch (esc_flag) { switch (esc_flag) {
@ -3530,7 +3534,7 @@ scgetc(u_int flags)
break; break;
} }
if (cur_console->status & KBD_CODE_MODE) if (!(flags & SCGETC_CN) && (cur_console->status & KBD_CODE_MODE))
return (keycode | (scancode & 0x80)); return (keycode | (scancode & 0x80));
/* if scroll-lock pressed allow history browsing */ /* if scroll-lock pressed allow history browsing */
@ -3769,8 +3773,10 @@ scgetc(u_int flags)
#endif #endif
break; break;
case RBT: case RBT:
#ifndef SC_DISABLE_REBOOT
accents = 0; accents = 0;
shutdown_nice(); shutdown_nice();
#endif
break; break;
case SUSP: case SUSP:
#if NAPM > 0 #if NAPM > 0
@ -4851,6 +4857,9 @@ load_palette(char *palette)
static void static void
do_bell(scr_stat *scp, int pitch, int duration) do_bell(scr_stat *scp, int pitch, int duration)
{ {
if (cold)
return;
if (flags & VISUAL_BELL) { if (flags & VISUAL_BELL) {
if (blink_in_progress) if (blink_in_progress)
return; return;

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: syscons.c,v 1.246 1998/01/20 03:37:27 yokota Exp $ * $Id: syscons.c,v 1.247 1998/01/24 02:54:26 eivind Exp $
*/ */
#include "sc.h" #include "sc.h"
@ -905,9 +905,6 @@ scintr(int unit)
int c, len; int c, len;
u_char *cp; u_char *cp;
/* make screensaver happy */
scrn_time_stamp = mono_time.tv_sec;
/* /*
* Loop while there is still input to get from the keyboard. * Loop while there is still input to get from the keyboard.
* I don't think this is nessesary, and it doesn't fix * I don't think this is nessesary, and it doesn't fix
@ -2221,6 +2218,8 @@ scrn_timer(void *arg)
} }
/* should we stop the screen saver? */ /* should we stop the screen saver? */
if (panicstr)
scrn_time_stamp = mono_time.tv_sec;
if (mono_time.tv_sec <= scrn_time_stamp + scrn_blank_time) if (mono_time.tv_sec <= scrn_time_stamp + scrn_blank_time)
if (scrn_blanked > 0) if (scrn_blanked > 0)
stop_scrn_saver(current_saver); stop_scrn_saver(current_saver);
@ -3420,12 +3419,17 @@ scgetc(u_int flags)
} }
scancode = (u_char)c; scancode = (u_char)c;
/* do the /dev/random device a favour */ /* make screensaver happy */
if (!(flags & SCGETC_CN)) if (!(scancode & 0x80))
scrn_time_stamp = mono_time.tv_sec;
if (!(flags & SCGETC_CN)) {
/* do the /dev/random device a favour */
add_keyboard_randomness(scancode); add_keyboard_randomness(scancode);
if (cur_console->status & KBD_RAW_MODE) if (cur_console->status & KBD_RAW_MODE)
return scancode; return scancode;
}
keycode = scancode & 0x7F; keycode = scancode & 0x7F;
switch (esc_flag) { switch (esc_flag) {
@ -3530,7 +3534,7 @@ scgetc(u_int flags)
break; break;
} }
if (cur_console->status & KBD_CODE_MODE) if (!(flags & SCGETC_CN) && (cur_console->status & KBD_CODE_MODE))
return (keycode | (scancode & 0x80)); return (keycode | (scancode & 0x80));
/* if scroll-lock pressed allow history browsing */ /* if scroll-lock pressed allow history browsing */
@ -3769,8 +3773,10 @@ scgetc(u_int flags)
#endif #endif
break; break;
case RBT: case RBT:
#ifndef SC_DISABLE_REBOOT
accents = 0; accents = 0;
shutdown_nice(); shutdown_nice();
#endif
break; break;
case SUSP: case SUSP:
#if NAPM > 0 #if NAPM > 0
@ -4851,6 +4857,9 @@ load_palette(char *palette)
static void static void
do_bell(scr_stat *scp, int pitch, int duration) do_bell(scr_stat *scp, int pitch, int duration)
{ {
if (cold)
return;
if (flags & VISUAL_BELL) { if (flags & VISUAL_BELL) {
if (blink_in_progress) if (blink_in_progress)
return; return;