Announcement

Collapse
No announcement yet.

Determining amount of installed memory

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Determining amount of installed memory

    Is there a way to determine how much memory is physically available in a PC?

    Two of the "standard" methods I've come across so far, checking offsets 17h and 18h in the CMOS memory and use of INT 15h, function C7h are deficient. The former because it is unable to determine if more than 64MB has been installed and the latter because it is limited to reporting only memory that has been specifically allocated to the INT 15h interface with HIMEM.SYS.

    I've noticed that Micro$oft's own MSD application will not report memory in excess of 64MB, but I'm sure there must be a way.
    If you try to make something idiot-proof, someone will invent a better idiot.

  • #2
    I don't think it's possible because DOS (which runs in real mode) is not capable of addressing more than 64Mb (this may not be true in all circumstances as there is bound to be some smart-alec that has an protected mode extender or 3rd-party DOS that can do this!). Actually, this raises another idea - maybe DPMI could help find a solution to this issue?

    The easiest solution I can think of would be to shell to a PBCC app which can directly query Windows, and then reports the value back through a disk file. However, you'd need to be running Win95 or better, but that may not be a problem for you.

    If you are running Win3.x, then you'll never use the whole 64Mb anyway, so if there is more than 64Mb you are wasting ram

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      I wasn't intending to use - read or write to - any memory "above" 64MB, I just want to know if (and how much of) it is there.

      I've sort-of found an answer to my question in Micro$oft KB article Q121008.
      If you try to make something idiot-proof, someone will invent a better idiot.

      Comment


      • #4

        None of the computer hear have any more the 64mag on theme.
        If I had 128mag and used the mem /c /p command. Would it only show 64 mag of ram?



        ------------------

        Comment


        • #5
          If I had 128mag and used the mem /c /p command. Would it only show 64 mag of ram?
          Depends on where you run the MEM command. If MEM is run from pure DOS, it will report 128MB if you have installed 128MB of RAM. See also Knowledge Base article Q239514.
          If you try to make something idiot-proof, someone will invent a better idiot.

          Comment

          Working...
          X