Work around buggy bochs ACPI tables
This commit is contained in:
parent
deab1322c2
commit
83b6fba171
2 changed files with 6 additions and 2 deletions
2
bochsrc
2
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
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue