OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Apr 27, 2024 5:08 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Getting total system memory.
PostPosted: Thu Dec 07, 2006 4:08 pm 
Offline
Member
Member

Joined: Tue Nov 21, 2006 3:17 pm
Posts: 29
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 4:59 pm 
Offline
Member
Member

Joined: Sun Jul 30, 2006 8:16 am
Posts: 149
Location: The Netherlands
Did you read the Multiboot specification? Specifically, the section on the boot information format?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 5:03 pm 
Offline
Member
Member
User avatar

Joined: Mon Dec 04, 2006 6:06 am
Posts: 158
Location: Berlin, Germany
Since you use GRUB I agree with urxae. Use the multiboot information. Otherwise read How do I determine the amount of RAM? on OsFaq2.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 11, 2006 12:19 am 
Offline
Member
Member

Joined: Tue Nov 21, 2006 3:17 pm
Posts: 29
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 11, 2006 2:25 am 
Offline
Member
Member
User avatar

Joined: Sun Oct 22, 2006 7:01 am
Posts: 2646
Location: Devon, UK
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], eekee, Majestic-12 [Bot] and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group