How can I get the amount of available RAM?
How can I get the amount of available RAM?
I have an idea, but it can slow down the bootstrap process.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
- Alan Kay
Re: How can I get the amount of available RAM?
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.
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?
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.