1 // Menu presented during final phase of "post".
3 // Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net>
4 // Copyright (C) 2002 MandrakeSoft S.A.
6 // This file may be distributed under the terms of the GNU GPLv3 license.
8 #include "biosvar.h" // GET_EBDA
9 #include "util.h" // usleep
15 memset(&br, 0, sizeof(br));
17 call16_int(0x16, &br);
18 return !(br.flags & F_ZF);
25 memset(&br, 0, sizeof(br));
26 call16_int(0x16, &br);
31 udelay_and_check_for_keystroke(u32 usec, int count)
34 for (i = 1; i <= count; i++) {
36 if (check_for_keystroke())
42 interactive_bootmenu()
44 while (check_for_keystroke())
47 printf("Press F12 for boot menu.\n\n");
49 udelay_and_check_for_keystroke(500000, 5);
50 if (! check_for_keystroke())
52 u8 scan_code = get_keystroke();
53 if (scan_code != 0x58)
57 while (check_for_keystroke())
60 printf("Select boot device:\n\n");
62 int count = GET_EBDA(ipl.count);
64 for (i = 0; i < count; i++) {
71 scan_code = get_keystroke();
72 if (scan_code == 0x01 || scan_code == 0x58)
75 if (scan_code <= count + 1) {
76 SET_EBDA(ipl.bootfirst, scan_code - 1);