I wrote and it get compiled successfully but when I used qemu to test it and get incohrent numbers enter image description here
static UINT64 MemSizeB = 0;
for (unsigned int i = 0; i < MapEntries; i++){
EFI_MEMORY_DESCRIPTOR *desc = (EFI_MEMORY_DESCRIPTOR*)(Map + (i * DescSize));
MemSizeB += desc->NumberOfPages * 4096;
}
Print(L"Size of memory: %dn", MemSizeB);
I hope that I will get help