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(); +}