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 LGPLv3 license.
8 #include "biosvar.h" // GET_EBDA
9 #include "util.h" // mdelay
10 #include "bregs.h" // struct bregs
11 #include "boot.h" // IPL
17 memset(&br, 0, sizeof(br));
19 call16_int(0x16, &br);
20 return !(br.flags & F_ZF);
27 memset(&br, 0, sizeof(br));
28 call16_int(0x16, &br);
36 memset(&br, 0, sizeof(br));
40 call16_int(0x15, &br);
44 timed_check_for_keystroke(int msec)
47 if (check_for_keystroke())
56 interactive_bootmenu()
58 if (! CONFIG_BOOTMENU)
61 while (check_for_keystroke())
64 printf("Press F12 for boot menu.\n\n");
66 if (!timed_check_for_keystroke(2500))
68 int scan_code = get_keystroke();
69 if (scan_code != 0x86)
73 while (check_for_keystroke())
76 printf("Select boot device:\n\n");
78 int count = IPL.count;
80 for (i = 0; i < count; i++) {
87 scan_code = get_keystroke();
88 if (scan_code == 0x01 || scan_code == 0x58)
91 if (scan_code <= count + 1) {
92 // Add user choice to the boot order.
93 u16 choice = scan_code - 1;
94 u32 bootorder = IPL.bootorder;
95 IPL.bootorder = (bootorder << 4) | choice;