OSDev.org

The Place to Start for Operating System Developers
It is currently Tue May 14, 2024 8:37 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: GRUB memory map has little memory
PostPosted: Thu May 07, 2015 11:45 am 
Offline

Joined: Sun May 11, 2014 6:19 am
Posts: 11
Location: Iran
Hi,
i am getting the memory map from grub and it seems most of my ram is either corrupted or reserved.
these are the addresses that grub gives me:( i have 4 GBytes of ram )
0x00000000 ------------> 0x0009FC00
0x00100000 ------------> 0x07FFE000

this is part of my code that gets memory map:

Code:
void get_ram(multiboot_info_t* mbd, unsigned int magic){
    if ( CHECK_BIT(mbd->flags, 6) ){
        uint32 addr = mbd->mmap_addr, len = mbd->mmap_length;
        memory_map_t* mmap = mbd->mmap_addr;
        ndosiz = 0;
        while(mmap < addr + len){
            struct Node_list nd; // just a simple pair
            if( mmap->type == 1 ){
                nod[nodsiz].s = mmap->base_addr_low; // Array for storing the addresses
                nod[nodsiz].t = mmap->base_addr_low + mmap->length_low;
                nodsiz++;
            }
            mmap = (memory_map_t*) ( (unsigned int)mmap + mmap->size + sizeof(unsigned int) );
        }
    }
}

hope someone can help me.

_________________
"Sometimes it is the people who no one imagines anything of, who do the things that no one can IMAGINE."
_Alan Turing


Top
 Profile  
 
 Post subject: Re: GRUB memory map has little memory
PostPosted: Thu May 07, 2015 2:43 pm 
Offline
Member
Member

Joined: Thu Mar 25, 2010 11:26 pm
Posts: 1801
Location: Melbourne, Australia
The base address and length are 64 bit numbers. Are you treating them as such ?

_________________
If a trainstation is where trains stop, what is a workstation ?


Top
 Profile  
 
 Post subject: Re: GRUB memory map has little memory
PostPosted: Fri May 08, 2015 8:33 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
Even if your real computer has 4GB of ram doesn't mean your emulator isn't still set to its default of 128MB.

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], SemrushBot [Bot] and 36 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