Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Eric Smith <eric@brouhaha.com>
Subject: Milo reboot change
Date: 17 Nov 1996 11:49:50 -0000	[thread overview]
Message-ID: <6de288d34dada26e7586b3837535ce84.axp-list@archive.invalid> (raw)

Here's a trivial patch to Milo that changes something that has been annoying
the heck out of me.  When I do a reboot, it seems rather counter-intuitive
to me that pressing most keys will abort the reboot, but that ESCAPE will
reboot immediately.  I prefer to have RETURN reboot immediately, ESCAPE
abort the reboot, and other keys ignored.  Unfortunately "ignored" isn't
quite right, as pressing other keys advances the timeout, but I didn't want
to do a major rewrite of the keyboard input code.

Another trivial change keeps the immediate reboot from showing the time as
"0 27" (for example).

*** milo.c.orig	Fri Oct 18 10:36:47 1996
--- milo.c	Sat Nov 16 19:41:04 1996
***************
*** 1109,1127 ****
  
  static int do_autoboot_timeout (unsigned timeout)
  {
! #   define ASCII_ESCAPE	0x1b	/* ASCII code of ESC key */
      int key;
  
!     printk("Hit any key to enter command mode, ESC to boot immediately\n");
      printk("Seconds remaining: ");
      while (timeout--) {
  	printk("%4d    \b\b\b\b\b\b\b\b", timeout);
  	key = kbd_getc_with_timeout(1);
  	if (key >= 0) {
! 	    if (key == ASCII_ESCAPE) {
! 		printk("0\n");
  		break;
! 	    } else {
  		printk("stopped.\nEntering command mode.\n");
  		return -1;	/* argh, user whimped out on us... */
  	    }
--- 1109,1129 ----
  
  static int do_autoboot_timeout (unsigned timeout)
  {
! #   define ASCII_ESCAPE 0x1b    /* ASCII code of ESCAPE key */
! #   define ASCII_RETURN 0x0d    /* ASCII code of RETURN key */
! 
      int key;
  
!     printk("Press RETURN to boot immediately, ESCAPE to abort.\n");
      printk("Seconds remaining: ");
      while (timeout--) {
  	printk("%4d    \b\b\b\b\b\b\b\b", timeout);
  	key = kbd_getc_with_timeout(1);
  	if (key >= 0) {
! 	    if (key == ASCII_RETURN) {
! 		printk("0   \n");
  		break;
! 	    } else if (key == ASCII_ESCAPE) {
  		printk("stopped.\nEntering command mode.\n");
  		return -1;	/* argh, user whimped out on us... */
  	    }

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

                 reply	other threads:[~1996-11-17 11:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox