diff options
author | Jean-Baptiste Boric <jblbeurope@gmail.com> | 2021-01-24 18:20:23 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-24 22:16:18 +0100 |
commit | 4d755725bf1228fbd930d02a69c21b3e5c755881 (patch) | |
tree | c71588cb0c5eebbd230a14ebc865ab5a0f639f87 /Kernel/Storage/StorageManagement.cpp | |
parent | 7eaefa5aa6b85f5f7720ee823da2969280994fcb (diff) | |
download | serenity-4d755725bf1228fbd930d02a69c21b3e5c755881.zip |
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.
Diffstat (limited to 'Kernel/Storage/StorageManagement.cpp')
-rw-r--r-- | Kernel/Storage/StorageManagement.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
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 <AK/UUID.h> +#include <Kernel/CommandLine.h> #include <Kernel/Devices/BlockDevice.h> #include <Kernel/FileSystem/Ext2FileSystem.h> #include <Kernel/PCI/Access.h> @@ -60,11 +61,13 @@ bool StorageManagement::boot_argument_contains_partition_uuid() NonnullRefPtrVector<StorageController> StorageManagement::enumerate_controllers(bool force_pio) const { NonnullRefPtrVector<StorageController> 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; } |