查看自己的cpu,system是32位还是64位的

Ubuntu有点玩厌倦了,想换个fedora玩玩,去官网下fedora 17的ISO的时候,32位和64位的系统镜像摆在眼前,放在以前,我一定会果断下载32位的镜像,因为我一直认为自己的电脑too old 应该是32位的cpu吧。今天上网google了下查看cpu和system info的一些方法,惊讶的发现自己的cpu是64位的,我一直低估它了。唉......


查看系统信息的方法如下:


user$uname -a

Linux alan-ThinkPad-SL 3.2.0-24-generic #38-Ubuntu SMP Tue May 1 16:21:07 UTC 2012 i686 i686 i386 GNU/Linux

这个命令是查看自己系统信息的,并不代表cpu的信息哦。如果看到 i686 或者 i386就表示系统是32位的,如果看到x86-64就代表当前的系统是32位的。


查看cpu信息的方法如下:


user$cat /proc/cpuinfo

processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 15
model name    : Intel(R) Core(TM)2 Duo CPU     T5870  @ 2.00GHz
stepping    : 13
microcode    : 0xa3
cpu MHz        : 2001.000
cache size    : 2048 KB
physical id    : 0
siblings    : 2
core id        : 0
cpu cores    : 2
apicid        : 0
initial apicid    : 0
fdiv_bug    : no
hlt_bug        : no
f00f_bug    : no
coma_bug    : no
fpu        : yes
fpu_exception    : yes
cpuid level    : 10
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida dts
bogomips    : 3990.15
clflush size    : 64
cache_alignment    : 64
address sizes    : 36 bits physical, 48 bits virtual
power management:

processor    : 1
vendor_id    : GenuineIntel
cpu family    : 6
model        : 15
model name    : Intel(R) Core(TM)2 Duo CPU     T5870  @ 2.00GHz
stepping    : 13
microcode    : 0xa3
cpu MHz        : 800.000
cache size    : 2048 KB
physical id    : 0
siblings    : 2
core id        : 1
cpu cores    : 2
apicid        : 1
initial apicid    : 1
fdiv_bug    : no
hlt_bug        : no
f00f_bug    : no
coma_bug    : no
fpu        : yes
fpu_exception    : yes
cpuid level    : 10
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida dts
bogomips    : 3989.97
clflush size    : 64
cache_alignment    : 64
address sizes    : 36 bits physical, 48 bits virtual
power management:



这个命令可以看到,当前cpu的一些物理信息,如 核心数 主频等等,可以看到我的cpu是双核的。 在flags中如果你看到 lm(long mode)字段,则表示cpu是64位的。


这些flag可以从内核代码arch/x86/include/asm/cpufeature.h

* Intel-defined CPU features, CPUID level 0x00000001 (edx), word 0 */
#define X86_FEATURE_FPU        (0*32+ 0) /* Onboard FPU */
#define X86_FEATURE_VME        (0*32+ 1) /* Virtual Mode Extensions */
#define X86_FEATURE_DE        (0*32+ 2) /* Debugging Extensions */
...
/* AMD-defined CPU features, CPUID level 0x80000001, word 1 */
/* Don't duplicate feature flags which are redundant with Intel! */
#define X86_FEATURE_SYSCALL    (1*32+11) /* SYSCALL/SYSRET */
#define X86_FEATURE_MP        (1*32+19) /* MP Capable. */
#define X86_FEATURE_NX        (1*32+20) /* Execute Disable */
#define X86_FEATURE_MMXEXT    (1*32+22) /* AMD MMX extensions */
#define X86_FEATURE_FXSR_OPT    (1*32+25) /* FXSAVE/FXRSTOR optimizations */
#define X86_FEATURE_GBPAGES    (1*32+26) /* "pdpe1gb" GB pages */
#define X86_FEATURE_RDTSCP    (1*32+27) /* RDTSCP */
#define X86_FEATURE_LM        (1*32+29) /* Long Mode (x86-64) */
#define X86_FEATURE_3DNOWEXT    (1*32+30) /* AMD 3DNow! extensions */
#define X86_FEATURE_3DNOW    (1*32+31) /* 3DNow! */
...

比如里面的flag lm,是指long mode,也就是x86_64,
address sizes   : 36 bits physical, 48 bits virtual,
虽然是64位的,但是只用了48位的虚拟地址,36位的物理地址,该cpu支持的最大的物理内存是64G

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值