From 8a412564974cb54d22eb170427657be71526f3b1 Mon Sep 17 00:00:00 2001 From: Liav A Date: Wed, 5 Feb 2020 20:47:53 +0200 Subject: [PATCH] Kernel Commandline: Change no_vmmouse boot argument to be vmmouse Instead of having no_vmmouse, the boot argument now is vmmouse='on|off'. --- Kernel/init.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Kernel/init.cpp b/Kernel/init.cpp index 6c5d50a5b2..b201f939a1 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -75,6 +75,7 @@ [[noreturn]] static void init_stage2(); static void setup_serial_debug(); static void setup_acpi(); +static void setup_vmmouse(); VirtualConsole* tty0; @@ -123,9 +124,7 @@ extern "C" [[noreturn]] void init() new KeyboardDevice; new PS2MouseDevice; - VMWareBackdoor::initialize(); - if (!KParams::the().has("no_vmmouse")) - VMWareBackdoor::the().enable_absolute_vmmouse(); + setup_vmmouse(); new SB16; new NullDevice; @@ -420,3 +419,21 @@ void setup_acpi() kprintf("acpi boot argmuent has an invalid value.\n"); hang(); } + +void setup_vmmouse() +{ + VMWareBackdoor::initialize(); + if (!KParams::the().has("vmmouse")) { + VMWareBackdoor::the().enable_absolute_vmmouse(); + return; + } + auto vmmouse = KParams::the().get("vmmouse"); + if (vmmouse == "off") + return; + if (vmmouse == "on") { + VMWareBackdoor::the().enable_absolute_vmmouse(); + return; + } + kprintf("vmmouse boot argmuent has an invalid value.\n"); + hang(); +}