diff --git a/bochsrc b/bochsrc index e8ac7d2..c1dd8d6 100644 --- a/bochsrc +++ b/bochsrc @@ -29,6 +29,6 @@ debug: action=ignore, pci=report # report BX_DEBUG from module 'pci' debugger_log: - -com1: enabled=1, mode=socket-server, dev=localhost:1111 +#com1: enabled=1, mode=socket-server, dev=localhost:1111 port_e9_hack: enabled=1 diff --git a/src/acpi.c b/src/acpi.c index 44998c0..5d61d68 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -10,7 +10,11 @@ extern BOOTBOOT bootboot; void *acpi_find_table(const char *table_name) { struct SDT_Header *header = pa_to_pointer(pa_from_value(bootboot.arch.x86_64.acpi_ptr)); - ASSERT((header->Signature[0] == 'R' || header->Signature[0] == 'X') && !memcmp(header->Signature + 1, "SDT", 3)); + /* NOTE According to the ACPI spec, the root table should have one of the two signatures "RSDT" and "XSDT". + * For some weird reason (bug?), the ACPI tables provided under bochs start with a NUL character, + * meaning the signature is "\0SDT". We work around this issue by simply not checking the first character here. + */ + ASSERT(!memcmp(header->Signature+1, "SDT", 3)); bool extended = header->Signature[0] == 'X'; unsigned count = (header->Length - (unsigned)sizeof(struct SDT_Header)); count >>= extended ? 3 : 2;