How does the OS know the actual size of physical memory?

When the OS boots at the time the computer starts up, how does the OS know information about the hardware, is there any io instruction, or does the bootloader get information from the BIOS.

+6
source share
3 answers

The firmware of the motherboard (also called BIOS, ACPI or EFI) allows the OS to detect the physical display of RAM and ROM in the system.

For example, this is the result of booting Linux:

[ 0.000000] BIOS-provided physical RAM map: [ 0.000000] BIOS-e820: 0000000000000000 - 0000000000098c00 (usable) [ 0.000000] BIOS-e820: 0000000000098c00 - 00000000000a0000 (reserved) [ 0.000000] BIOS-e820: 00000000000e6000 - 0000000000100000 (reserved) [ 0.000000] BIOS-e820: 0000000000100000 - 00000000bfea0000 (usable) [ 0.000000] BIOS-e820: 00000000bfeae000 - 00000000bfeb0000 type 9 [ 0.000000] BIOS-e820: 00000000bfeb0000 - 00000000bfec0000 (ACPI data) [ 0.000000] BIOS-e820: 00000000bfec0000 - 00000000bfef0000 (ACPI NVS) [ 0.000000] BIOS-e820: 00000000bfef0000 - 00000000c0000000 (reserved) [ 0.000000] BIOS-e820: 00000000ffc00000 - 0000000100000000 (reserved) [ 0.000000] BIOS-e820: 0000000100000000 - 0000000c40000000 (usable) 
+9
source

An operating system loaded from a BIOS-based system requests the System Request Address Card using INT 0x15, AX = 0xE820.

A UEFI-based OS typically retrieves a physical memory card using the GetMemoryMap () interface.

+5
source

On computers, such as desktop or laptop PCs, the amount of memory is assigned by the OS using the BIOS or UEFI

+3
source

Source: https://habr.com/ru/post/914244/


All Articles