mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 13:55:08 +00:00
Kernel: Move DMI decoder initialization method to init_stage2
Also, PCI Initializer dismiss() now deletes the object correctly, and the PCI initialization process no longer use the DMI decoder to determine if PCI is supported. grub configuration files include an entry to boot the OS without ACPI support.
This commit is contained in:
parent
918097ae94
commit
c2ef7f740b
5 changed files with 32 additions and 43 deletions
|
@ -1,5 +1,4 @@
|
|||
#include <Kernel/ACPI/ACPIParser.h>
|
||||
#include <Kernel/ACPI/DMIDecoder.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/KParams.h>
|
||||
#include <Kernel/PCI/IOAccess.h>
|
||||
|
@ -23,10 +22,10 @@ void PCI::Initializer::initialize_pci_io_access()
|
|||
{
|
||||
PCI::IOAccess::initialize();
|
||||
}
|
||||
void PCI::Initializer::test_and_initialize(bool disable_pci_mmio, bool pci_force_probing)
|
||||
void PCI::Initializer::test_and_initialize(bool disable_pci_mmio)
|
||||
{
|
||||
if (disable_pci_mmio) {
|
||||
if (test_pci_io(pci_force_probing)) {
|
||||
if (test_pci_io()) {
|
||||
initialize_pci_io_access();
|
||||
} else {
|
||||
kprintf("No PCI Bus Access Method Detected, Halt!\n");
|
||||
|
@ -38,7 +37,7 @@ void PCI::Initializer::test_and_initialize(bool disable_pci_mmio, bool pci_force
|
|||
if (test_pci_mmio()) {
|
||||
initialize_pci_mmio_access_after_test();
|
||||
} else {
|
||||
if (test_pci_io(pci_force_probing)) {
|
||||
if (test_pci_io()) {
|
||||
initialize_pci_io_access();
|
||||
} else {
|
||||
kprintf("No PCI Bus Access Method Detected, Halt!\n");
|
||||
|
@ -46,7 +45,7 @@ void PCI::Initializer::test_and_initialize(bool disable_pci_mmio, bool pci_force
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if (test_pci_io(pci_force_probing)) {
|
||||
if (test_pci_io()) {
|
||||
initialize_pci_io_access();
|
||||
} else {
|
||||
kprintf("No PCI Bus Access Method Detected, Halt!\n");
|
||||
|
@ -65,29 +64,9 @@ bool PCI::Initializer::test_acpi()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool PCI::Initializer::test_pci_io(bool pci_force_probing)
|
||||
bool PCI::Initializer::test_pci_io()
|
||||
{
|
||||
kprintf("Testing PCI via SMBIOS...\n");
|
||||
|
||||
if (!pci_force_probing) {
|
||||
if (DMIDecoder::the().is_reliable()) {
|
||||
if ((DMIDecoder::the().get_bios_characteristics() & (1 << 3)) != 0) {
|
||||
kprintf("DMIDecoder: Warning, BIOS characteristics are not supported, skipping\n");
|
||||
} else if ((DMIDecoder::the().get_bios_characteristics() & (u32)SMBIOS::BIOSCharacteristics::PCI_support) != 0) {
|
||||
kprintf("PCI *should* be supported according to SMBIOS...\n");
|
||||
return true;
|
||||
} else {
|
||||
kprintf("SMBIOS does not list PCI as supported, Falling back to manual probing!\n");
|
||||
}
|
||||
} else {
|
||||
kprintf("DMI is classified as unreliable, ignore it!\n");
|
||||
}
|
||||
} else {
|
||||
kprintf("Requested to force PCI probing...\n");
|
||||
}
|
||||
|
||||
kprintf("Testing PCI via manual probing... ");
|
||||
|
||||
u32 tmp = 0x80000000;
|
||||
IO::out32(PCI_ADDRESS_PORT, tmp);
|
||||
tmp = IO::in32(PCI_ADDRESS_PORT);
|
||||
|
@ -118,7 +97,8 @@ void PCI::Initializer::dismiss()
|
|||
if (s_pci_initializer == nullptr)
|
||||
return;
|
||||
kprintf("PCI Subsystem Initializer dismissed.\n");
|
||||
s_pci_initializer->~Initializer();
|
||||
delete s_pci_initializer;
|
||||
s_pci_initializer = nullptr;
|
||||
}
|
||||
|
||||
PCI::Initializer::~Initializer()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue