Kernel/HID: Add boot option to disable PS2 Mouse

This commit is contained in:
Liav A 2022-03-05 13:58:10 +02:00 committed by Jelle Raaijmakers
parent 95bf6ddb8e
commit 83835c7256
Notes: sideshowbarker 2024-07-17 00:37:23 +09:00
4 changed files with 10 additions and 1 deletions

View file

@ -28,6 +28,8 @@ List of options:
during the boot sequence. Leaving only the AHCI and Ram Disk controllers.
* **`disable_physical_storage`** - If present on the command line, neither AHCI, or IDE controllers will be initialized on boot.
* **`disable_ps2_mouse`** - If present on the command line, no PS2 mouse will be attached.
* **`disable_uhci_controller`** - If present on the command line, the UHCI controller will not be initialized on boot.

View file

@ -8,6 +8,7 @@
#include <Kernel/Arch/x86_64/IO.h>
#include <Kernel/Arch/x86_64/ISABus/HID/VMWareMouseDevice.h>
#include <Kernel/Arch/x86_64/ISABus/I8042Controller.h>
#include <Kernel/Boot/CommandLine.h>
#include <Kernel/Bus/SerialIO/Device.h>
#include <Kernel/Devices/HID/KeyboardDevice.h>
#include <Kernel/Devices/HID/MouseDevice.h>
@ -216,7 +217,7 @@ UNMAP_AFTER_INIT ErrorOr<void> I8042Controller::detect_devices()
m_first_ps2_port.device = error_or_device.release_value();
}
}
if (m_second_port_available) {
if (m_second_port_available && !kernel_command_line().disable_ps2_mouse()) {
// FIXME: Actually figure out the connected PS2 device type
m_second_ps2_port.device_type = PS2DeviceType::StandardMouse;
auto mouse_device = TRY(MouseDevice::try_to_initialize());

View file

@ -226,6 +226,11 @@ UNMAP_AFTER_INIT bool CommandLine::is_physical_networking_disabled() const
return contains("disable_physical_networking"sv);
}
UNMAP_AFTER_INIT bool CommandLine::disable_ps2_mouse() const
{
return contains("disable_ps2_mouse"sv);
}
UNMAP_AFTER_INIT bool CommandLine::disable_physical_storage() const
{
return contains("disable_physical_storage"sv);

View file

@ -90,6 +90,7 @@ public:
[[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_mouse() const;
[[nodiscard]] bool disable_uhci_controller() const;
[[nodiscard]] bool disable_usb() const;
[[nodiscard]] bool disable_virtio() const;