Page 1 of 1

Parsing ACPI tables

Posted: Tue Jun 02, 2009 1:20 pm
by computafreak
I've been fairly busy on my OS over the past few days, and have got to the point where I want to parse the ACPI tables. I've been reading the ACPI specifications, and on page 108, section 5.2, it implies that the description tables are sequential in memory. Is this correct? Can I get a pointer to the System Description Table Header by getting the RSDP's address in memory and adding sizeof(RSDP), and so on?

Re: Parsing ACPI tables

Posted: Tue Jun 02, 2009 1:30 pm
by i586coder
Hi,

i worked in this module in my kernel but
i gave up ,because there is things more important in my opinion such memory manager, GUI, etc...

but you can take look in this URL,maybe useful for you
http://sourceforge.net/projects/acpi/

CheerS,
a.T.d

Re: Parsing ACPI tables

Posted: Tue Jun 02, 2009 2:56 pm
by computafreak
Thanks for that link, I've been looking through it for a little while now. It'll be very good further reading tomorrow morning, when I can put a fresh pair of eyes over it. From what I can see, the tables do indeed to appear consecutively in memory; this seems to be right, but I could do with a more authoritative voice on this

Re: Parsing ACPI tables

Posted: Wed Jun 03, 2009 9:19 am
by jal
computafreak wrote:From what I can see, the tables do indeed to appear consecutively in memory; this seems to be right, but I could do with a more authoritative voice on this
Did you check out Intel's reference implementation (ACPICA)?


JAL

Re: Parsing ACPI tables

Posted: Wed Jun 03, 2009 9:56 am
by thooot
Where does it imply the tables are sequential in memory? In section 5.2.4 it says (emphasis mine):

The OS locates that Root System Description Table by following the pointer in the Root
System Description Pointer structure. The Root System Description Table, shown in Table 5-
4, starts with the signature ‘RSDT,’ followed by an array of physical pointers to other System
Description Tables that provide various information on other standards defined on the current
system.

It gives you the physical address of the tables, you should should use this information to find the tables and you shouldn't make any assumptions about where they are located in memory. Even if right now the tables are sequential, unless this is explicitly stated you shouldn't depend on it.

Re: Parsing ACPI tables

Posted: Thu Jun 04, 2009 3:21 am
by computafreak
jal: No, I've not looked at that yet, I'll download it in a few minutes
thooot: I made the mistake of skim-reading it. I saw the list of tables and assumed that they would be sequential in memory. Having looked at the source code from the first link I was given, rereading the specification thoroughly, and a little bit of experimentation, I worked out that they point to one another (i.e FACP points to DSDT and FACS). I've got the MADT completely parsed now, and I'm working on the other tables. Thanks for the definitive answer though

Re: Parsing ACPI tables

Posted: Thu Jun 04, 2009 3:26 am
by jal
computafreak wrote:jal: No, I've not looked at that yet, I'll download it in a few minutes
It's worth looking at. Even if you are making your own parser and interpreter, it's good to have a reference implementation when you're stuck or run into weird things the specs don't tell you.


JAL