Parsing Memory Card, which gave GRUB.
Posted: Fri Oct 02, 2015 1:32 am
Hello, I for the first time on your forum, and I have a terrible English =)
I want to know why my code does not work, which must be considered a common memory map provided by GRUB
I want to know why my code does not work, which must be considered a common memory map provided by GRUB
Code: Select all
typedef struct
{
udword size;
uqword base_addr;
uqword lengthl;
udword type;
} MMAP_UNIT;
MMAP_UNIT *mmap_unit;
udword k_mem_size;
int k_mem_init (MI_INF_STRUCT *MI) //MI - pointer to MultiBoot Information structure
{
mmap_unit = MI->mmap_addr;
while (mmap_unit->type)
{
k_mem_size += ((mmap_unit->lengthl)-(mmap_unit->base_addr)) ;
mmap_unit += ((mmap_unit->size) + 4);
}
}