1 /* 2 * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include "smp.h" 8 #include "video.h" 9 10 #include <boot/menu.h> 11 #include <boot/platform/generic/text_menu.h> 12 #include <safemode.h> 13 14 15 void 16 platform_add_menus(Menu *menu) 17 { 18 MenuItem *item; 19 20 switch (menu->Type()) { 21 case MAIN_MENU: 22 menu->AddItem(item = new(nothrow) MenuItem("Select fail-safe video mode", video_mode_menu())); 23 item->SetTarget(video_mode_hook); 24 break; 25 case SAFE_MODE_MENU: 26 menu->AddItem(item = new(nothrow) MenuItem("Use fail-safe video mode")); 27 item->SetType(MENU_ITEM_MARKABLE); 28 item->SetData(B_SAFEMODE_FAIL_SAFE_VIDEO_MODE); 29 item->SetHelpText("The system will use VESA mode and won't try to open any video graphics driver"); 30 31 #if 0 32 smp_add_safemode_menus(menu); 33 34 menu->AddItem(item = new(nothrow) MenuItem("Don't call the BIOS")); 35 item->SetType(MENU_ITEM_MARKABLE); 36 37 menu->AddItem(item = new(nothrow) MenuItem("Disable APM")); 38 item->SetType(MENU_ITEM_MARKABLE); 39 item->SetData("disable_apm"); 40 item->SetHelpText("This overrides the APM setting in the kernel settings file"); 41 42 menu->AddItem(item = new(nothrow) MenuItem("Disable ACPI")); 43 item->SetType(MENU_ITEM_MARKABLE); 44 item->SetData(B_SAFEMODE_DISABLE_ACPI); 45 item->SetHelpText("This overrides the ACPI setting in the kernel settings file"); 46 #endif 47 break; 48 default: 49 break; 50 } 51 } 52 53 54 void 55 platform_update_menu_item(Menu *menu, MenuItem *item) 56 { 57 platform_generic_update_text_menu_item(menu, item); 58 } 59 60 61 void 62 platform_run_menu(Menu *menu) 63 { 64 platform_generic_run_text_menu(menu); 65 } 66 67 size_t 68 platform_get_user_input_text(Menu *menu, MenuItem *item, char *buffer, 69 size_t bufferSize) 70 { 71 return platform_generic_get_user_input_text(menu, item, buffer, 72 bufferSize); 73 } 74