Mail Archives: djgpp-workers/1996/10/08/09:57:30
On Mon, 7 Oct 1996, Eli Zaretskii wrote:
>Instead of falling back to Turbo C, why not read the CMOS? Surely, if
>there is *any* place in the PC which knows about the correct amount of
>memory, it will be there, right?
It will be there until you hit the 64MB limit. Field in CMOS is two bytes
wide, so if a computer has more memory reading values from CMOS will reveal
that there are 0 or 64MB of memory (confirmed. I have checked it on two
computers with 128MB of memory - one of them had 0 in the field, while the
other had 0xFFFF.) Apparently those BIOSes that report 0 in CMOS have the
exact amount of memory stored elsewhere, but where? For now, the only solution
seems to be a 'brute force' method, namely the one used by BIOS POST code. It
just writes patterns to memory and reads them back, comparing whether they are
returned correctly. If it writes to an address which is non-existent on the
computer - it'll know that's the end of installed memory. BTW. This is exactly
how e.g. Check-It works when examining memory. This method is slow, of course,
but the only one available. Another drawback is that it should be run in RM.
PMode will disallow access to some areas of memory, especially if there's some
multi-tasking environment. Having said all that, it seems that there is NO
universal method to be used in PMode (at least under multitasking
environments) - one should find the appropriate system calls undoubtedly
present in these OSes that report the correct amount of installed memory.
---------------------------------------------------------------------------
You can't brush me under the carpet, you can't hide me under the stairs,
The custodian of your private fears, your leading actor of yesteryear,
Who as you crawled out of the alleys of obscurity, sentenced to rejection
in the morass of anonymity. You who I directed with a lover's will, you
who I let hypnotise the lens. You who I let bathe in the spotlights glare.
You who wiped me from your memory like a greasepaint mask, just like a
greasepaint mask...
-------------------- http://ananke.amu.edu.pl/~grendel -------------------
- Raw text -