Example #1
0
static Menu *
add_safe_mode_menu()
{
    Menu *safeMenu = new(nothrow) Menu(SAFE_MODE_MENU, "Safe Mode Options");
    MenuItem *item;

    safeMenu->AddItem(item = new(nothrow) MenuItem("Safe mode"));
    item->SetData(B_SAFEMODE_SAFE_MODE);
    item->SetType(MENU_ITEM_MARKABLE);
    item->SetHelpText("Puts the system into safe mode. This can be enabled "
                      "independently from the other options.");

    safeMenu->AddItem(item = new(nothrow) MenuItem("Disable user add-ons"));
    item->SetData(B_SAFEMODE_DISABLE_USER_ADD_ONS);
    item->SetType(MENU_ITEM_MARKABLE);
    item->SetHelpText("Prevents all user installed add-ons from being loaded. "
                      "Only the add-ons in the system directory will be used.");

    safeMenu->AddItem(item = new(nothrow) MenuItem("Disable IDE DMA"));
    item->SetData(B_SAFEMODE_DISABLE_IDE_DMA);
    item->SetType(MENU_ITEM_MARKABLE);
    item->SetHelpText("Disables IDE DMA, increasing IDE compatibilty "
                      "at the expense of performance.");

    platform_add_menus(safeMenu);

#if DEBUG_SPINLOCK_LATENCIES
    item = new(std::nothrow) MenuItem("Disable latency checks");
    if (item != NULL) {
        item->SetType(MENU_ITEM_MARKABLE);
        item->SetData(B_SAFEMODE_DISABLE_LATENCY_CHECK);
        item->SetHelpText("Disables latency check panics.");
        safeMenu->AddItem(item);
    }
#endif

    safeMenu->AddItem(item
                      = new(nothrow) MenuItem("Enable serial debug output"));
    item->SetData("serial_debug_output");
    item->SetType(MENU_ITEM_MARKABLE);
    item->SetHelpText("Turns on forwarding the syslog output to the serial "
                      "interface.");

    safeMenu->AddItem(item
                      = new(nothrow) MenuItem("Enable on screen debug output"));
    item->SetData("debug_screen");
    item->SetType(MENU_ITEM_MARKABLE);
    item->SetHelpText("Displays debug output on screen while the system "
                      "is booting, instead of the normal boot logo.");

    safeMenu->AddSeparatorItem();
    safeMenu->AddItem(item = new(nothrow) MenuItem("Return to main menu"));

    return safeMenu;
}
Example #2
0
static Menu*
add_safe_mode_menu()
{
	Menu* safeMenu = new(nothrow) Menu(SAFE_MODE_MENU, "Safe Mode Options");
	MenuItem* item;

	safeMenu->AddItem(item = new(nothrow) MenuItem("Safe mode"));
	item->SetData(B_SAFEMODE_SAFE_MODE);
	item->SetType(MENU_ITEM_MARKABLE);
	item->SetHelpText("Puts the system into safe mode. This can be enabled "
		"independently from the other options.");

	safeMenu->AddItem(item = new(nothrow) MenuItem("Disable user add-ons"));
	item->SetData(B_SAFEMODE_DISABLE_USER_ADD_ONS);
	item->SetType(MENU_ITEM_MARKABLE);
    item->SetHelpText("Prevents all user installed add-ons from being loaded. "
		"Only the add-ons in the system directory will be used.");

	safeMenu->AddItem(item = new(nothrow) MenuItem("Disable IDE DMA"));
	item->SetData(B_SAFEMODE_DISABLE_IDE_DMA);
	item->SetType(MENU_ITEM_MARKABLE);
    item->SetHelpText("Disables IDE DMA, increasing IDE compatibility "
		"at the expense of performance.");

#if B_HAIKU_PHYSICAL_BITS > 32
	// check whether we have memory beyond 4 GB
	bool hasMemoryBeyond4GB = false;
	for (uint32 i = 0; i < gKernelArgs.num_physical_memory_ranges; i++) {
		phys_addr_range& range = gKernelArgs.physical_memory_range[i];
		if (range.start >= (phys_addr_t)1 << 32) {
			hasMemoryBeyond4GB = true;
			break;
		}
	}

	// ... add the menu, if so
	if (hasMemoryBeyond4GB) {
		safeMenu->AddItem(
			item = new(nothrow) MenuItem("Ignore memory beyond 4 GiB"));
		item->SetData(B_SAFEMODE_4_GB_MEMORY_LIMIT);
		item->SetType(MENU_ITEM_MARKABLE);
		item->SetHelpText("Ignores all memory beyond the 4 GiB address limit, "
			"overriding the setting in the kernel settings file.");
	}
#endif

	platform_add_menus(safeMenu);

	safeMenu->AddSeparatorItem();
	safeMenu->AddItem(item = new(nothrow) MenuItem("Return to main menu"));

	return safeMenu;
}
Example #3
0
status_t
user_menu(Directory** _bootVolume)
{
	Menu* menu = new(std::nothrow) Menu(MAIN_MENU);
	Menu* safeModeMenu = NULL;
	Menu* debugMenu = NULL;
	MenuItem* item;

	TRACE(("user_menu: enter\n"));

	// Add boot volume
	menu->AddItem(item = new(std::nothrow) MenuItem("Select boot volume",
		add_boot_volume_menu(*_bootVolume)));

	// Add safe mode
	menu->AddItem(item = new(std::nothrow) MenuItem("Select safe mode options",
		safeModeMenu = add_safe_mode_menu()));

	// add debug menu
	menu->AddItem(item = new(std::nothrow) MenuItem("Select debug options",
		debugMenu = add_debug_menu()));

	// Add platform dependent menus
	platform_add_menus(menu);

	menu->AddSeparatorItem();

	menu->AddItem(item = new(std::nothrow) MenuItem("Reboot"));
	item->SetTarget(user_menu_reboot);
	item->SetShortcut('r');

	menu->AddItem(item = new(std::nothrow) MenuItem("Continue booting"));
	if (*_bootVolume == NULL) {
		item->SetEnabled(false);
		menu->ItemAt(0)->Select(true);
	} else
		item->SetShortcut('b');

	menu->Run();

	// See if a new boot device has been selected, and propagate that back
	if (item->Data() != NULL)
		*_bootVolume = (Directory*)item->Data();

	apply_safe_mode_options(safeModeMenu);
	apply_safe_mode_options(debugMenu);
	delete menu;

	TRACE(("user_menu: leave\n"));

	return B_OK;
}
Example #4
0
status_t
user_menu(BootVolume& _bootVolume, PathBlacklist& _pathBlacklist)
{

	Menu* menu = new(std::nothrow) Menu(MAIN_MENU);

	sMainMenu = menu;
	sBootVolume = &_bootVolume;
	sPathBlacklist = &_pathBlacklist;

	Menu* safeModeMenu = NULL;
	Menu* debugMenu = NULL;
	MenuItem* item;

	TRACE(("user_menu: enter\n"));

	// Add boot volume
	menu->AddItem(item = new(std::nothrow) MenuItem("Select boot volume",
		add_boot_volume_menu()));

	// Add safe mode
	menu->AddItem(item = new(std::nothrow) MenuItem("Select safe mode options",
		safeModeMenu = add_safe_mode_menu()));

	// add debug menu
	menu->AddItem(item = new(std::nothrow) MenuItem("Select debug options",
		debugMenu = add_debug_menu()));

	// Add platform dependent menus
	platform_add_menus(menu);

	menu->AddSeparatorItem();

	menu->AddItem(item = new(std::nothrow) MenuItem("Reboot"));
	item->SetTarget(user_menu_reboot);
	item->SetShortcut('r');

	menu->AddItem(item = new(std::nothrow) MenuItem("Continue booting"));
	if (!_bootVolume.IsValid()) {
		item->SetEnabled(false);
		menu->ItemAt(0)->Select(true);
	} else
		item->SetShortcut('b');

	menu->Run();

	apply_safe_mode_options(safeModeMenu);
	apply_safe_mode_options(debugMenu);
	apply_safe_mode_path_blacklist();
	add_safe_mode_settings(sSafeModeOptionsBuffer.String());
	delete menu;


	TRACE(("user_menu: leave\n"));

	sMainMenu = NULL;
	sBlacklistRootMenu = NULL;
	sBootVolume = NULL;
	sPathBlacklist = NULL;
	return B_OK;
}
Example #5
0
static Menu*
add_safe_mode_menu()
{
	Menu* safeMenu = new(nothrow) Menu(SAFE_MODE_MENU, "Safe Mode Options");
	MenuItem* item;

	safeMenu->AddItem(item = new(nothrow) MenuItem("Safe mode"));
	item->SetData(B_SAFEMODE_SAFE_MODE);
	item->SetType(MENU_ITEM_MARKABLE);
	item->SetHelpText("Puts the system into safe mode. This can be enabled "
		"independently from the other options.");

	safeMenu->AddItem(item = new(nothrow) MenuItem("Disable user add-ons"));
	item->SetData(B_SAFEMODE_DISABLE_USER_ADD_ONS);
	item->SetType(MENU_ITEM_MARKABLE);
    item->SetHelpText("Prevents all user installed add-ons from being loaded. "
		"Only the add-ons in the system directory will be used.");

	safeMenu->AddItem(item = new(nothrow) MenuItem("Disable IDE DMA"));
	item->SetData(B_SAFEMODE_DISABLE_IDE_DMA);
	item->SetType(MENU_ITEM_MARKABLE);
    item->SetHelpText("Disables IDE DMA, increasing IDE compatibility "
		"at the expense of performance.");

#if B_HAIKU_PHYSICAL_BITS > 32
	// check whether we have memory beyond 4 GB
	bool hasMemoryBeyond4GB = false;
	for (uint32 i = 0; i < gKernelArgs.num_physical_memory_ranges; i++) {
		addr_range& range = gKernelArgs.physical_memory_range[i];
		if (range.start >= (uint64)1 << 32) {
			hasMemoryBeyond4GB = true;
			break;
		}
	}

	bool needs64BitPaging = true;
		// TODO: Determine whether 64 bit paging (i.e. PAE for x86) is needed
		// for other reasons (NX support).

	// ... add the menu item, if so
	if (hasMemoryBeyond4GB || needs64BitPaging) {
		safeMenu->AddItem(
			item = new(nothrow) MenuItem("Ignore memory beyond 4 GiB"));
		item->SetData(B_SAFEMODE_4_GB_MEMORY_LIMIT);
		item->SetType(MENU_ITEM_MARKABLE);
		item->SetHelpText("Ignores all memory beyond the 4 GiB address limit, "
			"overriding the setting in the kernel settings file.");
	}
#endif

	platform_add_menus(safeMenu);

	safeMenu->AddSeparatorItem();
	sBlacklistRootMenu = new(std::nothrow) BlacklistRootMenu;
	safeMenu->AddItem(item = new(std::nothrow) MenuItem("Blacklist entries",
		sBlacklistRootMenu));
	item->SetHelpText("Allows to select system files that shall be ignored. "
		"Useful e.g. to disable drivers temporarily.");

	safeMenu->AddSeparatorItem();
	safeMenu->AddItem(item = new(nothrow) MenuItem("Return to main menu"));

	return safeMenu;
}