OSDev.org
https://forum.osdev.org/

Getting total system memory.
https://forum.osdev.org/viewtopic.php?f=1&t=12370
Page 1 of 1

Author:  smbogan [ Thu Dec 07, 2006 4:08 pm ]
Post subject:  Getting total system memory.

I'm relatively sure this has been talked about before, but a search didn't get me anywhere.

I'm booting with GRUB straight into protected mode. What's an effective way of getting the total system memory?

Thanks for any help.

Author:  urxae [ Thu Dec 07, 2006 4:59 pm ]
Post subject: 

Did you read the Multiboot specification? Specifically, the section on the boot information format?

Author:  Walling [ Thu Dec 07, 2006 5:03 pm ]
Post subject: 

Since you use GRUB I agree with urxae. Use the multiboot information. Otherwise read How do I determine the amount of RAM? on OsFaq2.

Author:  smbogan [ Mon Dec 11, 2006 12:19 am ]
Post subject: 

Thanks, I got the info from the multiboot specification to work nicely. I'm just curious if anyone knows the following, in regaurds to the memory map structure:

Quote:
where `size' is the size of the associated structure in bytes, which can be greater than the minimum of 20 bytes. `base_addr_low' is the lower 32 bits of the starting address, and `base_addr_high' is the upper 32 bits, for a total of a 64-bit starting address. `length_low' is the lower 32 bits of the size of the memory region in bytes, and `length_high' is the upper 32 bits, for a total of a 64-bit length. `type' is the variety of address range represented, where a value of 1 indicates available ram, and all other values currently indicated a reserved area.


The multiboot specification says that the type number of 1 represents available. Does anyone know what 2-4 mean. I mean beyond the definition of reserved.

Thanks.

Author:  AJ [ Mon Dec 11, 2006 2:25 am ]
Post subject: 

Hi,

I think it's the same as in int15 ah=0xE820 (http://www.ctyme.com/intr/rb-1741.htm) - at least, this method and GRUB both seem to give me the same memory regions on both Bochs and VPC...

HTH
Adam

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/