Page 1 of 1
How can I get the amount of available RAM?
Posted: Tue May 20, 2014 12:55 pm
by Roman
I have an idea, but it can slow down the bootstrap process.
Re: How can I get the amount of available RAM?
Posted: Tue May 20, 2014 1:03 pm
by Rusky
http://wiki.osdev.org/Detecting_Memory_(x86)
On BIOS systems you'll want to use int e820, which gives you a map of available memory. UEFI will give you a similar map as an argument to the bootloader.
Re: How can I get the amount of available RAM?
Posted: Tue May 20, 2014 3:57 pm
by sortie
Please read
Forum Rules. In particular, you are not following Rule 1, where you show you have searched the forums, the wiki and google. This is pretty basic osdev material and should be easy to find. Note that you usually don't really care how much memory is available, but rather want to know exactly which memory areas are usable (as they may not be a single chunk in physical memory). You get the memory map from the component that loaded you: If you use the BIOS, you get the memory map from the BIOS. If you use UEFI, you get the memory map from UEFI. If you use GRUB, you get the memory map from GRUB.