Page 1 of 1

2 ACPI RSDP tables in bochs

Posted: Sun Dec 21, 2008 4:59 pm
by AlfaOmega08
Hi. I'm trying to write ACPI code for my OS.
I wrote a simple function to find the RSDP table using the Anchor string "RDS PTR ". My function is (i'm in higher half)

Code: Select all

void acpi_init() {
	char *sign;

	for (sign = 0xC00E0000; sign <= 0xC00FFFFF; sign++) {
		if (!strncmp(sign, "RSD PTR ", 8)) {
			kprintf("Found at %x\n", (dword) sign);
		}
	}
}
My code returns two tables at 0xC00E1ECF and at 0xC00FB970.
Which one should I use. Is this a bochs bug or a my code bug?

Thanks

Re: 2 ACPI RSDP tables in bochs

Posted: Sun Dec 21, 2008 6:53 pm
by Brendan
Hi,
AlfaOmega08 wrote:My code returns two tables at 0xC00E1ECF and at 0xC00FB970.
ACPI 3.0 wrote:5.2.5.1 Finding the RSDP on IA-PC Systems
OSPM finds the Root System Description Pointer (RSDP) structure by searching physical memory ranges on 16-byte boundaries for a valid Root System Description Pointer structure signature and checksum match as follows:
  • The first 1 KB of the Extended BIOS Data Area (EBDA). For EISA or MCA systems, the EBDA can be found in the two-byte location 40:0Eh on the BIOS data area.
  • The BIOS read-only memory space between 0E0000h and 0FFFFFh.
I'm guessing the table at 0xC00E1ECF isn't on a 16-byte boundary (and the checksum probably doesn't match either)...


Cheers,

Brendan

Re: 2 ACPI RSDP tables in bochs

Posted: Mon Dec 22, 2008 4:21 pm
by Masterkiller
Probably a bug in your code, but it is possible case that you have 2 copies of the main table one for 32-bit and one for 64-bit.

Re: 2 ACPI RSDP tables in bochs

Posted: Mon Dec 22, 2008 4:27 pm
by 01000101
I doubt it, it is far more likely that his code to find the entry point doesn't search on a 16-byte boundary (pos += 16, instead of pos++).