Repository navigation
Expand file tree
/
Copy pathsunmodel
More file actions
executable file
·521 lines (507 loc) · 9.59 KB
/
Copy pathsunmodel
File metadata and controls
executable file
·521 lines (507 loc) · 9.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
#!/bin/sh
#
# sunmodel
# from ftp://ftp.fwi.uva.nl/pub/comp/solaris/sunmodel
# modified by Phil Budne <phil@ultimate.com> for C-MAINBOL distribution
#
# Parse output from devinfo/prtconf
# and display the kind of Sun and its clock
# frequency.
#
# Jan Wortelboer (janw@fwi.uva.nl)
# idea from Chris Metcalf, metcalf@lcs.mit.edu
# version 1.6.1 6 April 1994
# changed trying to adjust to SPARCstation 20 and SPARCstation 5
# version 1.7 01 June 1994 added FrameBuffer
# version 1.8 08 June 1994 690 corrected
# version 1.9 20 januari 1995 TGX-PLUS added
# version 1.99 24 februari 1995 More GX specs
# version 1.999 24 may 1995 TCX trial, i am not happy with it.
# version 1.9999 04 august 1995 support for Ross,RT625
# version 2.0000 10 oktober 1995 egrep removed, expr was to large for sunos.
# added memory size
# version 2.0001 17 januari 1996 added support for ultra.
# version 2.0002 01 march 1996 added support for Ross,RT625 without cpuF
# version 2.0003 01 may 1996 added support for Ross,CY605 without cpuF
#
# $Log$
# Revision 1.2 1997/07/27 01:54:44 phil
# use hostid on system without openprom
# rearrange to (hopefully) work on sunos 4.0 (and 3.0) shell
#
if [ -f /usr/bin/uname ]; then
version=`uname -r`
hostje=`uname -n`
else
# no uname command; pre-SunOS 4.1
hostje=`hostname`
if [ -d /var ]; then
version=4.0
else
version=3.x
fi
fi
case $version in
# DEBUG MODE
#*)
# pr_conf="cat sunmodel.input"
# ;;
6.*|5.*)
# solaris machine
case `uname -m` in
sun4)
# old sun4: no openprom.
karch=sun4
mach=sparc
if [ -f /usr/ucb/hostid ]; then
hostid=`/usr/ucb/hostid`
else
# sysinfo(SI_HW_SERIAL, ...) provides data
# but must have bsd compatability software to
# get it from command line?!
# could compile a small program??
hostid=xxx
fi
;;
i86pc)
# no openprom on x86
# very few properties of value;
# cpu-type is always "486", even on Pentium Pro!
# bus-type "isa" even when pci present
# machine-mfg "generic AT"
# boot-path tells if booted from IDE or SCSI, ie;
# /isa/ata@1f0,0/cmdk@0,0:a
# just show memory size;
memsize=`/usr/sbin/prtconf -v | grep 'Memory size:' | sed 's/Memory.size:[ ]*//'`
echo Machine $hostje x86 $memsize
exit 0
;;
*)
# sun4c, sun4m, sun4d, sun4u, ppc?!
pr_conf="/usr/sbin/prtconf -vp"
;;
esac
;;
3.*|4.*)
# pre 4.1 systems don't have uname;
karch=`/usr/bin/arch -k`
case "$karch" in
sun4c|sun4m)
# sun4c or sun4m sunos 4 machine. use openprom devinfo
pr_conf="/usr/etc/devinfo -vp";;
sun2|sun3*|sun386|sun4|Series*|S4*)
# non-openprom machine. use hostid
mach=`/usr/bin/mach`
hostid=`hostid`;;
esac
;;
*)
echo cant determine sunmodel
exit 1
;;
esac
if [ "$hostid" ]; then
# here with systems with no openprom
# hostid mappings from hosttype v2.0
# by John DiMarco <jdd@cdf.toronto.edu>
case "$hostid" in
01*) sys='2/100'; cpu='mc68010 @ 10';;
02*) sys='2/50'; cpu='mc68010 @ 10';;
04*) sys="Solbourne $karch"; cpu="$mach";;
11*) sys='3/100'; cpu='mc68020 @ 16.7';;
12*) sys='3/50'; cpu='mc68020 @ 12.5';;
13*) sys='3/200'; cpu='mc68020 @ 25';;
14*) sys='3/110'; cpu='mc68020 @ 16.7';;
17*) sys='3/60'; cpu='mc68020 @ 16.7';;
18*) sys='3/E'; cpu='mc68020';;
21*) sys='4/200'; cpu='sparc @ 16.7';;
22*) sys='4/100'; cpu='sparc @ 14.2';;
23*) sys='4/300'; cpu='sparc @ 25';;
24*) sys='4/400'; cpu='sparc @ 33';;
31*) sys='386i'; cpu='i80386DX @ 15 or 25';;
32*) sys='486i'; cpu='i80486DX';;
41*) sys='3/400'; cpu='mc68030 @ 33';;
42*) sys='3/80'; cpu='mc68030 @ 20';;
*) sys="unknown $karch"; cpu="$mach";;
esac
# run /usr/etc/mc68881version or /usr/etc/fpuversion4 if present?
echo Machine $hostje $sys $cpu
exit 0
fi
# declare functions here; pre-SunOS4.1 shell did not have functions!
name=
bname=
freq=0
cpus=0
cpu=
cpuc=
cpuf=0
memsize=
name_freq=0
fb=
dblbuf=0
vmsize=0
depth=0
height=0
width=0
hfreq=0
vfreq=0
fbmapped=0
emulation=""
montype=""
fbext="\'cgthree\'|\'cgsix\'|\'cgtwelve\'|501-2325|501-1672|501-2253|SUNW,tcx"
fmext="montype|hfreq|vfreq|dblbuf|vmsize|depth|height|width|fbmapped|vram|tcx-8-bit|tcx-24-bit"
not="nvramrc|blit-width"
hex_to_decm()
{
f=`hex_to_dec $1`
f=`expr $f \/ 100000 | sed 's/\(.*\)\(.\)/\1.\2/'`
echo $f
}
hex_to_deck()
{
f=`hex_to_dec $1`
f=`expr $f \/ 100 | sed 's/\(.*\)\(.\)/\1.\2/'`
echo $f
}
hex_to_dec()
{
hf=`echo $1 | tr '[a-z]' '[A-Z]'`
f=` ( echo "ibase=16" ; echo $hf ) | bc`
echo $f
}
fbuf_calc()
{
if [ ${hfreq} -eq 0 -o ${vfreq} -eq 0 ]
then
if [ ${vfreq} -gt 0 ]
then
sfreq="-${vfreq}Hz"
else
sfreq=
fi
else
sfreq=@${hfreq}kHz-${vfreq}Hz
fi
if [ ${dblbuf} -gt 0 -a ${fbmapped} -gt 0 ]
then
sdb="(Dubble Buffered)"
else
sdb=
fi
if [ ${width} -gt 0 -a ${height} -gt 0 ]
then
if [ ${depth} -gt 0 ]
then
sfmt=${width}x${height}x${depth}
else
sfmt=${width}x${height}
fi
else
sfmt=
fi
if [ ${vmsize} -gt 0 ]
then
svm=${vmsize}MB
else
svm=
fi
if [ "" != "${montype}" ]
then
smon=Mon${montype}
else
smon=
fi
echo ${svm}${sdb} ${smon} ${sfmt}${sfreq}
dblbuf=0
vmsize=0
depth=0
height=0
width=0
fbmapped=0
hfreq=0
vfreq=0
montype=
}
export name bname freq
$pr_conf | ( egrep -v "$not" ; echo end ) | while read pr_line
do
case $pr_line in
Memory?size:*)
memsize=`echo $pr_line | sed 's/Memory.size:[ ]*//'`" "
;;
dblbuf:*)
set $pr_line
dblbuf=`hex_to_dec $2`
;;
vram:*)
set $pr_line
vmsize=`hex_to_dec $2`
;;
vmsize:*)
set $pr_line
vmsize=`hex_to_dec $2`
;;
tcx-8-bit:*)
set $pr_line
if [ $# = 1 ]
then
depth=8
else
# don't know yet
depth=`hex_to_dec $2`
fi
;;
tcx-24-bit:*)
set $pr_line
if [ $# = 1 ]
then
depth=24
else
# don't know yet
depth=`hex_to_dec $2`
fi
;;
depth:*)
set $pr_line
depth=`hex_to_dec $2`
;;
height:*)
set $pr_line
height=`hex_to_dec $2`
;;
awidth:*)
;;
width:*)
set $pr_line
width=`hex_to_dec $2`
;;
fbmapped:*)
set $pr_line
fbmapped=`hex_to_decm $2`
;;
hfreq:*)
set $pr_line
hfreq=`hex_to_deck $2`
;;
vfreq:*)
set $pr_line
vfreq=`hex_to_dec $2`
;;
montype:*)
set $pr_line
montype=`hex_to_dec $2`
;;
clock-frequency:*)
if [ "$freq" = 0 ]
then
set $pr_line
freq=`hex_to_decm $2`
else
set $pr_line
name_freq=`hex_to_decm $2`
fi
;;
banner-name:*)
bname=`echo $pr_line | sed 's/.*banner-name:[ ]*//'`
#pcount=`echo $pr_line | sed 's/.*(\(.*\) X.*//'`
;;
emulation:*)
set $pr_line
emulation=$2
;;
*\'cgthree\'*)
if [ "$fb" = "" ]
then
fb="CG3 `fbuf_calc`"
fi
;;
*\'cgsix\'*)
if [ "$fb" = "" ]
then
fb="GX `fbuf_calc`"
fi
;;
*\'cgtwelve\'*)
fb="GS `fbuf_calc`"
;;
*'SUNW,501-2253'*)
fb="TGX-PLUS `fbuf_calc`"
;;
*'SUNW,501-2325'*)
fb="TGX `fbuf_calc`"
;;
*'SUNW,tcx'*)
fb="TCX `fbuf_calc`"
;;
*'SUNW,501-1672'*)
fb="GX `fbuf_calc`"
;;
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[0-9]*)
;;
*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`
if [ $name_freq = 0 ]
then
#SPARCsystem 600MP (4 X CY605)
# no freq with in cpu part
name_freq=$freq
fi
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=
;;
*SUNW,UltraSPARC*)
cpu="UltraSPARC"
cpus=`expr $cpus + 1`
cpuf=$name_freq
cpuc=
;;
*Ross,RT625*)
cpu="Ross,RT625"
cpus=`expr $cpus + 1`
if [ $name_freq = 0 ]
then
#SPARCsystem 600MP (4 X RT625)
# no freq with in cpu part
name_freq=$freq
fi
cpuf=$name_freq
cpuc=
;;
esac
save_freq=$name_freq
name_freq=0
;;
device_type:*'cpu'*)
if [ $cpuf = 0 ]
then
cpu="No Name,Send prtconf -vp output to janw@wins.uva.nl"
fi
;;
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${cpuc}${cpus})'"
else
bname="$bname '(Model 41)'"
fi
freq=$cpuf
;;
45.0|50.0)
if [ "$cpus" != 1 ]
then
bname="$bname '(Model 5${cpuc}${cpus})'"
else
bname="$bname '(Model 51)'"
fi
freq=$cpuf
;;
60.*)
if [ "$cpus" != 1 ]
then
bname="$bname '(Model 6${cpuc}${cpus})'"
else
bname="$bname '(Model 61)'"
fi
freq=$cpuf
;;
*)
if [ "$cpus" != 1 ]
then
bname="$bname '(Model X${cpuc}${cpus})'"
fi
freq=$cpuf
;;
esac
else
if [ $cpus -gt 1 ]
then
bname="$bname ($cpus X $cpu cpus)"
fi
fi
echo Machine $hostje: $bname @ $cpuf MHz $memsize$fb
;;
#*)
# echo $pr_line "?????"
#;;
esac
done