2 ACPI RSDP tables in bochs

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
AlfaOmega08
Member
Member
Posts: 226
Joined: Wed Nov 07, 2007 12:15 pm
Location: Italy

2 ACPI RSDP tables in bochs

Post 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
Please, correct my English...
Motherboard: ASUS Rampage II Extreme
CPU: Core i7 950 @ 3.06 GHz OC at 3.6 GHz
RAM: 4 GB 1600 MHz DDR3
Video: nVidia GeForce 210 GTS... it sucks...
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: 2 ACPI RSDP tables in bochs

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Masterkiller
Member
Member
Posts: 153
Joined: Sat May 05, 2007 6:20 pm

Re: 2 ACPI RSDP tables in bochs

Post 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.
ALCA OS: Project temporarity suspended!
Current state: real-mode kernel-FS reader...
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: 2 ACPI RSDP tables in bochs

Post 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++).
Post Reply