ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

options.c
Go to the documentation of this file.
00001 /*
00002  *  FreeLoader
00003  *  Copyright (C) 1998-2003  Brian Palmer  <brianp@sginet.com>
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License along
00016  *  with this program; if not, write to the Free Software Foundation, Inc.,
00017  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018  */
00019 
00020 #include <freeldr.h>
00021 #include <debug.h>
00022 
00023 PCSTR   OptionsMenuList[] =
00024 {
00025     "Safe Mode",
00026     "Safe Mode with Networking",
00027     "Safe Mode with Command Prompt",
00028 
00029     "SEPARATOR",
00030 
00031     "Enable Boot Logging",
00032     "Enable VGA Mode",
00033     "Last Known Good Configuration",
00034     "Directory Services Restore Mode",
00035     "Debugging Mode",
00036     "FreeLdr debugging",
00037 
00038     "SEPARATOR",
00039 
00040 #ifdef HAS_OPTION_MENU_CUSTOM_BOOT
00041     "Custom Boot",
00042 #endif
00043 #ifdef HAS_OPTION_MENU_REBOOT
00044     "Reboot",
00045 #endif
00046 };
00047 
00048 PCSTR FrldrDbgMsg = "Enable freeldr debug channels\n"
00049                     "Acceptable syntax: [level1]#channel1[,[level2]#channel2]\n"
00050                     "level can be one of: trace,warn,fixme,err\n"
00051                     "  if the level is ommited all levels\n"
00052                     "  are enabled for the specified channel\n"
00053                     "# can be either + or -\n"
00054                     "channel can be one of the following:\n"
00055                     "  all,warning,memory,filesystem,inifile,ui,disk,cache,registry,\n"
00056                     "  reactos,linux,hwdetect,windows,peloader,scsiport,heap\n"
00057                     "Examples:\n"
00058                     "  trace+windows,trace+reactos\n"
00059                     "  +hwdetect,err-disk\n"
00060                     "  +peloader\n"
00061                     "NOTE: all letters must be lowercase, no spaces allowed\n";
00062 
00063 enum OptionMenuItems
00064 {
00065     SAFE_MODE = 0,
00066     SAFE_MODE_WITH_NETWORKING = 1,
00067     SAFE_MODE_WITH_COMMAND_PROMPT = 2,
00068 
00069     SEPARATOR1 = 3,
00070 
00071     ENABLE_BOOT_LOGGING = 4,
00072     ENABLE_VGA_MODE = 5,
00073     LAST_KNOWN_GOOD_CONFIGURATION = 6,
00074     DIRECTORY_SERVICES_RESTORE_MODE = 7,
00075     DEBUGGING_MODE = 8,
00076     FREELDR_DEBUGGING = 9,
00077 
00078     SEPARATOR2 = 10,
00079 
00080 #ifdef HAS_OPTION_MENU_CUSTOM_BOOT
00081     CUSTOM_BOOT = 11,
00082 #endif
00083 #ifdef HAS_OPTION_MENU_REBOOT
00084     REBOOT = 12,
00085 #endif
00086 };
00087 
00088 ULONG       OptionsMenuItemCount = sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]);
00089 
00090 BOOLEAN SafeMode = FALSE;
00091 BOOLEAN SafeModeWithNetworking = FALSE;
00092 BOOLEAN SafeModeWithCommandPrompt = FALSE;
00093 BOOLEAN BootLogging = FALSE;
00094 BOOLEAN VgaMode = FALSE;
00095 BOOLEAN LastKnownGoodConfiguration = FALSE;
00096 BOOLEAN DirectoryServicesRepairMode = FALSE;
00097 BOOLEAN DebuggingMode = FALSE;
00098 
00099 VOID DoOptionsMenu(VOID)
00100 {
00101     ULONG       SelectedMenuItem;
00102     CHAR DebugChannelString[100];
00103 
00104     if (!UiDisplayMenu(OptionsMenuList, OptionsMenuItemCount, 0, -1, &SelectedMenuItem, TRUE, NULL))
00105     {
00106         // The user pressed ESC
00107         return;
00108     }
00109 
00110     // Clear the backdrop
00111     UiDrawBackdrop();
00112 
00113     switch (SelectedMenuItem)
00114     {
00115     case SAFE_MODE:
00116         SafeMode = TRUE;
00117         BootLogging = TRUE;
00118         break;
00119     case SAFE_MODE_WITH_NETWORKING:
00120         SafeModeWithNetworking = TRUE;
00121         BootLogging = TRUE;
00122         break;
00123     case SAFE_MODE_WITH_COMMAND_PROMPT:
00124         SafeModeWithCommandPrompt = TRUE;
00125         BootLogging = TRUE;
00126         break;
00127     //case SEPARATOR1:
00128     //  break;
00129     case ENABLE_BOOT_LOGGING:
00130         BootLogging = TRUE;
00131         break;
00132     case ENABLE_VGA_MODE:
00133         VgaMode = TRUE;
00134         break;
00135     case LAST_KNOWN_GOOD_CONFIGURATION:
00136         LastKnownGoodConfiguration = TRUE;
00137         break;
00138     case DIRECTORY_SERVICES_RESTORE_MODE:
00139         DirectoryServicesRepairMode = TRUE;
00140         break;
00141     case DEBUGGING_MODE:
00142         DebuggingMode = TRUE;
00143         break;
00144     case FREELDR_DEBUGGING:
00145         DebugChannelString[0]=0;
00146         if(UiEditBox(FrldrDbgMsg, DebugChannelString, 100))
00147             DbgParseDebugChannels(DebugChannelString);
00148         break;
00149     //case SEPARATOR2:
00150     //  break;
00151 #ifdef HAS_OPTION_MENU_CUSTOM_BOOT
00152     case CUSTOM_BOOT:
00153         OptionMenuCustomBoot();
00154         break;
00155 #endif
00156 #ifdef HAS_OPTION_MENU_REBOOT
00157     case REBOOT:
00158         OptionMenuReboot();
00159         break;
00160 #endif
00161     }
00162 }
00163 
00164 VOID AppendBootTimeOptions(PCHAR BootOptions)
00165 {
00166     if (SafeMode)
00167         strcat(BootOptions, " /SAFEBOOT:MINIMAL /SOS"); //FIXME: NOGUIBOOT should also be specified
00168 
00169     if (SafeModeWithNetworking)
00170         strcat(BootOptions, " /SAFEBOOT:NETWORK /SOS"); //FIXME: NOGUIBOOT should also be specified
00171 
00172     if (SafeModeWithCommandPrompt)
00173         strcat(BootOptions, " /SAFEBOOT:MINIMAL(ALTERNATESHELL) /SOS"); //FIXME: NOGUIBOOT should also be specified
00174 
00175     if (BootLogging)
00176         strcat(BootOptions, " /BOOTLOG");
00177 
00178     if (VgaMode)
00179         strcat(BootOptions, " /BASEVIDEO");
00180 
00181     if (LastKnownGoodConfiguration)
00182         DbgPrint("Last known good configuration is not supported yet!\n");
00183 
00184     if (DirectoryServicesRepairMode)
00185         strcat(BootOptions, " /SAFEBOOT:DSREPAIR /SOS");
00186 
00187     if (DebuggingMode)
00188         strcat(BootOptions, " /DEBUG");
00189 }

Generated on Sun May 27 2012 04:19:17 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.