Page 1 of 1

Problem with Memory detection

Posted: Wed Dec 18, 2002 6:58 am
by Matze2002
Hi,
is use this source code to detect the memory size:

   xor   eax, eax
   mov   ah, 0x88
   int   0x15
   add   eax, 1024   ; 1024 KB == 1 MB
   mov   [mem_size_kbytes], eax

The problem is, when the memory is higher than 64 MB, the size is wrong. How can i dectect the memory correct in Real Mode ?

Re:Problem with Memory detection

Posted: Thu Dec 19, 2002 7:31 am
by Matze2002
Hi,
i know the problem, i can't detect more than 64
MB with using interrupt 15. How can i detect more than 64 MB in Real Mode ?

Please help me
Matze

Re:Problem with Memory detection

Posted: Thu Dec 19, 2002 8:12 am
by Curufir
Use 88h as a last ditch effort (At which point it's probably easier to do the direct probing thing). On newer processors get the BIOS to return a memory map (Then figure out how to read one ;)). Function 802 on int 15 should do the trick I think. Take a look a Ralf Brown's interrupt list for details.

This is actually far more useful than direct probing as it will give you any holes/reserved sections of memory as well without trampling on anything.