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