* Added kernel settings for APM - defaults to disabled (since it doesn't work
on at least one of my systems, it only works on 3 of them...). * Added APM safemode setting. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16152 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -28,3 +28,7 @@
|
|||||||
#load_symbols false
|
#load_symbols false
|
||||||
# load kernel and kernel add-on symbols
|
# load kernel and kernel add-on symbols
|
||||||
|
|
||||||
|
#apm false
|
||||||
|
# APM (advanced power management) support
|
||||||
|
# (system shutdown, battery info, ...)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-2005, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2004-2006, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -27,6 +27,11 @@ platform_add_menus(Menu *menu)
|
|||||||
|
|
||||||
menu->AddItem(item = new MenuItem("Don't call the BIOS"));
|
menu->AddItem(item = new MenuItem("Don't call the BIOS"));
|
||||||
item->SetType(MENU_ITEM_MARKABLE);
|
item->SetType(MENU_ITEM_MARKABLE);
|
||||||
|
|
||||||
|
menu->AddItem(item = new MenuItem("Disable APM"));
|
||||||
|
item->SetType(MENU_ITEM_MARKABLE);
|
||||||
|
item->SetData("disable_apm");
|
||||||
|
item->SetHelpText("This overrides the APM setting in the kernel settings file");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <apm.h>
|
#include <apm.h>
|
||||||
#include <descriptors.h>
|
#include <descriptors.h>
|
||||||
|
#include <safemode.h>
|
||||||
#include <boot/kernel_args.h>
|
#include <boot/kernel_args.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -217,7 +218,7 @@ apm_init(kernel_args *args)
|
|||||||
|
|
||||||
if ((info.version & 0xf) < 2) {
|
if ((info.version & 0xf) < 2) {
|
||||||
// no APM or connect failed
|
// no APM or connect failed
|
||||||
return B_OK;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE((" code32: 0x%x, 0x%lx, length 0x%x\n",
|
TRACE((" code32: 0x%x, 0x%lx, length 0x%x\n",
|
||||||
@@ -227,8 +228,23 @@ apm_init(kernel_args *args)
|
|||||||
TRACE((" data: 0x%x, length 0x%x\n",
|
TRACE((" data: 0x%x, length 0x%x\n",
|
||||||
info.data_segment_base, info.data_segment_length));
|
info.data_segment_base, info.data_segment_length));
|
||||||
|
|
||||||
// TODO: remove me when tested on more hardware
|
// get APM setting - safemode settings override kernel settings
|
||||||
if (1)
|
|
||||||
|
bool apm = false;
|
||||||
|
|
||||||
|
void *handle = load_driver_settings("kernel");
|
||||||
|
if (handle != NULL) {
|
||||||
|
apm = get_driver_boolean_parameter(handle, "apm", false, false);
|
||||||
|
unload_driver_settings(handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
handle = load_driver_settings(B_SAFEMODE_DRIVER_SETTINGS);
|
||||||
|
if (handle != NULL) {
|
||||||
|
apm = !get_driver_boolean_parameter(handle, "disable_apm", !apm, !apm);
|
||||||
|
unload_driver_settings(handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!apm)
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
// Apparently, some broken BIOS try to access segment 0x40 for the BIOS
|
// Apparently, some broken BIOS try to access segment 0x40 for the BIOS
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ arch_platform_init_post_vm(struct kernel_args *args)
|
|||||||
status_t
|
status_t
|
||||||
arch_platform_init_post_thread(struct kernel_args *args)
|
arch_platform_init_post_thread(struct kernel_args *args)
|
||||||
{
|
{
|
||||||
return apm_init(args);
|
apm_init(args);
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user