RSDP: Difference between revisions

781 bytes added ,  29 days ago
m
Bot: Replace deprecated source tag with syntaxhighlight
[unchecked revision][unchecked revision]
m (s/dword/uint32_t/g)
m (Bot: Replace deprecated source tag with syntaxhighlight)
 
(17 intermediate revisions by 10 users not shown)
Line 1:
{{ACPI}}
 
'''RSDP''' (Root System Description Pointer) is a data structure used in the [[ACPI]] programming interface.
 
In ACPI Version 1.0 it has this structure:
 
<sourcesyntaxhighlight lang="c">
struct RSDPDescriptorRSDP_t {
char Signature[8];
uint8_t Checksum;
Line 10 ⟶ 12:
uint8_t Revision;
uint32_t RsdtAddress;
} __attribute__ ((packed));
}
</syntaxhighlight>
</source>
 
since Version 2.0 it has been extended, and the following new fields have been added:
 
<sourcesyntaxhighlight lang="c">
struct RSDPDescriptor20XSDP_t {
char Signature[8];
RSDPDescriptor firstPart;
uint8_t Checksum;
char OEMID[6];
uint8_t Revision;
uint32_t RsdtAddress; // deprecated since version 2.0
 
uint32_t Length;
Line 23 ⟶ 29:
uint8_t ExtendedChecksum;
uint8_t reserved[3];
} __attribute__ ((packed));
};
</syntaxhighlight>
</source>
==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 0x040E0x40E), or in the memory region from 0x000E0000 to 0x000FFFFF (the main [[BIOS]] area below 1 MB). To find the table, the Operating System has to find the "RSD PTR " string (notice the last space character) in one of the two areas. This signature is always on a 16 byte boundary.
 
If you're using UEFI, you can find it somewhere in EFI_SYSTEM_TABLE. Thus, there's no need for searching the RAM.
 
'''Note''': The standard methods to find the RSDP may not work on UEFI systems. Because of that, finding it inside EFI_SYSTEM_TABLE is the correct and reliable method (see ACPI 6.2 section 5.2.5.2 'Finding the RSDP on UEFI Enabled Systems').
 
When booting with a multiboot2 compliant loader, a copy of the RSDP is contained in the ACPI new RSDP or ACPI old RSDP tag respectively.
 
==Validating the RSDP==
Line 34 ⟶ 46:
 
===Detecting ACPI Version===
The ACPI Version can be detected using the Revision field in the RSDP. If this field contains 0, then ACPI Version 1.0 is used. 1For standssubsequent forversions (ACPI Versionversion 2.0 to 6.1), the value 2 foris used [http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf]. The exact version of ACPI Versioncan 3.0,be anddeduced sovia on..the [[FADT]] table.
 
===Checksum validation===
Line 47 ⟶ 59:
The value to add to all the other bytes (of the Version 1.0 table) to calculate the Checksum of the table. If this value added to all the others and casted to byte isn't equal to 0, the table must be ignored.
==== OEMID ====
The specification says: "An OEM-supplied string that identifies the OEM".
 
==== Revision ====
The revision of the ACPI. Larger revision numbers are backward compatible to lower revision numbers. See [[#Detecting ACPI Version|Detecting ACPI Version]] for further information.
Line 57 ⟶ 70:
The size of the entire table since offset 0 to the end.
==== Xsdt Address ====
64-bit physical address of the [[XSDT]] table. If you detect ACPI Version 2.0 you should use this table instead of RSDT even on x86IA-32, casting the address to uint32_t.
==== Extended Checksum ====
This field is used to calculate the checksum of the entire table, including both checksum fields.
 
==== Reserved ====
3 bytes to be ignored in reading and that must not be written.
 
== What's next? ==
Well, you should now parse the [[RSDT]] (or [[XSDT]]).
 
[[Category:ACPI]]