home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.sun.admin:5087 comp.sys.sun.misc:3397
- Newsgroups: comp.sys.sun.admin,comp.sys.sun.misc
- Path: sparky!uunet!s5!is1.is.morgan.com!is0.is.morgan.com!chetal
- From: chetal@is.morgan.com (Pradeep Chetal)
- Subject: Re: How much physical memory?
- In-Reply-To: asherman@laser.fmrco.com's message of Wed, 29 Jul 1992 16:46:58 GMT
- Message-ID: <CHETAL.92Jul30045312@is1.is.morgan.com>
- Sender: news@is.morgan.com
- Nntp-Posting-Host: is1
- Organization: Morgan Stanley & Company
- References: <ASHERMAN.92Jul29114658@laser.fmrco.com>
- Date: Thu, 30 Jul 1992 09:53:12 GMT
- Lines: 37
-
- In article <ASHERMAN.92Jul29114658@laser.fmrco.com> asherman@laser.fmrco.com (Aaron Sherman) writes:
-
- From perl (or C if I have to) how can I find out how much PHYSICAL
- memory a system has? I've been looking at /usr/adm/messages*, but on
- systems that haven't re-booted recently there is nothing left.
-
- I am doing this from a perl script, so perusing files or running an
- existing program would be the easiest, but if the only thing I can do
- is write a C program, then that's fine.
-
- Thanks. And, please reply via Email, I will summarize any responses.
-
- -AJS
-
- I picked this perl script from net itself. If you have ONLY sun's , you may
- wanna use pagesize(1) rather than hard-coded value.
-
- #!/usr/local/bin/perl
- #
- # I think for Sun-3's you divide by 128
- #
- $_ = `adb -k /vmunix /dev/mem </dev/null 2>&1`;
- if (/physmem\s+(.*)/) {
- print "Physical memory is ", int(hex($1) / 256 + 1), " megs\n";
- }
- else {
- die $_;
- }
-
-
- /Pradeep
- --
- ----------------------------------------------------------------------------
- Pradeep Chetal Phone: 81-3-3286-9678
- Information Services Deptartment FAX: 81-3-3286-9040
- Morgan Stanley Japan Ltd. Tokyo Branch E-mail: chetal@is.morgan.com
- Ote Center Bldg. 3F, 1-1-3 Otemachi, Chiyoda-ku, Tokyo 100
-