Parsing ACPI tables

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
computafreak
Member
Member
Posts: 76
Joined: Sun Dec 14, 2008 1:53 pm

Parsing ACPI tables

Post 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?
User avatar
i586coder
Member
Member
Posts: 143
Joined: Sat Sep 20, 2008 6:43 am

Re: Parsing ACPI tables

Post 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
Distance doesn't make you any smaller,
but it does make you part of a larger picture.
computafreak
Member
Member
Posts: 76
Joined: Sun Dec 14, 2008 1:53 pm

Re: Parsing ACPI tables

Post 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
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Parsing ACPI tables

Post 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
thooot
Member
Member
Posts: 30
Joined: Sun Jun 01, 2008 11:20 am

Re: Parsing ACPI tables

Post 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.
computafreak
Member
Member
Posts: 76
Joined: Sun Dec 14, 2008 1:53 pm

Re: Parsing ACPI tables

Post 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
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Parsing ACPI tables

Post 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
Post Reply