From 0bce5f7403f40b4dfc5e759cd079d0de6463980d Mon Sep 17 00:00:00 2001 From: Liav A Date: Wed, 5 Feb 2020 21:07:12 +0200 Subject: Kernel Commandline: Change nopci_mmio to be pci_mmio Instead of having nopci_mmio, the boot argument now is pci_mmio='on|off'. --- Kernel/init.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Kernel/init.cpp b/Kernel/init.cpp index b201f939a1..0d8a832922 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -76,6 +76,7 @@ static void setup_serial_debug(); static void setup_acpi(); static void setup_vmmouse(); +static void setup_pci(); VirtualConsole* tty0; @@ -142,8 +143,7 @@ extern "C" [[noreturn]] void init() // Sample test to see if the ACPI parser is working... kprintf("ACPI: HPET table @ P 0x%x\n", ACPIParser::the().find_table("HPET")); - PCI::Initializer::the().test_and_initialize(KParams::the().has("nopci_mmio")); - PCI::Initializer::the().dismiss(); + setup_pci(); PIT::initialize(); @@ -437,3 +437,22 @@ void setup_vmmouse() kprintf("vmmouse boot argmuent has an invalid value.\n"); hang(); } + +void setup_pci() +{ + if (!KParams::the().has("pci_mmio")) { + PCI::Initializer::the().test_and_initialize(false); + PCI::Initializer::the().dismiss(); + return; + } + auto pci_mmio = KParams::the().get("pci_mmio"); + if (pci_mmio == "on") { + PCI::Initializer::the().test_and_initialize(false); + } else if (pci_mmio == "off") { + PCI::Initializer::the().test_and_initialize(true); + } else { + kprintf("pci_mmio boot argmuent has an invalid value.\n"); + hang(); + } + PCI::Initializer::the().dismiss(); +} -- cgit v1.2.3