From ea4376fc5461e5126ad8ac238d8f94849b301fec Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Mon, 10 Feb 2020 02:02:33 +0100 Subject: [PATCH 1/2] Test signing commit --- kaleid/kernel/io/acpi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kaleid/kernel/io/acpi.c b/kaleid/kernel/io/acpi.c index 2435e63..9995173 100644 --- a/kaleid/kernel/io/acpi.c +++ b/kaleid/kernel/io/acpi.c @@ -242,7 +242,6 @@ static inline void IoSearchAcpiTables(void) else table = (SDTHeader_t *)(ulong)curLong[i]; - //KernLog("\tACPI RSDT[%d] %p\n", i, table); if (MmIsBusyZone(table)) { checksum = DoChecksum(table, (size_t)table->length, 0, 0); if (!checksum) { @@ -288,7 +287,6 @@ static inline void IoSearchAcpiTables(void) SDTHeader_t *mcfg = IoFindMCFG(); if (mcfg) { - //DebugLog("MCFG found at %p\n"); checksum = 0; //DoChecksum(mcfg, (size_t)mcfg->length, 0, 0); if (!checksum) { if (!strncmp(mcfg->signature, SDTChar[SDT_MCFG], 3)) { From f30031e1d99651433484021977b6ce43db96c22d Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Mon, 10 Feb 2020 13:24:20 +0100 Subject: [PATCH 2/2] MCFG detected successfully. Oof. #73 --- Makefile | 2 +- kaleid/kernel/io/acpi.c | 42 ----------------------------------------- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/Makefile b/Makefile index 56b822f..10c9128 100644 --- a/Makefile +++ b/Makefile @@ -271,7 +271,7 @@ all : ## QEMU/DEBUG RELATED test: all installonimage - @qemu-system-x86_64 -vga std -enable-kvm -soundhw pcspk -cpu host -s \ + @qemu-system-x86_64 -vga std -enable-kvm -machine type=q35 -soundhw pcspk -cpu host -s \ -rtc base=localtime -m $(ram) -hda $(installdisk) \ -d cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log & diff --git a/kaleid/kernel/io/acpi.c b/kaleid/kernel/io/acpi.c index 9995173..52ff4de 100644 --- a/kaleid/kernel/io/acpi.c +++ b/kaleid/kernel/io/acpi.c @@ -185,31 +185,6 @@ static inline void IoInitRXSDT(void) } } -// -// Returns the address of the MCFG -// -static inline SDTHeader_t *IoFindMCFG() -{ - char *mcfg = NULL; - - for (uint i = 0; i < memoryMap.length; i++) { - if (memoryMap.entry[i].type == RESERVED_ZONE) { - - for (mcfg = (char *)memoryMap.entry[i].addr; - (ulong)mcfg < (ulong)(memoryMap.entry[i].addr + - memoryMap.entry[i].length); - mcfg++) { - - if (!strncmp(mcfg, "MCFG", 3)) { - return (SDTHeader_t *)mcfg; - } - } - } - } - - return NULL; -} - // // Explore all ACPI Tables // @@ -283,23 +258,6 @@ static inline void IoSearchAcpiTables(void) } } - // Finding MCFG - SDTHeader_t *mcfg = IoFindMCFG(); - - if (mcfg) { - checksum = 0; //DoChecksum(mcfg, (size_t)mcfg->length, 0, 0); - if (!checksum) { - if (!strncmp(mcfg->signature, SDTChar[SDT_MCFG], 3)) { - DebugLog("ACPI System Table %s (OEM %s) length %lu [%p]\n", - SDTChar[SDT_MCFG], - mcfg->OEMID, - mcfg->length, - mcfg - ); - SDTDirectory[SDT_MCFG] = mcfg; - } - } - } } // -------------------------------------------------------------------------- //