请问怎么通过/proc/cpuinfo判断是什么架构?
下面是我的cpu信息# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 6
model name : Celeron (Mendocino)
stepping : 5
cpu MHz : 401.831
cache size : 128 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr
bogomips : 801.17 uname -a
不就行了。 #!/bin/bash
clear
verbose=0
help=0
if [ "$1" = "-v" ]; then
verbose=1
fi
if [ "$1" = "-h" ]; then
echo "hinv{-v|-h}"
echo "-v=verbose"
echo "-h=help"
exit
fi
mach=`uname -m`
mem=`cat /proc/meminfo | awk '/^MemTotal/ {print $2}'`
proc=`cat /proc/cpuinfo | awk '/^processor/'| grep -c processor`
echo "Total Processors: $proc"
echo "$mach :Processor"
egrep -i "vendor_id|name|MHz|cache" /proc/cpuinfo
echo ""
#echo "Main Memory Size: $mem Mbytes"
echo "Main Memory Size: $mem Mbytes"
if [ -r /proc/ide/ide0/hda/model ];then
echo ""
echo "Host:ide0 Channel:hda"
cat /proc/ide/ide0/hda/model
fi
if [ -r /proc/ide/ide0/hdb/model ];then
echo ""
echo "Host:ide0 Channel:hdb"
cat /proc/ide/ide0/hdb/model
fi
if [ -r /proc/ide/ide1/hdc/model ];then
echo ""
echo "Host:ide Channel:hdc"
cat /proc/ide/ide1/model
fi
if [ -r /proc/ide/ide1/hdd/model ];then
echo ""
echo "Host:ide Channel:hdd"
cat /proc/ide/ide1/hdd/model
fi
if [ -r /proc/scsi/scsi ];then
echo ""
egrep "Host|Vendor" /proc/scsi/scsi
fi
echo ""
echo "Serial Ports:"`egrep -c serial /proc/ioports`
echo "Keyboard Detected:" `egrep -c keyboard /proc/ioports`
echo "Ethernet Controllers:"`/sbin/ifconfig | awk '/^eth/ {print $1}'`
echo ""
egrep controller /proc/pci
if [ $verbose -ne 0 ];then
egrep "bridge" /proc/pci
fi
参考。
Re: 请问怎么通过/proc/cpuinfo判断是什么架构?
下面是我的cpu信息# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 6
model name : Celeron (Mendocino)
stepping : 5
cpu MHz : 401.831
cache size : 128 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr
bogomips : 801.17
页:
[1]