aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware/rombios
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-01-06 16:06:13 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-01-06 16:06:13 +0000
commit303e213ce3658d854706f21995a5d9792b268953 (patch)
tree743aebdcb868f3f34874abc9d912a65ad57f41ec /tools/firmware/rombios
parent872a09d26274c57b608add17b9a5cabc49f241c6 (diff)
downloadxen-303e213ce3658d854706f21995a5d9792b268953.tar.gz
xen-303e213ce3658d854706f21995a5d9792b268953.tar.bz2
xen-303e213ce3658d854706f21995a5d9792b268953.zip
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 <keir.fraser@citrix.com>
Diffstat (limited to 'tools/firmware/rombios')
-rw-r--r--tools/firmware/rombios/rombios.c94
1 files 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