diff options
author | Luke <luke.wilde@live.co.uk> | 2021-04-17 20:36:53 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-18 17:01:22 +0200 |
commit | c84107a1abc3e16f7fa685427cc0a6ef2b2ec745 (patch) | |
tree | f06f7602b304e6f28c35ace15d42efacee7fc403 | |
parent | e98091ad159298dbaf6c8edb0372f6a4c12e8512 (diff) | |
download | serenity-c84107a1abc3e16f7fa685427cc0a6ef2b2ec745.zip |
Kernel: Add boot argument to disable the UHCI Controller
Helps with bare metal debugging, as we can't be sure our implementation
will work with a given machine.
As reported by someone on Discord, their machine hangs when we attempt
the dummy transfer.
-rw-r--r-- | Documentation/NetworkBoot.md | 8 | ||||
-rw-r--r-- | Kernel/CommandLine.cpp | 5 | ||||
-rw-r--r-- | Kernel/CommandLine.h | 1 | ||||
-rw-r--r-- | Kernel/Devices/USB/UHCIController.cpp | 5 |
4 files changed, 16 insertions, 3 deletions
diff --git a/Documentation/NetworkBoot.md b/Documentation/NetworkBoot.md index eea5e81a79..1b33ffe376 100644 --- a/Documentation/NetworkBoot.md +++ b/Documentation/NetworkBoot.md @@ -166,8 +166,12 @@ boot This file can be called in any name you'd want. For the sake of simplicity in this guide, this file is named `script.ipxe` from now on. Don't forget to replace `X.Y.Z.W` with your HTTP server IP address. -For troubleshooting purposes, you could add `disable_physical_storage` and `disable_ps2_controller` -if you suspect our implementation fails to work with your hardware. + +For troubleshooting purposes, you can add the following command line arguments if you suspect our implementation fails to work with your hardware: +- `disable_physical_storage` +- `disable_ps2_controller` +- `disable_uhci_controller` + Because iPXE (unlike GRUB) doesn't support VESA VBE modesetting when booting a multiboot kernel, you might not see any output, so add the `boot_mode=text` argument as well to boot into VGA text mode. diff --git a/Kernel/CommandLine.cpp b/Kernel/CommandLine.cpp index 443fb0e20b..c81003447f 100644 --- a/Kernel/CommandLine.cpp +++ b/Kernel/CommandLine.cpp @@ -165,6 +165,11 @@ UNMAP_AFTER_INIT bool CommandLine::disable_physical_storage() const return contains("disable_physical_storage"); } +UNMAP_AFTER_INIT bool CommandLine::disable_uhci_controller() const +{ + return contains("disable_uhci_controller"); +} + UNMAP_AFTER_INIT AHCIResetMode CommandLine::ahci_reset_mode() const { const auto ahci_reset_mode = lookup("ahci_reset_mode").value_or("controller"); diff --git a/Kernel/CommandLine.h b/Kernel/CommandLine.h index 7ec1c484e3..8a734d2405 100644 --- a/Kernel/CommandLine.h +++ b/Kernel/CommandLine.h @@ -86,6 +86,7 @@ public: [[nodiscard]] HPETMode hpet_mode() const; [[nodiscard]] bool disable_physical_storage() const; [[nodiscard]] bool disable_ps2_controller() const; + [[nodiscard]] bool disable_uhci_controller() const; [[nodiscard]] AHCIResetMode ahci_reset_mode() const; [[nodiscard]] String userspace_init() const; [[nodiscard]] Vector<String> userspace_init_args() const; diff --git a/Kernel/Devices/USB/UHCIController.cpp b/Kernel/Devices/USB/UHCIController.cpp index 235d1ec4f5..8aa07d68ec 100644 --- a/Kernel/Devices/USB/UHCIController.cpp +++ b/Kernel/Devices/USB/UHCIController.cpp @@ -26,7 +26,7 @@ */ #include <AK/Platform.h> - +#include <Kernel/CommandLine.h> #include <Kernel/Debug.h> #include <Kernel/Devices/USB/UHCIController.h> #include <Kernel/Process.h> @@ -89,6 +89,9 @@ UHCIController& UHCIController::the() UNMAP_AFTER_INIT void UHCIController::detect() { + if (kernel_command_line().disable_uhci_controller()) + return; + PCI::enumerate([&](const PCI::Address& address, PCI::ID id) { if (address.is_null()) return; |