home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.sun.admin:5113 comp.sys.sun.misc:3403
- Path: sparky!uunet!auspex-gw!guy
- From: guy@Auspex.COM (Guy Harris)
- Newsgroups: comp.sys.sun.admin,comp.sys.sun.misc
- Subject: Re: How much physical memory?
- Message-ID: <13832@auspex-gw.auspex.com>
- Date: 30 Jul 92 21:11:02 GMT
- References: <ASHERMAN.92Jul29114658@laser.fmrco.com> <CHETAL.92Jul30045312@is1.is.morgan.com>
- Sender: news@auspex-gw.auspex.com
- Followup-To: comp.sys.sun.admin
- Organization: Auspex Systems, Santa Clara
- Lines: 33
- Nntp-Posting-Host: bootme.auspex.com
-
- >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.
-
- Yes, you *definitely* don't want to hard-code a value.
-
- For one thing, the script in question appears to be a bit confused:
-
- ># I think for Sun-3's you divide by 128
-
- That's true, *BUT* it's also true for Sun-4's as well; they also have
- 8K pages, so:
-
- >$_ = `adb -k /vmunix /dev/mem </dev/null 2>&1`;
- >if (/physmem\s+(.*)/) {
- > print "Physical memory is ", int(hex($1) / 256 + 1), " megs\n";
-
- will give the wrong answer.
-
- Sun-4c's have 4K pages, Sun-4m's (and all other SPARC Reference MMU
- machines) have 4K pages, and the SPARCengine 1E has 8K pages. I'll bet
- the script's author tried it on a Sun-4c, and figured it was
- representative of all SPARC machines. It may be representative of
- *most* of 'em, but it's definitely not representative of *all* of
- 'em....
-
- I.e., if you have a program or script that you want to run on arbitrary
- SPARC-based machines, your program or script *must not* have the page
- size hardcoded into it.
-
- Then again, if you don't have only Suns, you may or may not have a
- "physmem" variable in your kernel on the non-Sun machines, so....
-
- (And, for that matter, SunOS 5.0 might not have it, either....)
-