Page 1 of 1

determing physical memory of system

Posted: Wed Mar 24, 2004 12:00 am
by Tough
hi,
I have a question, how can i find the physical memory of a system. I'm using MASM, and i have tried BIOS interrupts but in vain. I tried int 12 but that give just 650K. I have tried int 15h service 88,E801 and E820h.E820 should work but i guess i am not able to write  good code to that. I have tried all the codes on net but none helps me. I desparetly need help, i'm very curious to know. Any help will be highly appreciated.
Waiting eagerly for any help
Tough

RE:determing physical memory of system

Posted: Thu Mar 25, 2004 12:00 am
by Moose
1. Probe BIOS ints - This is really the only good way - problems with standards however, some bioses dont support certain bios ints.
2. Probe CMOS - Gives some indication of ram, however, only upto 64mb i think, or 48mb i can not remember.
3. Use a memory map provided by a multiboot bootloader - the memory map would have come from the bios ints however.
4. Check each mb until you find an address that is not writable - so

write 1 to 1mb
read 1mb
is it 1?
If not then 1mb is not available
else inc 1mb
write 1 to 2mb
and so on....

this has problems however, you could write to memory holes (parts of memory used by devices) that almost all pcs have and you dont know exactly what effect that might have on the hardware.

Moose.