RSDP

From OSDev.wiki
Revision as of 01:14, 15 February 2007 by osdev>Jhawthorn
Jump to navigation Jump to search

RSDP (Root System Description Pointer) is a data structure used in the ACPI programming interface. It is set out like this (for ACPI Version 1.0):

struct RSDPDescriptor
{
 char signature[8];
 BYTE checkSum;
 char oemID[6];
 BYTE revision;
 DWORD rsdtAddress;
}

and for version 2.0:

struct RSDPDescriptor20
{
 char signature[8];
 BYTE checkSum;
 char oemID[6];
 BYTE revision;
 DWORD rsdtAddress;

 DWORD length;
 QWORD xsdtAddress;
 BYTE extCheckSum;
 BYTE reserved[3];
};

Detecting the RSDP

The RSDP is either located within the first 1 KB of the EBDA (Extended BIOS Data Area) (a 2 byte real mode segment pointer to it is located at 0x040E), or in the memory region from 0x000E0000 to 0x000FFFFF (the main BIOS area below 1 MB). The signature (for both tables) should be "RSD PTR " (note: this ends with a space character that should not be overlooked), which is useful when scanning for the structure in memory. The step of the memory scan should be 16 (i.e. the RSDP always begins on a 16 byte boundary).

Validating the RSDP

This page is a work in progress.
This page may thus be incomplete. Its content may be changed in the near future.

If the RSDP revision field is zero, it is ACPI version 1.0 and the first structure should be used, otherwise it is the second structure that should be used, as that has data about the XSDT, an extended RSDT.

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.

Before the RSDP is relied upon you should check that the checksum is valid. For ACPI 1.0 (the first structure) you add up every byte in the structure and make sure the lowest byte of the result is equal to zero. For ACPI 2.0 and later you'd do exactly the same thing for the original (ACPI 1.0) part of the second structure, and then do it again for the fields that are part of the ACPI 2.0 extension.

TODO: Needs more formatting and explaining