HP3000-L Archives

June 1999, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stan Sieler <[log in to unmask]>
Reply To:
Stan Sieler <[log in to unmask]>
Date:
Tue, 8 Jun 1999 16:46:52 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (38 lines)
Eric writes:


> I wonder if you can help me out.  Is there an intrinsic available from C
> for determining the total physical memory size of a machine?

AIFSCGET, item #3039 returns the amount of physical memory in units
of 2048 byte pages (not 4096 byte pages, BTW).
You used to have to purchase the AIF:OS manual to find the calling
sequence/information for this intrinsic.

Other techniques exist, certainly.

For example:

    extern void get_memsize (uint32 *num_2kpages);    /* internal OS routine */


    int32 get_memsize_mbs ()    /* returns # of megabytes of memory */
       {

       uint32                   /* *everyone* uses int32/uint32, don't they?! */
          num_2kpages = 0;


       GETPRIVMODE ();          /* get_memsize requires priv mode */

       get_memsize (&num_2kpages);

       return (num_2kpages / 512);   /* return # of megabytes, rounded down */
       }

Prep program with CAP=PM.

--
Stan Sieler                                          [log in to unmask]
                                     http://www.allegro.com/sieler.html

ATOM RSS1 RSS2