RSDT: Difference between revisions

From OSDev Wiki
Jump to navigation Jump to search
Line 15: Line 15:
struct ACPISDTHeader {
struct ACPISDTHeader {
char Signature[4];
char Signature[4];
(削除) DWORD (削除ここまで)Length;
(追記) uint32_t (追記ここまで)Length;
(削除) BYTE (削除ここまで)Revision;
(追記) uint8_t (追記ここまで)Revision;
(削除) BYTE (削除ここまで)Checksum;
(追記) uint8_t (追記ここまで)Checksum;
char OEMID[6];
char OEMID[6];
char OEMTableID[8];
char OEMTableID[8];
(削除) DWORD (削除ここまで)OEMRevision;
(追記) uint32_t (追記ここまで)OEMRevision;
(削除) DWORD (削除ここまで)CreatorID;
(追記) uint32_t (追記ここまで)CreatorID;
(削除) DWORD (削除ここまで)CreatorRevision;
(追記) uint32_t (追記ここまで)CreatorRevision;
}
}
</source>
</source>
Line 30: Line 30:
struct RSDT {
struct RSDT {
struct ACPISDTHeader h;
struct ACPISDTHeader h;
(削除) DWORD (削除ここまで)PointerToOtherSDT[(h.Length - sizeof(h)) / 4];
(追記) uint32_t (追記ここまで)PointerToOtherSDT[(h.Length - sizeof(h)) / 4];
}
}
</source>
</source>
Line 37: Line 37:
struct XSDT {
struct XSDT {
struct ACPISDTHeader h;
struct ACPISDTHeader h;
(削除) QWORD (削除ここまで)PointerToOtherSDT[(h.Length - sizeof(h)) / 8];
(追記) uint64_t (追記ここまで)PointerToOtherSDT[(h.Length - sizeof(h)) / 8];
}
}
</source>
</source>

Revision as of 16:09, 10 March 2011

RSDT (Root System Description Table) is a data structure used in the ACPI programming interface. This table contains pointers to all the other System Description Tables.

Detecting the RSDT

To find the RSDT you need first to locate and check the RSDP, then use the RsdtPointer for ACPI Version < 2.0 an XsdtPointer for any other case.

The ACPI standards state that an OS that complies with ACPI version 2.0 or later should use the XSDT instead of the RSDT, however I personally doubt that there is a difference on 80x86 computers. AFAIK the XSDT itself was introduced for Itanium's (IA64) and other 64 bit computers where it's likely that the BIOS (and ACPI tables) are above 4 GB. On 80x86 it's likely that the RSDT and the XSDT both point to the same tables below 4 GB for compatibility reasons (it doesn't make sense to have 2 versions of the same tables) -- Brendan.

Validating the RSDT

You only need to sum all the bytes in the table and compare the result to 0.

Structure

The RSDT is the main System Description Table. However there are many kinds of SDT. All the SDT may be split into two parts. One (the header) which is common to all the SDT an another (data) which is different for each table. The structure of the header is:

structACPISDTHeader{
charSignature[4];
uint32_tLength;
uint8_tRevision;
uint8_tChecksum;
charOEMID[6];
charOEMTableID[8];
uint32_tOEMRevision;
uint32_tCreatorID;
uint32_tCreatorRevision;
}

In case you used RsdtPointer, the complete table structure is:

structRSDT{
structACPISDTHeaderh;
uint32_tPointerToOtherSDT[(h.Length-sizeof(h))/4];
}

If you instead used the XsdtPointer, then the table is:

structXSDT{
structACPISDTHeaderh;
uint64_tPointerToOtherSDT[(h.Length-sizeof(h))/8];
}

How to use

Well, suppose you want to find the FADT. The FADT, being a SDT has a ACPISDTHeader. It's signature is "FACP". You may use this code:

void*findFACP(void*RootSDT){
RSDT*rsdt=(RSDT*)RootSDT;
intn=(rsdt->h.Length-sizeof(rsdt->h))/4;
for(inti=0;i<n;i++){
ACPISDTHeader*h=(ACPISDTHeader*)rsdt->PointerToOtherSDT[i];
if(!strncmp(h->Signature,"FACP"))
return(void*)h;
}
returnNULL;
}

What's next?

You should now parse each table pointed by the RSDP. (Probably you will need only the FADT, the SSDT and the MADT

Retrieved from "https://wiki.osdev.org/index.php?title=RSDT&oldid=11232"