Problem with Memory detection

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Matze2002

Problem with Memory detection

Post 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 ?
Matze2002

Re:Problem with Memory detection

Post 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
Curufir

Re:Problem with Memory detection

Post 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.
Post Reply