Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi , How do we get the size of RA

Status
Not open for further replies.

sarnath

Programmer
Dec 8, 2000
69
IN
Hi ,
How do we get the size of RAM installed ?

BIOS (40:13) seems to store a 16-bit value, which is a
1k mutiple... With this scheme, it can represent not more
than 2^26.
Sorry if i m wrong..

Is there any direct way of getting the amt of memory ??
 
INT 15 - SYSTEM - later PS/2s - RETURN MEMORY-MAP INFORMATION
AH = C7h
DS:SI -> user supplied memory map table (see #0355)
Note: call AH=C0h and examine bit 4 of feature byte 2 to check if this
function is supported
Return: CF set on error, clear if successful
SeeAlso: AH=C0h,AH=C9h,AH=D1h

Format of memory-map table structure:
Offset Size Description (Table 0355)
00h WORD length of table (excluding this word)
02h DWORD local memory between 1M and 16M, in 1K blocks
06h DWORD local memory between 16M and 4G, in 1K blocks
0Ah DWORD system memory between 1M and 16M, in 1K blocks
0Eh DWORD system memory between 16M and 4G, in 1K blocks
12h DWORD cacheable memory between 1M and 16M, in 1K blocks
16h DWORD cacheable memory between 16M and 4G, in 1K blocks
1Ah DWORD 1K blocks before start of non-system memory between 1M and 16M
1Eh DWORD 1K blocks before start of non-system memory between 16M and 4G
22h 2 DWORDs reserved




INT 15 - SYSTEM - GET EXTENDED MEMORY SIZE (286+)
AH = 88h
Return: CF clear if successful
AX = number of contiguous KB starting at absolute address 100000h
CF set on error
AH = status
80h invalid command (PC,PCjr)
86h unsupported function (XT,PS30)
Notes: TSRs which wish to allocate extended memory to themselves often hook
this call, and return a reduced memory size. They are then free to
use the memory between the new and old sizes at will.
the standard BIOS only returns memory between 1MB and 16MB; use AH=C7h
for memory beyond 16MB
not all BIOSes correctly return the carry flag, making this call
unreliable unless one first checks whether it is supported through
a mechanism other than calling the function and testing CF
SeeAlso: AH=87h,AH=C7h

 
Hi MisterNobody,
Thanx a lot for ur help. :)
Actually,i had written my own routine for calculating
memory size.The routine assumes a min of 2 MB. From 2MB,
i Start writing continously, until im unable to write any
more. At that stage, i decide upon memory size. Any way
i m glad to have this shortcut.
Thanx a lot
regards,
Sarnath
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top