31d9e57ea08c3ccd67f0f2d6e1c815d4a6530a4f
[reactos.git] / reactos / boot / freeldr / freeldr / options.c
1 /*
2 * FreeLoader
3 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #include <freeldr.h>
21 #include <rtl.h>
22 #include <ui.h>
23 #include <options.h>
24 #include <miscboot.h>
25 #include <debug.h>
26 #include <disk.h>
27 #include <arch.h>
28
29
30 PCSTR OptionsMenuList[] =
31 {
32 "Safe Mode",
33 "Safe Mode with Networking",
34 "Safe Mode with Command Prompt",
35
36 "SEPARATOR",
37
38 "Enable Boot Logging",
39 "Enable VGA Mode",
40 "Last Known Good Configuration",
41 "Directory Services Restore Mode",
42 "Debugging Mode",
43
44 "SEPARATOR",
45
46 "Custom Boot",
47 "Reboot",
48 };
49
50 enum OptionMenuItems
51 {
52 SAFE_MODE = 0,
53 SAFE_MODE_WITH_NETWORKING = 1,
54 SAFE_MODE_WITH_COMMAND_PROMPT = 2,
55
56 SEPARATOR1 = 3,
57
58 ENABLE_BOOT_LOGGING = 4,
59 ENABLE_VGA_MODE = 5,
60 LAST_KNOWN_GOOD_CONFIGURATION = 6,
61 DIRECTORY_SERVICES_RESTORE_MODE = 7,
62 DEBUGGING_MODE = 8,
63
64 SEPARATOR2 = 9,
65
66 CUSTOM_BOOT = 10,
67 REBOOT = 11,
68 };
69
70 ULONG OptionsMenuItemCount = sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]);
71
72 VOID DoOptionsMenu(VOID)
73 {
74 ULONG SelectedMenuItem;
75
76 if (!UiDisplayMenu(OptionsMenuList, OptionsMenuItemCount, 0, -1, &SelectedMenuItem, TRUE, NULL))
77 {
78 // The user pressed ESC
79 return;
80 }
81
82 // Clear the backdrop
83 UiDrawBackdrop();
84
85 switch (SelectedMenuItem)
86 {
87 case SAFE_MODE:
88 break;
89 case SAFE_MODE_WITH_NETWORKING:
90 break;
91 case SAFE_MODE_WITH_COMMAND_PROMPT:
92 break;
93 //case SEPARATOR1:
94 // break;
95 case ENABLE_BOOT_LOGGING:
96 break;
97 case ENABLE_VGA_MODE:
98 break;
99 case LAST_KNOWN_GOOD_CONFIGURATION:
100 break;
101 case DIRECTORY_SERVICES_RESTORE_MODE:
102 break;
103 case DEBUGGING_MODE:
104 break;
105 //case SEPARATOR2:
106 // break;
107 case CUSTOM_BOOT:
108 OptionMenuCustomBoot();
109 break;
110 case REBOOT:
111 OptionMenuReboot();
112 break;
113 }
114 }
115
116 VOID OptionMenuReboot(VOID)
117 {
118 UiMessageBox("The system will now reboot.");
119
120 #ifdef __i386__
121 DiskStopFloppyMotor();
122 SoftReboot();
123 #else
124 UNIMPLEMENTED();
125 #endif
126 }