From 954437ca1c46055cb3d9065fe8b386c59edc1cfe Mon Sep 17 00:00:00 2001 From: andromeda Date: Sat, 24 Oct 2026 01:13:28 -0400 Subject: [acpi.c3l] add some ACPI structires --- main.c3 | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'main.c3') diff --git a/main.c3 b/main.c3 index 0e0340b..3bf8937 100644 --- a/main.c3 +++ b/main.c3 @@ -88,10 +88,25 @@ fn EfiStatus efi_main(EfiHandle image_handle, SystemTable* system_table) @export uint num_entries = (xsdt.length - ExtendedSystemDescriptionTable::size) / ulong::size; + char[8] oemTableId = xsdt.oemTableId; + + log::info("OEM Table ID: "); + util::putbs(&oemTableId, 8); + util::puts(" revision "); + util::puti(xsdt.oemRevision); + util::puts("\r\n"); + for (usz i = 0; i < num_entries; i++) { DescriptionHeader* dh = (DescriptionHeader*)(uptr)xsdt.descriptionHeaders[i]; + // in QEMU on my device: + // FACP: Fixed ACPI Description Table + // APIC: Multiple APIC Description Table + // HPET: IA-PC High Precision Event Timer Table + // WAET: Windows ACPI Emulated Devices Table + // BGRT: Boot Graphics Resource Table + if (dh.is_valid()) { log::info("valid signature: "); @@ -115,17 +130,9 @@ fn EfiStatus efi_main(EfiHandle image_handle, SystemTable* system_table) @export alias PanicFn = fn void(String message, String file, String function, int line); PanicFn panicfn = &panic; -fn void panic(String message = "test", String file = "", String function = "", int line = 0) +fn void panic(String message = "", String file = "", String function = "", int line = 0) { - util::puts("PANIC: "); - util::puts(message); - util::puts("\r\nfunc "); - util::puts(function); - util::puts(" in file "); - util::puts(file); - util::puts(" at line "); - util::puti((usz)line); - util::puts("\r\n"); + util::puts("PANIC"); spin(); } -- cgit v1.3.1