BIOS for the IBM Personal Computer and compatibles provides a set of routines that can be used by operating system or applications to get the memory layout.
If some error has happened, the routine returns with CF (Carry Flag) set to 1.
If no error, the routine returns with CF clear and the state of registers is described as following: BIOS Function: INT 0x15, AX=0xE820 - GET SYSTEM MEMORY MAP:[2] Input: SMAP buffer structure: How used: The operating system shall allocate an SMAP buffer in memory (20 bytes buffer).
If no error, the interrupt call returns with CF clear and the buffer filled with data representing first region of the memory map.
EBX is updated by BIOS so that when the OS calls the routine again, The next region is returned in the buffer.