Skip to content

Commit

Permalink
Kernel Commandline: Change nopci_mmio to be pci_mmio
Browse files Browse the repository at this point in the history
Instead of having nopci_mmio, the boot argument now is
pci_mmio='on|off'.
  • Loading branch information
supercomputer7 authored and awesomekling committed Feb 5, 2020
1 parent 8a41256 commit 0bce5f7
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Kernel/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
static void setup_serial_debug();
static void setup_acpi();
static void setup_vmmouse();
static void setup_pci();

VirtualConsole* tty0;

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();
}

0 comments on commit 0bce5f7

Please sign in to comment.