Page 1 of 1

GRUB memory map has little memory

Posted: Thu May 07, 2015 11:45 am
by shervingav
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: Select all

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.

Re: GRUB memory map has little memory

Posted: Thu May 07, 2015 2:43 pm
by gerryg400
The base address and length are 64 bit numbers. Are you treating them as such ?

Re: GRUB memory map has little memory

Posted: Fri May 08, 2015 8:33 am
by Combuster
Even if your real computer has 4GB of ram doesn't mean your emulator isn't still set to its default of 128MB.