15.1. INT 15H, E820H - Query System Address Map

This interface is used in real mode only on IA-PC-based systems and provides a memory map for all of the installed RAM, and of physical memory ranges reserved by the BIOS. The address map is returned through successive invocations of this interface; each returning information on a single range of physical addresses. Each range includes a type that indicates how the range of physical addresses is to be treated by the OSPM.

If the information returned from E820 in some way differs from INT-15 88 or INT-15 E801, the information returned from E820 supersedes the information returned from INT-15 88 or INT-15 E801. This replacement allows the BIOS to return any information that it requires from INT-15 88 or INT-15 E801 for compatibility reasons. For compatibility reasons, if E820 returns any AddressRangeACPI or AddressRangeNVS memory ranges below 16 MiB, the INT-15 88 and INT-15 E801 functions must return the top of memory below the AddressRangeACPI and AddressRangeNVS memory ranges.

The memory map conveyed by this interface is not required to reflect any changes in available physical memory that have occurred after the BIOS has initially passed control to the operating system. For example, if memory is added dynamically, this interface is not required to reflect the new system memory configuration.

Table 15.2 Input to the INT 15h E820h Call

Register

Contents

Description

EAX

Function Code

E820h

EBX

Continuation

Contains the continuation value to get the next range of physical memory. This is the value returned by a previous call to this routine. If this is the first call, EBX must contain zero.

ES:DI

Buffer Pointer

Pointer to an Address Range Descriptor structure that the BIOS fills in.

ECX

Buffer Size

The length in bytes of the structure passed to the BIOS. The BIOS fills in the number of bytes of the structure indicated in the ECX register, maximum, or whatever amount of the structure the BIOS implements. The minimum size that must be supported by both the BIOS and the caller is 20 bytes. Future implementations might extend this structure.

EDX

Signature

‘SMAP’ Used by the BIOS to verify the caller is requesting the system map information to be returned in ES:DI.

Table 15.3 Output from the INT 15h E820h Call

Register

Contents

Description

CF

Carry Flag

Non-Carry - Indicates No Error

EAX

Signature

‘SMAP.’ Signature to verify correct BIOS revision.

ES:DI

Buffer Pointer

Returned Address Range Descriptor pointer. Same value as on input.

ECX

Buffer Size

Number of bytes returned by the BIOS in the address range descriptor. The minimum size structure returned by the BIOS is 20 bytes.

EBX

Continuation

Contains the continuation value to get the next address range descriptor. The actual significance of the continuation value is up to the discretion of the BIOS. The caller must pass the continuation value unchanged as input to the next iteration of the E820 call in order to get the next Address Range Descriptor. A return value of zero means that this is the last descriptor. Note: the BIOS can also indicate that the last descriptor has already been returned during previous iterations by returning the carry flag set. The caller will ignore any other information returned by the BIOS when the carry flag is set.

Table 15.4 Address Range Descriptor Structure

Offset in Bytes

Name

Description

0

BaseAddrLow

Low 32 Bits of Base Address

4

BaseAddrHigh

High 32 Bits of Base Address

8

LengthLow

Low 32 Bits of Length in Bytes

12

LengthHigh

High 32 Bits of Length in Bytes

16

Type

Address type of this range

20

Extended Attributes

See the Extended Attributes for Address Range Descriptor Structure

The BaseAddrLow and BaseAddrHigh together are the 64-bit base address of this range. The base address is the physical address of the start of the range being specified.

The LengthLow and LengthHigh together are the 64-bit length of this range. The length is the physical contiguous length in bytes of a range being specified.

The Type field describes the usage of the described address range as defined in Address Range Types.

Table 15.5 Extended Attributes for Address Range Descriptor Structure

Bit

Mnemonic

Description

0

Reserved

Reserved, must be set to 1.

2:1

Reserved

Reserved, must be set to 0.

3

AddressRangeErrorLog

If set, the address range descriptor represents memory used for logging hardware errors.

31:4

Reserved

Reserved for future use.

Note

Bit [1] and [2] above were deprecated as of ACPI 6.1. Bit [3] is used only on PC-AT BIOS systems to pinpoint the error log in memory. On UEFI-based systems, either UEFI Hardware Error Record HwErrRec#### runtime UEFI variable interface or the Error Record Serialization Actions 0xD, 0xE and 0xF for the APEI ERST interface must be implemented for the error logs.