Click to See Complete Forum and Search --> : Read the Total System RAM


k.vamsi
February 23rd, 2005, 11:48 PM
Hi

i am facing a problem like how to read system physical RAM size from the BIOS.
can anyone please suggest me.

regards

vamsi.k

japheth
February 24th, 2005, 05:52 AM
use

int 15h, ax=e820h

or (for older bioses):

int 15h, ax=e801h

for details see RBIL

k.vamsi
February 26th, 2005, 06:08 AM
Hi

ok fine but the problem is for 16 bit i got Total Memory Size using following program.

outportbyte(0X70,0X15);
MEMORYSIZE = inportbyte(0x71); //retrieve low byte
outportbyte(0X70,0X16);
MEMORYSIZE += inportbyte(0x71) << 8; //retrive high byte

but problem is i want to read 32 bit Total ram size
what is meaning of RBIL

Hobson
February 26th, 2005, 06:13 AM
'RBIL' stands for Ralph Brown's Intterupt List, great resource for all assembly programmers.

For 32-bit Windows program use GlobalMemoryStatus or GlobalMemoryStatusEx API function

Hob

japheth
February 26th, 2005, 06:54 AM
I attached an (old) source (MASM) showing how to use int 15, ax=e801h

it wont compile since the includes are missing, but you may get the idea.