GRUB memory map has little memory
Posted: Thu May 07, 2015 11:45 am
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:
hope someone can help me.
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) );
}
}
}