From 303e213ce3658d854706f21995a5d9792b268953 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 6 Jan 2009 16:06:13 +0000 Subject: [PATCH] rombios: Get rid of annoying delay at F12 boot menu. Instead require the F12 to be pressed before the menu prompt appears. Signed-off-by: Keir Fraser --- tools/firmware/rombios/rombios.c | 94 ++++++++++++++++---------------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/tools/firmware/rombios/rombios.c b/tools/firmware/rombios/rombios.c index 04c18ba118..d960222048 100644 --- a/tools/firmware/rombios/rombios.c +++ b/tools/firmware/rombios/rombios.c @@ -2141,64 +2141,62 @@ interactive_bootkey() Bit16u valid_choice = 0; Bit16u ebda_seg = read_word(0x0040, 0x000E); - while (check_for_keystroke()) - get_keystroke(); - - printf("\nPress F12 for boot menu.\n\n"); + printf("\n\nPress F12 for boot menu.\n\n"); - delay_ticks_and_check_for_keystroke(11, 5); /* ~3 seconds */ - if (check_for_keystroke()) + while (check_for_keystroke()) { scan_code = get_keystroke(); - if (scan_code == 0x86) /* F12 */ - { - while (check_for_keystroke()) - get_keystroke(); + if (scan_code != 0x86) /* F12 */ + continue; + + while (check_for_keystroke()) + get_keystroke(); - printf("Select boot device:\n\n"); + printf("Select boot device:\n\n"); - count = read_word(ebda_seg, IPL_COUNT_OFFSET); - for (i = 0; i < count; i++) + count = read_word(ebda_seg, IPL_COUNT_OFFSET); + for (i = 0; i < count; i++) + { + memcpyb(ss, &e, ebda_seg, IPL_TABLE_OFFSET + i * sizeof (e), sizeof (e)); + printf("%d. ", i+1); + switch(e.type) { - memcpyb(ss, &e, ebda_seg, IPL_TABLE_OFFSET + i * sizeof (e), sizeof (e)); - printf("%d. ", i+1); - switch(e.type) - { - case IPL_TYPE_FLOPPY: - case IPL_TYPE_HARDDISK: - case IPL_TYPE_CDROM: - printf("%s\n", drivetypes[e.type]); - break; - case IPL_TYPE_BEV: - printf("%s", drivetypes[4]); - if (e.description != 0) - { - memcpyb(ss, &description, (Bit16u)(e.description >> 16), (Bit16u)(e.description & 0xffff), 32); - description[32] = 0; - printf(" [%S]", ss, description); - } - printf("\n"); - break; - } + case IPL_TYPE_FLOPPY: + case IPL_TYPE_HARDDISK: + case IPL_TYPE_CDROM: + printf("%s\n", drivetypes[e.type]); + break; + case IPL_TYPE_BEV: + printf("%s", drivetypes[4]); + if (e.description != 0) + { + memcpyb(ss, &description, (Bit16u)(e.description >> 16), (Bit16u)(e.description & 0xffff), 32); + description[32] = 0; + printf(" [%S]", ss, description); + } + printf("\n"); + break; } + } - count++; - while (!valid_choice) { - scan_code = get_keystroke(); - if (scan_code == 0x01 || scan_code == 0x58) /* ESC or F12 */ - { - valid_choice = 1; - } - else if (scan_code <= count) - { - valid_choice = 1; - scan_code -= 1; - /* Set user selected device */ - write_word(ebda_seg, IPL_BOOTFIRST_OFFSET, scan_code); - } + count++; + while (!valid_choice) { + scan_code = get_keystroke(); + if (scan_code == 0x01 || scan_code == 0x58) /* ESC or F12 */ + { + valid_choice = 1; + } + else if (scan_code <= count) + { + valid_choice = 1; + scan_code -= 1; + /* Set user selected device */ + write_word(ebda_seg, IPL_BOOTFIRST_OFFSET, scan_code); } - printf("\n"); } + + printf("\n"); + break; } } #endif // BX_ELTORITO_BOOT -- 2.30.2