tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: "Davis, Alan" <Davis () tessco ! com>
To: tru64-unix-managers
Subject: Displaying system model ID string
Date: Thu, 16 Mar 2000 19:07:04 +0000	[thread overview]
Message-ID: <96079341819572.tru64-unix-managers.marc@archive.invalid> (raw)


I stole the following code from sys_check to easily
display the system model string as it's shown in
the sys_check report.

#!/bin/ksh
KERNEL=vmunix
TMP5=/tmp/get_systype_out.$$
TMP6=/tmp/get_systype_in.$$

getkvar()
# $1 kernel variable
# $2 print option
# returns value
{
#print "a $1 a $2 a" >&2
	strk="p${2} "
	if [ "$3" != "" ]; then
		strk=""
	fi
	print "" > ${TMP6}
	/usr/bin/dbx -c ${TMP6} -k /$KERNEL /dev/mem << EREEEOF > ${TMP5}
2>&1
${strk}${1}
quit
EREEEOF
	echo "`tail -1 ${TMP5}`"
#		jj=`echo "'tail -1 ${TMP5}'" | grep 'not defined or not
active'`
# Insufficient symbol table
#		if [ -n "$jj" ]; then
#			print "0"
#		else
#			echo "`tail -1 ${TMP5}`"
#		fi

	rm ${TMP5} ${TMP6}
}

	set -- `sizer -c|sed 's/\"//g'` 
	styp=$2

	set -- `getkvar '(char *)rpb + rpb->rpb_dsr_off + ((struct rpb_dsr
*) ((char*) rpb + rpb->rpb_dsr_off))->rpb_sysname_off + sizeof (long)'`

	stryp=`echo "$3 $4 $5 $6 $7" | sed 's/\"//g'`

	ptype=`getkvar "(int) proc_type" | sed 's/ //g'`
# /sys/include/arch/alpha/cpuconf.h
	case $ptype in
	2) pstr="EV4 (21064)";;
	5) pstr="EV5 (21164)";;
	6) pstr="EV45 (21064/xxx)";;
	7) pstr="EV56 (21164A)";;
	8) pstr="EV6 (21264)";;
	9) pstr="PCA56 (21164PC)";;
	10) pstr="PCA57 (21164PC)";;
	11) pstr="EV67 (21264A)";;
	12) pstr="EV68CB (21264C)";;
	13) pstr="EV68AL (21264B)";;
	14) pstr="EV68CX (21264D)";;
	*) pstr="unknown $ptype";;
	esac

echo $stryp $pstr
exit

-----
Alan C. Davis                                  
Technology Services                            
davis@tessco.com                               
                                               

                 reply	other threads:[~2000-03-16 19:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox