octacone wrote:
I have a quick question? Does GRUB "steal" 513KB (449KB - other emulator) of memory?
Emulator memory: 2048MB (2097152KB). Lower Memory: 639KB. Upper Memory: 2096000KB. Total Memory: 2096639KB ==> 2047MB.
Where did the last megabyte go? Can I safely tell my memory manager that 2048MB are available?
you cannot safely tell your memory manager any amount of memory, actual RAM memory (especially on real hardware, though somewhat less common on emulators) is almost never contiguous -- always use the memory map, and instead of telling your memory manager how much memory exists, give your memory manager a list of available addresses
note: some of this missing memory might be in the area between the lower 639k and the upper 2096000k... the lower number is obviously already deducting some memory for firmware use (otherwise the number should be 640k rather than 639k) -- and if all the memory is laid out sequentially from address 0 (common on modern systems, though some older systems try to "remap" it to higher addresses) then about 384k of memory is hidden underneath the ROM region reserved for system and option ROMs between the lower and upper memory areas -- also the memory between 15MB and 16MB may not be usable (even if actual ram is located there, you will loose and be unable to use that memory on some systems which reserve that memory region for hardware use)
also note, some of that memory is used by the firmware for special tables and things that the OS cannot touch without destroying the computer (even after you take control of the system, the firmware continues to operate without your knowledge or intervention, and it might need some of that memory)
let me reiterate: if you are retrieving a total amount of memory instead of properly parsing the memory map, you can destroy the computer, this should never be done, it is dangerous to do, always always use the memory map