1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 12:17:35 +00:00

Kernel: Make i8042 controller initialization sequence more robust

The setting of scan code set sequence is removed, as it's buggy and
could lead the controller to fail immediately when doing self-test
afterwards. We will restore it when we understand how to do so safely.

Allow the user to determine a preferred detection path with a new kernel
command line argument. The defualt option is to check i8042 presence
with an ACPI check and if necessary - an "aggressive" test to determine
i8042 existence in the system.
Also, keep the i8042 controller pointer on the stack, so don't assign
m_i8042_controller member pointer if it does not exist.
This commit is contained in:
Liav A 2022-12-22 03:46:22 +02:00 committed by Jelle Raaijmakers
parent fc5bcd8476
commit 0f7cc468b2
6 changed files with 62 additions and 34 deletions

View file

@ -139,6 +139,20 @@ UNMAP_AFTER_INIT bool CommandLine::is_early_boot_console_disabled() const
PANIC("Unknown early_boot_console setting: {}", value);
}
UNMAP_AFTER_INIT I8042PresenceMode CommandLine::i8042_presence_mode() const
{
auto value = lookup("i8042_presence_mode"sv).value_or("auto"sv);
if (value == "auto"sv)
return I8042PresenceMode::Automatic;
if (value == "none"sv)
return I8042PresenceMode::None;
if (value == "force"sv)
return I8042PresenceMode::Force;
if (value == "aggressive-test"sv)
return I8042PresenceMode::AggressiveTest;
PANIC("Unknown i8042_presence_mode setting: {}", value);
}
UNMAP_AFTER_INIT bool CommandLine::is_vmmouse_enabled() const
{
return lookup("vmmouse"sv).value_or("on"sv) == "on"sv;
@ -220,11 +234,6 @@ UNMAP_AFTER_INIT bool CommandLine::is_physical_networking_disabled() const
return contains("disable_physical_networking"sv);
}
UNMAP_AFTER_INIT bool CommandLine::disable_ps2_controller() const
{
return contains("disable_ps2_controller"sv);
}
UNMAP_AFTER_INIT bool CommandLine::disable_physical_storage() const
{
return contains("disable_physical_storage"sv);