Counting memory using grub
Posted: Sun Feb 24, 2008 3:42 pm
How can I count memory using the multiboot header leaved by grub?
I've always believed that mb->mem_upper + mb->mem_lower = total memory. But it isn't there is always a difference of 1 - 2 MiBs
Then I've tried using the memory map of grub. I've printed the results:
But I don't what that number means[/code]
I've always believed that mb->mem_upper + mb->mem_lower = total memory. But it isn't there is always a difference of 1 - 2 MiBs
Then I've tried using the memory map of grub. I've printed the results:
Code: Select all
size: 0x14; base_addr_low: 0x9FC00; base_addr_high: 0x0: length_low: 0x400; length_high: 0x0; type: 0x2
size: 0x14; base_addr_low: 0xE8000; base_addr_high: 0x0: length_low: 0x18000; length_high: 0x0; type: 0x2
size: 0x14; base_addr_low: 0x100000; base_addr_high: 0x0: length_low: 0x1EF0000; length_high: 0x0; type: 0x1
size: 0x14; base_addr_low: 0x1FF0000; base_addr_high: 0x0: length_low: 0x10000; length_high: 0x0; type: 0x3
...