From 4d755725bf1228fbd930d02a69c21b3e5c755881 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Boric Date: Sun, 24 Jan 2021 18:20:23 +0100 Subject: Kernel: Allow disabling of IDE controllers with disable_ide The kernel doesn't like the IDE controllers on an Asus A7N8X-E Deluxe motherboard, so add an option to disable them. --- Kernel/Storage/StorageManagement.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Kernel/Storage/StorageManagement.cpp') diff --git a/Kernel/Storage/StorageManagement.cpp b/Kernel/Storage/StorageManagement.cpp index f7fb356137..c1e0591533 100644 --- a/Kernel/Storage/StorageManagement.cpp +++ b/Kernel/Storage/StorageManagement.cpp @@ -25,6 +25,7 @@ */ #include +#include #include #include #include @@ -60,11 +61,13 @@ bool StorageManagement::boot_argument_contains_partition_uuid() NonnullRefPtrVector StorageManagement::enumerate_controllers(bool force_pio) const { NonnullRefPtrVector controllers; - PCI::enumerate([&](const PCI::Address& address, PCI::ID) { - if (PCI::get_class(address) == 0x1 && PCI::get_subclass(address) == 0x1) { - controllers.append(IDEController::initialize(address, force_pio)); - } - }); + if (!kernel_command_line().contains("disable_ide")) { + PCI::enumerate([&](const PCI::Address& address, PCI::ID) { + if (PCI::get_class(address) == 0x1 && PCI::get_subclass(address) == 0x1) { + controllers.append(IDEController::initialize(address, force_pio)); + } + }); + } controllers.append(RamdiskController::initialize()); return controllers; } -- cgit v1.2.3