daveh@cbmvax.UUCP (Dave Haynie) (12/01/87)
Here's a quick one I mentioned in a previous article. It checks the OS's
CPU flags to see what you're running in your system, and prints that to
the standard output. I used this in my Startup-Sequence to make sure the
68020 board was really in control during development.
-Dave Haynie
------------------You'd best be cuttin' here------------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
# WhatCPU.c
# WhatCPU.uue
# This archive created: Mon Nov 30 17:44:58 1987
export PATH; PATH=/bin:$PATH
if test -f 'WhatCPU.c'
then
echo shar: will not over-write existing file "'WhatCPU.c'"
else
cat << \SHAR_EOF > 'WhatCPU.c'
/*
WhatCPU.c : Prints the CPU information to the standard output.
-Dave Haynie
*/
#include <exec/types.h>
#include <exec/execbase.h>
/* This is all there is */
main(argc,argv)
int argc;
char *argv[];
{
struct ExecBase *eb, **peb;
peb = (struct ExecBase **)(4L);
eb = *peb;
printf("System Configuration : ");
if (eb->AttnFlags & AFF_68020)
printf("68020 ");
else if (eb->AttnFlags & AFF_68010)
printf("68010 ");
else
printf("68000 ");
if (eb->AttnFlags & AFF_68881)
printf("68881 ");
printf("\n");
}
SHAR_EOF
fi # end of overwriting check
if test -f 'WhatCPU.uue'
then
echo shar: will not over-write existing file "'WhatCPU.uue'"
else
cat << \SHAR_EOF > 'WhatCPU.uue'
begin 644 WhatCPU
M #\P ' 8 !Q ;@ "8 . % @
M / #Z0 '$CSP !PCP "0CR "A"N0 " L>0 0CS@
M 23R4ZN_MHH0$JL *QG "H80 !;"!L *S1R-'((&@ $-'(T<A(YR P1?D
M "L1_D L= %P ! 8)LI@ A384<C__$(:(#D D('D H$AA3@&\>
M# $ (&_T4H(FRF *$AA3@ P! "!O!!3!8/)"&F#<0AI"FR "3-\,!$AY
M+"\ 3KD <(\ 03KD L(\ 4(\ 83KD < N>0
M !Q.=6$ ,9A "P(\ @0J<O "1 ("H )&<0+'D (($ B* 3J[_
M@B(J "!G*"0\ #[4ZN_^(CP ! CP !0CP !AG"N6(($ I: (
M *1.N0 !P & $("\ !"YY '"\ +'D $(#D (9P(B0$ZN_F)*
MN0 "!G#DZN_WPB>0 "!.KOZ&(!].=4CG 08N/ #@ <L> $3J[_E$S?
M8(!P9&"P0>P 7$ZN_H!![ !<3J[^C$YU0KD (0_D &L(#P >3J[]
MV"/ "&>V3G4 ^P : 0 ;H &J !I 6H %>
M !4 4( $B !' 18 #V Y -0 #& P +0
M "F <@ &P !4 3@ " 4 #@ @ " @
M ( $T S ( & K@ +H #\ )E>&ET,@
M 4 "<&%R;45X:70 ": G=A:71M<V< !D )D;VUA
M:6X 3( "9&]C;VYS $$ !&9R;VU7;W)K8F5N8V@
M #: V5X:714;T1/4P 7( "9G)O;4-,20 T E]E
M>&ET !/ )O<&5N1$]3 :( "-B0W-3( "6
M G-T87)T=7 (U)#<U,@ )( "-"0W-3( "(
M C,D-S4R =@ (R)#<U,@ &( ",20W-3@
M %8 C$D-S4R 9 )N;T1/4P 78 #\@
M ^H !N $
M
M
M
M
M
M
M
M
M !D;W,N;&EB<F%R>0 /P
M E9E<E)E=@ )?1$]30F%S90 @ "7W-T9&EN
M 0 V1O<T-M9$QE;@ "0 #:6YI=&EA;%-0 '
M -D;W-#;61"=68 H V%R9W9!<G)A>0 "P "7V5R
M<FYO , E]3>7-"87-E ! )$3U-.86UE :P #
M87)G=D)U9F9E<@ K )?<W1D;W5T !0 "7W-T9&5R<@
M 8 W)E='5R;DUS9P " #\@ ^D F3E;_^' $
M+4#_^"!N__@M4/_\2'D 3KD 6(\@;O_\,"@!* @ %G$$AY
M&$ZY %B/8"P@;O_\,"@!* @ !G$$AY 'TZY %B/8 Y(>0
M "9.N0 !8CR!N__PP* $H" !&<.2'D M3KD 6(](>0 #1.
MN0 !8CTY>3G4 /L !@ , "( >@ %X !. ,
M !0 & !0 (X " 9 %0 V &@ /R #
MZ@ Y3>7-T96T@0V]N9FEG=7)A=&EO;B Z( V.# R," -C@P,3 @ #8X
M,# P( V.#@X,2 "@ _( /I %$CG #HH;P 4(&\ &")O !Q%
M^@ Z3^__="9/+'D $3J[]]G#_2AM7R/_\1H!G$B\ 2&\ !$A43KD
M3^\ #$_O (Q,WUP 3G46P$YU #[ $ & .@ /P
M G-C7W!U= 3 -S='5F9D-H87( !, G!S7V5M<'1Y
M 0@ )?7V1O<')N= "<'-?<VEZ90 F W!S7V-O
M;6UO;@ # #\@ ^D (+P(D+P (2&\ #"\"+SD 4
M3KD 3^\ #"0?3G4 /L 0 $ . 0 0 4
M _ "7W!R:6YT9@ 2Y,- " 2Y,,P
M 2Y,,@ & 2Y,,0 < _( /I #TCG, (L
M>0 A,[P . !!.KO_03-] #$YU O#BQY "$ZN_\HL7TYU+PXL>0
M A.KO_$+%].=0 ^P # 0 # @ !@ /P
M E]/=71P=70 + )?26YP=70 !P "7U=R:71E
( _(
end
SHAR_EOF
fi # end of overwriting check
# End of shell archive
exit 0
--
Dave Haynie Commodore-Amiga Usenet: {ihnp4|uunet|rutgers}!cbmvax!daveh
"The B2000 Guy" PLINK : D-DAVE H BIX : hazy
"I can't relax, 'cause I'm a Boinger!"