[comp.sys.sun] What type system am I on?

dcox@cs.rochester.edu (Don Cox) (06/07/90)

I am writing a shell script that has to distinguish between a Sun4/260 and
a Sun4/490.  The 'arch' command returns 'sun4' on both machines.  Is there
a way, other than motd, that I can type the same command on either machine
and know which type Sun4 machine I am on?  Thanks. 

[[Ed's Note: A shell script was posted in v8n202 which could be used to
tell the type of the machine that the command was invoked from. At the
time, it was out of date (didn't support the Sparc machines) so I imagine
that it's still out of date, however, it would probably be a good starting
point if nothing else.  -bdg]]

FTP:	Hostname : titan.rice.edu (128.42.1.30)
	Directory: sun-source
	Filename : machtype.script
	Filesize : 894 bytes

Archive Server Address: archive-server@rice.edu
Archive Server Command: send sun-source machtype.script

                  Don Cox
ARPA    dcox@ssd.kodak.com
UUCP	...rutgers!rochester!kodak!aviary!dcox

) (06/08/90)

Here is the best script of this type I've seen.  It can't get out of date
because it decodes <machine/cpu.h>.

[[Ed's Note: Placed in archives, replacing machtype.script. -bdg]]

FTP:	Hostname : titan.rice.edu (128.42.1.30)
	Directory: sun-source
	Filename : machtype
	Filesize : 763 bytes

Archive Server Address: archive-server@rice.edu
Archive Server Command: send sun-source machtype

David DiGiacomo, Sun Microsystems, Mt. View, CA  david@eng.sun.com

dupuy@cs.columbia.edu (06/08/90)

Here's a program which will do what you need - it will even say what kind of
floating point processor (if any) you have.

[[Ed's Note: This one's pretty nice too, so I'll include it in the
archives along with the other machtype script. -bdg]]

FTP:	Hostname : titan.rice.edu (128.42.1.30)
	Directory: sun-source
	Filename : machtype.shar
	Filesize : 6038 bytes

Archive Server Address: archive-server@rice.edu
Archive Server Command: send sun-source machtype.shar

datri@uunet.uu.net (Anthony A. Datri) (06/08/90)

This was posted here before:

|Subject: hostid -> model mapping
|X-Sun-Spots-Digest: Volume 8, Issue 198, message 18 of 18

/bin/hostid format: 8 hex digits: A M NNNNNN

A = architecture:
		0=sun2, 1=sun3, 2=sun4, 3=sun386i, 4=sun3x, 5=sun4c

M = machinetype:
		sun2 1=multibus, 2=vmebus
		sun3 1=160, 2=50, 3=260, 4=110, 7=60, 8=Eurocard
		sun4 1=260, 2=110, 3=330, 4=460
		sun3x 1=470, 2=80
		sun4c 1=60

NNNNN = cpu serial 

system serial number format: 3 digits, letter, 4 digits: Y WW L NNNN

Y = year: 4 = 84, 5 = 85, ...
WW = week: 23 = 23rd week of year
L = letter, C through F (possibly manufacturing site?)
NNNN = number of unit


The complete dope on the hostid # can be found in the include file
/usr/include/sun{2,3,4,386}/cpu.h.

inet: dupuy@cs.columbia.edu
uucp: ...!rutgers!cs.columbia.edu!dupuy