kv2: initialize memory manager, early pci devices

Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
This commit is contained in:
Michael Shaw 2026-05-12 02:59:37 -04:00
commit a252a3f8e9
58 changed files with 1270 additions and 505 deletions

View file

@ -1,8 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include "kernel/page.h"
#include <kernel/common.h>
#include <kernel/mem.h>
#include <kernel/requests.h>
#include <drivers/pci.h>
#include <drivers/acpi.h>
#include <lib/string.h>
@ -49,10 +51,18 @@ void acpi_load_pci()
for (u32 i = 0; i < n_entries; i++) {
struct acpi_mcfg_entry *entry = &mcfg->entries[i];
u64 pci_virt_base = TO_VIRT(entry->base_address);
kdebug("MCFG entry: base=%p, start_bus=%d,end_bus=%d,seg_group=%d\n", pci_virt_base, entry->start_bus_number,
kdebug("MCFG entry: base=%p, start_bus=%d,end_bus=%d,seg_group=%d\n", entry->base_address, entry->start_bus_number,
entry->end_bus_number, entry->pci_segment_group);
struct pci_host host = {
.base = entry->base_address,
.start_bus = entry->start_bus_number,
.end_bus = entry->end_bus_number,
.segment_group = entry->pci_segment_group,
};
pci_register_host(&host);
}
}
@ -69,5 +79,5 @@ void acpi_init()
if (rsdp->revision == 2)
xsdt = (struct xsdt *)(rsdp->xsdt_address | hhdm_start);
acpi_load_pci();
acpi_load_pci();
}