Counting Extended Ram

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
deus_the_programmer

Counting Extended Ram

Post by deus_the_programmer »

hi i want to show the full amount of extended ram in my computer system.
this is the code i have got so far, but it does not show the correct amout on my system,i have 80mb and it shows it as: -61.


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;
}

the base memory count shows 640k (which is fine, it's just the extended amout that is broken.)


PLEASE help me correct this code.

ed.
Post Reply