SUMMARY: How to find out Sparc 10 Model (ascii format)

From: Pablo Ruiz (ruiz@babbage.csee.usf.edu)
Date: Wed Mar 29 1995 - 08:35:12 CST


I recently sent out a MIME-type mail with the SUMMARY, but I have received
several requests for a non-MIME SUMMARY. Here you are!!!

Thanks to all people, who replied:

Dave Hightower <hightowr@afwc.af.mil>
Claus Assmann <ca@informatik.uni-kiel.de>
Markus Storm <storm@uni-paderborn.de>
Garry Robbins <25741@labatt.com>
Russ Poffenberger <poffen@San-Jose.ate.slb.com>
Peter Bestel <Peter.Bestel@uniq.com.au>
Ray Trzaska <rtrzaska@uk.mdis.com>
Claude Charest <charest@CANR.Hydro.Qc.CA>
Lykakis Janis <janisl@css.ce.philips.nl>
Dave Hightower <hightowr@afwc.af.mil>
Jerry Weber CIC-2 <x092306@hyperion.LANL.GOV>
irana@hydres.co.uk
"Mark R. Lemoine (432)-5126" <mrl5600@sudcv91.ed.ray.com>
rstar@uxvan066.sierrasys.com
"Aline H. Runde - MicroModule Systems" <runde@mms.com>

Did you try the next command?
        SunOs4.x: /usr/etc/devinfo -vp | more
        SunOs5.x: /usr/sbin/prtconf -vp | more

====================================================

#!/usr/local/bin/perl -P- # -*-Perl-*-
'di'; # tell nroff to ignore the following perl code
'ig00'; # up through the ".00" marker

;# ------------------------------------------------------------------------------------------------------------- #
;# #
;# Program: Sunmodel, perl script #
;# #
;# Parse output from devinfo and display the Sun type and it's clock frequency. #
;# #
;# Bugs: Will not work on older sun-4 karch machines. #
;# #
;# Usage: Sunmodel #
;# #
;# ------------------------------------------------------------------------------------------------------------- #

;#configuration parameters
$usage = "Usage: Sunmodel\n";

open(openprom, '/dev/openprom') ||
        die("sunmodel: no openprom support\n");

close(openprom);

$uname = `uname -a`;
($os,$host,$rev,$vers,$arch) = split(' ', $uname);

if ($rev =~ /^4/) {
        $devinfo = "/usr/etc/devinfo -vp";
}
elsif ($rev =~ /^5/) {
        $devinfo = "/usr/sbin/prtconf -vp";
}
else {
        print stderr "sunmodel: unknown OS revision $rev\n";
        exit 1;
}

open(devinfo, "$devinfo|") || die("sunmodel: can't run $devinfo\n");

while (<devinfo>) {

        last
                if (/^$/);

        if (/banner-name: *'(.*)'/) {
                $name = $1;
        }
        elsif (!defined($name) && /name: *'(.*)'/) {
                $name = $1;
        }
        elsif (/clock-frequency: *([0-9A-Fa-z]*)/) {
                $basefreq = hex($1);
        }

}

$cpus = 0;

while (<devinfo>) {

        if (/^$/) {

                if ($freq != 0 && $device_type eq 'cpu') {
                        $cfreq = $freq/1000000;
                        $cpufreq .= ", cpu $cfreq MHz";
                        ++$cpus;
                }

                $device_type = '';
                $freq = 0;
        }

        if (/clock-frequency: *([0-9A-Fa-z]*)/) {
                $freq = hex($1);
        }

        if (/device_type: *'*([^']*)/) {
                $device_type = $1;
        }

}

if (!defined($name)) {
        print stderr "sunmodel: couldn't find a name\n";
}

if ($basefreq % 1000000) {
        print stderr "sunmodel: freq $basefreq not a multiple of 1MHz\n";
}

$basefreq /= 1000000;

$name =~ s/^SUNW,//;
$cache = "0";

if ($name =~ /390Z55/) {
        $name .= " (1MB SuperCache)"; $cache = "1";
}

if ($name =~ /390S10/) {
        $name .= " (MicroSparc)";
}

if ($name =~ /390Z/) {

        if ($cfreq == 0) {
                $cfreq = $basefreq;
        }

        if ($cpus == 1) {
                $cpus = "0"; $cache = "";
        }

        if ($cfreq == 30 || $cfreq == 33) {
                $name .= " (Model 2$cpus)";
        }
        elsif ($cfreq == 36) {
                $name .= " (Model 3$cpus)";
        }
        elsif ($cfreq == 40.3 || $cfreq == 40) {
                $name .= " (Model 4$cpus$cache)";
        }
        elsif ($cfreq == 45 || $cfreq == 50) {
                $name .= " (Model 5$cpus$cache)";
        }
        else {
                $name .= " (unknown TMS390Z model @ $cfreq MHz)";
        }

}

if ($name eq "Sun 4/75") {
        $name .= " (SPARCstation 2)";
}
elsif ($name eq "Sun 4/40") {
        $name .= " (SPARCstation IPC)";
}
elsif ($name eq "Sun 4/65") {
        $name .= " (SPARCstation 1+)";
}

print "$name @ $basefreq MHz${cpufreq}\n";

;##############################################################################
.00; # finish .ig
 
'di \" finish diversion--previous line must be blank
.nr nl 0-1 \" fake up transition to first page again
.nr % 0 \" start at page 1
';<<'.ex'; #__END__ ############# From here on it's a standard manual page ############
.TH SUNMODEL 1 "January 8, 1994"
.AT 3
.SH NAME
Sunmodel \- Display Sun model type and its clock speed
.SH SYNOPSIS
.B Sunmodel
.SH DESCRIPTION
.I Sunmodel
will display the type of sun (i.e. SPARC2, SPARC10, SUN600, etc) and
the clock speed of the machine that it is running on.
.PP
Sunmodel determines this information from the output from devinfo.
.SH ENVIRONMENT
No environment variables are used.
.SH "SEE ALSO"
devinfo(8S)
.br
prtconf(8S)
.br
perl(1)
.SH DIAGNOSTICS
None.
.SH BUGS
Older Sun-4 models (such as a 4/360) will give erroneous output.
.ex

====================================================

#!/bin/sh
#
# sunmodel
#
# Parse output from devinfo/prtconf
# and display the kind of Sun and its clock
# frequency.
# 24-mar-94 added Frame Buffer Kind printing
#
# Jan Wortelboer (janw@fwi.uva.nl)
# idea from Chris Metcalf, metcalf@lcs.mit.edu
# version 1.4 16 March 1993
version=`uname -r`
hostje=`uname -n`
name=
bname=
freq=0
cpus=0
cpu=
cpuc=
cpuf=0
name_freq=0
fb=
export name bname freq
case $version in
6.*|5.*)
        # solaris machine
        pr_conf="/usr/sbin/prtconf -vp"
        ;;
4.*)
        # sunos 4 machine
        pr_conf="/usr/etc/devinfo -vp"
        ;;
*)
        echo cant determine sunmodel
        exit 1
;;
esac

$pr_conf | ( egrep 'clock-frequency:|name:|cgthree|cgsix|cgtwelve' ; echo end ) | while read pr_line
do
        case $pr_line in
        clock-frequency:*)
                if [ "$freq" = 0 ]
                then
                        set $pr_line
                        hex_freq=`echo $2 | tr '[a-z]' '[A-Z]'`
                        freq=` ( echo "ibase=16" ; echo $hex_freq ) | bc`
                        freq=`expr $freq \/ 100000 | sed 's/\(.*\)\(.\)/\1.\2/'`
                else
                        set $pr_line
                        name_hex_freq=`echo $2 | tr '[a-z]' '[A-Z]'`
                        name_freq=` ( echo "ibase=16" ; echo $name_hex_freq ) | bc`
                        name_freq=`expr $name_freq \/ 100000 | sed 's/\(.*\)\(.\)/\1.\2/'`
                fi
        ;;
        banner-name:*)
                bname=`echo $pr_line | sed 's/.*banner-name:[ ]*//'`
                #pcount=`echo $pr_line | sed 's/.*(\(.*\) X.*//'`
        ;;
        *cgthree*)
                fb=CG3
        ;;
        *cgsix*)
                fb=GX
        ;;
        *cgtwelve*)
                fb=GT
        ;;
        name:*)
                if [ "$name" = "" ]
                then
                        name=`echo $pr_line | sed 's/.*name:[ ]*//'`
                        if [ "$bname" = "" ]
                        then
                                bname=$name
                        fi
                fi
                case $name in
                        *4/20*)
                                bname="'SPARCstation SLC'"
                        ;;
                        *4/25*)
                                bname="'SPARCstation ELC'"
                        ;;
                        *4/40*)
                                bname="'SPARCstation IPC'"
                        ;;
                        *4/50*)
                                bname="'SPARCstation IPX'"
                        ;;
                        *4/60*)
                                bname="'SPARCstation 1'"
                        ;;
                        *4/65*)
                                bname="'SPARCstation 1+'"
                        ;;
                        *4/75*)
                                bname="'SPARCstation 2'"
                        ;;
                esac
                fname=`echo $pr_line | sed 's/.*name:[ ]*//'`
                case $fname in
                        *Cypress,CY605*)
                                cpu='Cypress,CY605'
                                cpus=`expr $cpus + 1`
                                cpuf=$name_freq
                                cpuc=
                        ;;
                        *TI,TMS390Z55*)
                                cpu="Texas Instruments TMS390Z55 1MB S.Cache"
                                cpus=`expr $cpus + 1`
                                cpuf=$name_freq
                                cpuc=1
                        ;;
                        *TI,TMS390Z50*)
                                cpu="Texas Instruments TMS390Z50"
                                cpus=`expr $cpus + 1`
                                cpuf=$name_freq
                                cpuc=
                        ;;
                        *TI,TMS390S10*)
                                cpu="Texas Instruments TMS390S10 (MicroSparc)"
                                cpus=`expr $cpus + 1`
                                cpuf=$name_freq
                                cpuc=
                        ;;
                esac
                name_freq=0
        ;;
        end)
                if [ $cpuf = 0 ]
                then
                        cpuf=$freq
                fi
                if [ `expr "$bname" : "'.*39.Z.*'"` != 0 -a `expr "$bname" : ".*[21]000.*"` = 0 ]
                then
                case $cpuf in
                        33.0|30.0)
                                if [ "$cpus" != 1 ]
                                then
                                        bname="$bname '(Model 2$cpus)'"
                                else
                                        bname="$bname '(Model 20)'"
                                fi
                                freq=$cpuf
                                ;;
                        36.0)
                                if [ "$cpus" != 1 ]
                                then
                                        bname="$bname '(Model 3$cpus)'"
                                else
                                        bname="$bname '(Model 30)'"
                                fi
                                freq=$cpuf
                                ;;
                        40.3)
                                if [ "$cpus" != 1 ]
                                then
                                        bname="$bname '(Model 4${cpus}${cpuc})'"
                                else
                                        bname="$bname '(Model 41)'"
                                fi
                                freq=$cpuf
                                ;;
                        45.0|50.0)
                                if [ "$cpus" != 1 ]
                                then
                                        bname="$bname '(Model 5${cpus}${cpuc})'"
                                else
                                        bname="$bname '(Model 51)'"
                                fi
                                freq=$cpuf
                                ;;
                esac
                else
                        if [ $cpus -gt 1 ]
                        then
                                bname="$bname ($cpus X $cpu cpus)"
                        fi
                fi
                echo Machine $hostje: $bname @ $cpuf MHz
        ;;
        *)
                echo -n
        ;;
        esac
done

=====================================================

#!/bin/sh
#
# sunmodel
#
# Parse output from devinfo/prtconf
# and display the kind of Sun and its clock
# frequency.
#
# Jan Wortelboer idea from Chris Metcalf, metcalf@lcs.mit.edu
# version 1.1 16 August 1993
version=`uname -r`
hostje=`hostname`
name=
bname=
freq=0
cpus=0
cpu=
cpuc=
cpuf=0
name_freq=0
fb=
export name bname freq fb
case $version in
5.*)
        # solaris machine
        pr_conf="/usr/sbin/prtconf -vp"
        ;;
4.*)
        # sunos 4 machine
        pr_conf="/usr/etc/devinfo -vp"
        ;;
*)
        echo cant determine sunmodel
        exit 1
;;
esac

$pr_conf | ( egrep 'clock-frequency:|name:|cgthree|cgsix' ; echo end ) | while read pr_line
do
        case $pr_line in
        clock-frequency:*)
                if [ "$freq" = 0 ]
                then
                        set $pr_line
                        hex_freq=`echo $2 | tr '[a-z]' '[A-Z]'`
                        freq=` ( echo "ibase=16" ; echo $hex_freq ) | bc`
                        freq=`expr $freq \/ 100000 | sed 's/\(.*\)\(.\)/\1.\2/'`
                else
                        set $pr_line
                        name_hex_freq=`echo $2 | tr '[a-z]' '[A-Z]'`
                        name_freq=` ( echo "ibase=16" ; echo $name_hex_freq ) | bc`
                        name_freq=`expr $name_freq \/ 100000 | sed 's/\(.*\)\(.\)/\1.\2/'`
                fi
        ;;
        banner-name:*)
                bname=`echo $pr_line | sed 's/.*banner-name:[ ]*//'`
                #pcount=`echo $pr_line | sed 's/.*(\(.*\) X.*//'`
        ;;
        *cgthree*)
                fb=CG3
        ;;
        *cgsix*)
                fb=GX
        ;;
        *cgtwelve*)
                fb=GT
        ;;
        name:*)
                if [ "$name" = "" ]
                then
                        name=`echo $pr_line | sed 's/.*name:[ ]*//'`
                        if [ "$bname" = "" ]
                        then
                                bname=$name
                        fi
                fi
                case $name in
                        *4/40*)
                                bname="'SPARCstation IPC'"
                        ;;
                        *4/50*)
                                bname="'SPARCstation IPX'"
                        ;;
                        *4/60*)
                                bname="'SPARCstation 1'"
                        ;;
                        *4/65*)
                                bname="'SPARCstation 1+'"
                        ;;
                        *4/75*)
                                bname="'SPARCstation 2'"
                        ;;
                esac
                fname=`echo $pr_line | sed 's/.*name:[ ]*//'`
                case $fname in
                        *Cypress,CY605*)
                                cpu='Cypress,CY605'
                                cpus=`expr $cpus + 1`
                                cpuf=$name_freq
                                cpuc=
                        ;;
                        *TI,TMS390Z55*)
                                cpu="Texas Instruments TMS390Z55 1MB S.Cache"
                                cpus=`expr $cpus + 1`
                                cpuf=$name_freq
                                cpuc=1
                        ;;
                        *TI,TMS390Z50*)
                                cpu="Texas Instruments TMS390Z50"
                                cpus=`expr $cpus + 1`
                                cpuf=$name_freq
                                cpuc=
                        ;;
                        *TI,TMS390S10*)
                                cpu="Texas Instruments TMS390S10 (MicroSparc)"
                                cpus=`expr $cpus + 1`
                                cpuf=$name_freq
                                cpuc=
                        ;;
                esac
                name_freq=0
        ;;
        end)
                if [ $cpuf = 0 ]
                then
                        cpuf=$freq
                fi
                if [ `expr "$bname" : "'.*390Z.*'"` != 0 ]
                then
                case $cpuf in
                        33.0|30.0)
                                if [ "$cpus" != 1 ]
                                then
                                        bname="$bname '(Model 2$cpus)'"
                                else
                                        bname="$bname '(Model 20)'"
                                fi
                                freq=$cpuf
                                ;;
                        36.0)
                                if [ "$cpus" != 1 ]
                                then
                                        bname="$bname '(Model 3$cpus)'"
                                else
                                        bname="$bname '(Model 30)'"
                                fi
                                freq=$cpuf
                                ;;
                        40.3)
                                if [ "$cpus" != 1 ]
                                then
                                        bname="$bname '(Model 4${cpus}${cpuc})'"
                                else
                                        bname="$bname '(Model 41)'"
                                fi
                                freq=$cpuf
                                ;;
                        40.0)
                                if [ "$cpus" != 1 ]
                                then
                                        bname="$bname '(Model 4$cpus)'"
                                else
                                        bname="$bname '(Model 40)'"
                                fi
                                freq=$cpuf
                                ;;
                        45.0|50.0)
                                if [ "$cpus" != 1 ]
                                then
                                        bname="$bname '(Model 5${cpus}${cpuc})'"
                                else
                                        bname="$bname '(Model 51)'"
                                fi
                                freq=$cpuf
                                ;;
                esac
                else
                        if [ $cpus -gt 1 ]
                        then
                                bname="$bname ($cpus X $cpu cpus)"
                        fi
                fi
                echo Machine $hostje: $bname @ $freq MHz, $fb
        ;;
        *)
                echo -n
        ;;
        esac
done

=====================================================

Enjoy,

Pablo



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:20 CDT