mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 13:30:31 +00:00
Kernel/HID: Add boot option to disable PS2 Mouse
This commit is contained in:
parent
95bf6ddb8e
commit
83835c7256
Notes:
sideshowbarker
2024-07-17 00:37:23 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/83835c7256 Pull-request: https://github.com/SerenityOS/serenity/pull/21085 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/FireFox317 Reviewed-by: https://github.com/Hendiadyoin1 ✅ Reviewed-by: https://github.com/gmta ✅
4 changed files with 10 additions and 1 deletions
|
@ -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.
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue