Mail Archives: djgpp/1999/10/04/16:41:32
On Mon, 4 Oct 1999, Prashant TR wrote:
> Is there any means by which I can find out my total
> physical memory size other than through DPMI ?
Not in general, at least I don't know how. BIOS can help, but only if
the total amount of memory is less than 64MB. XMS calls can help, but by
the time your DJGPP program runs, the DPMI host might have taken all or
part of the extended memory to itself, so you won't see the true number.
Why do you need this? Perhaps your real problem could be solved by other
means?
> I find
> that some DPMI hosts like WINDPMI lie when I ask for
> this information ? Ok. At least, how do I know that
> I'm running CWSDPMI (from my program) ?
You could walk the DOS memory chain and look for CWSDPMI's copyright
string.
> I mapped the entire extended memory (my RAM size -
> 1M) to some variable "x". I'm using nearptr. But I get
> a SIGSEGV when I try to access the address
> x[__djgpp_base_address].
Please post a short complete test program that shows how do you do this.
It is possible that you didn't do everything to allow access to all
memory.
> I know it's in use by the
> program code, but is there a work around to this ?
Work-around for what? If you did everything correctly, you should be
able to access the program's code without a SIGSEGV.
- Raw text -