diff options
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/CommandLine.cpp | 5 | ||||
-rw-r--r-- | Kernel/CommandLine.h | 1 | ||||
-rw-r--r-- | Kernel/VirtIO/VirtIO.cpp | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/Kernel/CommandLine.cpp b/Kernel/CommandLine.cpp index c81003447f..27dc9e9bc0 100644 --- a/Kernel/CommandLine.cpp +++ b/Kernel/CommandLine.cpp @@ -170,6 +170,11 @@ UNMAP_AFTER_INIT bool CommandLine::disable_uhci_controller() const return contains("disable_uhci_controller"); } +UNMAP_AFTER_INIT bool CommandLine::disable_virtio() const +{ + return contains("disable_virtio"); +} + 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 8a734d2405..109ad7b5fa 100644 --- a/Kernel/CommandLine.h +++ b/Kernel/CommandLine.h @@ -87,6 +87,7 @@ public: [[nodiscard]] bool disable_physical_storage() const; [[nodiscard]] bool disable_ps2_controller() const; [[nodiscard]] bool disable_uhci_controller() const; + [[nodiscard]] bool disable_virtio() const; [[nodiscard]] AHCIResetMode ahci_reset_mode() const; [[nodiscard]] String userspace_init() const; [[nodiscard]] Vector<String> userspace_init_args() const; diff --git a/Kernel/VirtIO/VirtIO.cpp b/Kernel/VirtIO/VirtIO.cpp index 203a529986..b01689a036 100644 --- a/Kernel/VirtIO/VirtIO.cpp +++ b/Kernel/VirtIO/VirtIO.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <Kernel/CommandLine.h> #include <Kernel/VirtIO/VirtIO.h> #include <Kernel/VirtIO/VirtIOConsole.h> #include <Kernel/VirtIO/VirtIORNG.h> @@ -32,6 +33,8 @@ namespace Kernel { void VirtIO::detect() { + if (kernel_command_line().disable_virtio()) + return; PCI::enumerate([&](const PCI::Address& address, PCI::ID id) { if (address.is_null() || id.is_null()) return; |