Octocontrabass wrote:
The offset into the bitmap indicates the address of memory, so your bitmap needs to be big enough to cover all addresses that can be free memory. The amount of memory is irrelevant. If you have one page of usable memory at address 0 and one page of usable memory at address 0x10000, your bitmap needs to cover all addresses between those as well.
In my memory map all entries are within what I have installed in my emulator(so they all fit in 256mb), but the last entry is at address after 4 billion(which means that it is at 4GB), so should I count the last entry anyway, by the way it is marked as reserved in the memory map?
The bitmap size should be calculated not by the sum sizes of all entries in memmap divided by 4096. But instead the bitmap size should be determined by the end(base+size-1) of highest entry - start of lowest entry and then divided by 4096, am I right?
If the answer to the previous question is yes, then how do I know that it is really the size of RAM if memory map can have gaps as you said?
You said that the bitmap should be for more entries then installed RAM if there are some free memory at the start and in the end(beyond range of installed RAM), but if there is only reserved RAM that is beyond the installed RAM, then should the bitmap still be that big?
If I should ignore RAM beyond what I have installed that is reserved, then how should I calculate amount of installed RAM?