RSDP
The RSDP (Root System Description Pointer) is a data structure in the ACPI specification.
| ACPI |
|---|
| Fixed Tables |
| Differentiated Tables |
| Tools/Libs |
Structure
The structure varies depending on the revision. Later revisions are backward compatible with earlier revisions.
// structure for revision 0 (version 1.0)
struct RSDP_t {
char Signature[8];
uint8_t Checksum;
char OEMID[6];
uint8_t Revision;
uint32_t RsdtAddress;
} __attribute__ ((packed));
// structure for revision 2 (version 2.0+)
struct XSDP_t {
char Signature[8];
uint8_t Checksum;
char OEMID[6];
uint8_t Revision;
uint32_t RsdtAddress; // deprecated since version 2.0
uint32_t Length;
uint64_t XsdtAddress;
uint8_t ExtendedChecksum;
uint8_t reserved[3];
} __attribute__ ((packed));
Fields
Signature
An 8 byte magic number used for locating the RSDP, containing RSD PTR.
Checksum
A byte used to verify the first 20 bytes of the RSDP.
OEMID
An OEM-supplied string that identified the OEM.
Revision
The RSDP revision, used for determining which fields are available.
RSDT Address
A 32-bit physical address pointing to the RSDT.
Length
The size of the RSDP.
XSDT Address
A 64-bit physical address pointing to the XSDT. If the revision is at least 2, the XSDT should be used regardless of architecture, as the RSDT was deprecated.
Extended Checksum
A checksum used for the entire table.
Locating
On IA-PC systems, the RSDP is either located within the first 1 KiB of the EBDA (Extended BIOS Data Area; a 2 byte address to the start of it is located at 0x40E), or in the memory region from 0x000E0000 to 0x000FFFFF. To find the table, the operating system has to find the RSD PTR signature (notice the last space character) in one of the two areas. The signature always starts on a 16 byte boundary.
On UEFI systems, the RSDP is located in the EFI Configuration Table.
When using a Multiboot 2 compliant loader, a copy of the RSDP is contained in the ACPI new RSDP or ACPI old RSDP tag respectively.
Validating
Once the RSDP has been located, the checksum for the first 20 bytes should be checked. If valid, the revision should be checked, and if it's at least 2, a checksum should be calculated using the Length field.
To verify the checksum, all bytes checked need to add (as a byte, with overflow) up to 0.
Usage
The RSDP points to either the RSDT or XSDT, which needs to be parsed in order to do anything with the ACPI.