home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.admin
- Path: sparky!uunet!mcsun!dxcern!dxcern!cons
- From: cons@mercury.cern.ch (Lionel Cons)
- Subject: Re: RAM size
- In-Reply-To: karl@thuja.gsfc.nasa.gov's message of Thu, 19 Nov 1992 19:19:56 GMT
- Message-ID: <CONS.92Nov20095918@mercury.cern.ch>
- Sender: news@dxcern.cern.ch (USENET News System)
- Organization: CERN, European Research Center for Particle Physics
- References: <MENJAN.92Nov17221015@ra.cs.umb.edu> <1992Nov19.140503.13218@tinman.mke.ab.com>
- <1992Nov19.191956.2748@nsisrv.gsfc.nasa.gov>
- Distribution: comp
- Date: Fri, 20 Nov 1992 08:59:18 GMT
- Lines: 58
-
- >>>>> On Thu, 19 Nov 1992 19:19:56 GMT, karl@thuja.gsfc.nasa.gov (Karl A. Anderson) said:
-
- In article <1992Nov19.140503.13218@tinman.mke.ab.com>, tdphette@mke.ab.com (Thad Phetteplace x4461) writes:
-
- > |> menjan@cs.umb.edu (Men-Jan Lin) writes:
- > |> :
- > |> : How can I know the RAM size of my Sun and HP workstation ?
- > |> : (not reboot)
- > |> : Thanks.
- > |> :
- > |> : -Jane
- > |>
- > |> On a Sun you can run the dmesg command and print the messages from the
- > |> last boot. The RAM size should be in there. Pipe it to 'grep mem' to
- > |> filter out other messages...
- > |>
- > |> dmesg | grep mem
- > |>
- > |> That should do it. I don't know if you can do the same on an HP.
- > |>
- >
- > Dmesg also works on an HP, but you have to be super-user. Also, on
- > a Sun you can use devinfo(8). Here's a script somebody posted a
- > while ago:
- > ...
- >
-
- Here is the script I use on an HP (don't have to be run by root):
-
- #!/bin/sh
-
- tmp=/tmp/tmp.$$
- cat << _EOF_ >$tmp.c
- #include <stdio.h>
- #include <sys/pstat.h>
- main() {
- struct pst_static pstatic;
- union pstun pst;
- pst.pst_static = &pstatic;
- if (pstat(PSTAT_STATIC, pst, sizeof(pstatic), 0, 0) < 0)
- printf("unknown\n");
- else
- printf("%d\n", pstatic.physical_memory * pstatic.page_size/1024/1024);
- }
- _EOF_
- cc -o $tmp $tmp.c
- memory=`$tmp`
- rm -f $tmp $tmp.c
- echo "$memory MB"
- --
-
- Lionel Cons
-
- +------- CERN - European Laboratory for Particle Physics -------+
- | E-mail: cons@dxcern.cern.ch |
- | Earth-mail: CN/SW/WS, CERN, CH-1211 GENEVE 23, Switzerland |
- | Phone: +41 22 767 49 13 Fax: +41 22 767 71 55 |
- +---------------------------------------------------------------+
-