Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

memory detection routines need debugging

2 views
Skip to first unread message

deus the programmer

unread,
Dec 20, 2009, 10:05:02 AM12/20/09
to
hello i have the following c code to retrieve the extended memory in a
pc however it wont detect up to 4GBs can someone help me rewite it to
detect up to 4gb of ram? thanks ed.

int get_system_memory(void)
{
int base;
int ext;
base = nvread(0x15) | (nvread(0x16) << 8);
ext = nvread(0x17) | (nvread(0x18) << 8);
cprintf("\n\r%d Base Memory, %d Extended Memory", base, ext);
return 0;
}

Rugxulo

unread,
Dec 21, 2009, 3:39:03 AM12/21/09
to
Hi,

On Dec 20, 9:05 am, deus the programmer


<deustheprogram...@googlemail.com> wrote:
>
> hello i have the following c code to retrieve the extended memory in a
> pc however it wont detect up to 4GBs can someone help me rewite it to
> detect up to 4gb of ram? thanks ed.

Maybe this will help? Else start digging through DPMI hosts / DOS
extenders (e.g. HDPMI32):

http://wiki.osdev.org/How_Do_I_Determine_The_Amount_Of_RAM
http://www.japheth.de/HX.html

0 new messages