1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +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

@ -24,6 +24,13 @@ enum class HPETMode {
NonPeriodic
};
enum class I8042PresenceMode {
Automatic,
AggressiveTest,
Force,
None,
};
enum class AcpiFeatureLevel {
Enabled,
Limited,
@ -77,13 +84,13 @@ public:
[[nodiscard]] bool is_legacy_time_enabled() const;
[[nodiscard]] bool is_pc_speaker_enabled() const;
[[nodiscard]] GraphicsSubsystemMode graphics_subsystem_mode() const;
[[nodiscard]] I8042PresenceMode i8042_presence_mode() const;
[[nodiscard]] bool is_force_pio() const;
[[nodiscard]] AcpiFeatureLevel acpi_feature_level() const;
[[nodiscard]] StringView system_mode() const;
[[nodiscard]] PanicMode panic_mode(Validate should_validate = Validate::No) const;
[[nodiscard]] HPETMode hpet_mode() const;
[[nodiscard]] bool disable_physical_storage() const;
[[nodiscard]] bool disable_ps2_controller() const;
[[nodiscard]] bool disable_uhci_controller() const;
[[nodiscard]] bool disable_usb() const;
[[nodiscard]] bool disable_virtio() const;
@ -93,6 +100,7 @@ public:
[[nodiscard]] NonnullOwnPtrVector<KString> userspace_init_args() const;
[[nodiscard]] StringView root_device() const;
[[nodiscard]] bool is_nvme_polling_enabled() const;
[[nodiscard]] bool is_i8042_force_scan_code_2() const;
[[nodiscard]] size_t switch_to_tty() const;
private: