免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3282 | 回复: 2
打印 上一主题 下一主题

如何获取cpu信息 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-03-13 10:26 |只看该作者 |倒序浏览
在B.11.11上如何得到cpu的以下信息:
family
model
revision
vendor 等,B.11.11是不是不支持cpuid指令
在B.11.23(Itanium)上machinfo命令能得到cpu的一些信息,好像也支持cpuid指令,哪位大侠知道怎么用吗。

论坛徽章:
0
2 [报告]
发表于 2006-03-13 11:24 |只看该作者
B.11.11 也可以使用parstatus查看一些信息,这跟B.11.23(Itanium)一样
另外用sam,cstm也可以啊

论坛徽章:
0
3 [报告]
发表于 2006-03-13 14:47 |只看该作者
关于cpuid,刚才查到相关资料,共享一下:
Application level processor identification information is available in a register file termed: CPUID.
This register file is divided into a fixed region, registers 0 to 4, and a variable region, register 5 and
above. The CPUID[3].number field indicates the maximum number of 8-byte registers containing
processor specific information.
The CPUID registers are unprivileged and accessed using the indirect mov (from) instruction. All
registers beyond register CPUID[3].number are reserved and raise a Reserved Register/Field fault
if they are accessed. Writes are not permitted and no instruction exists for such an operation.

Vendor information is located in CPUID registers 0 and 1 and specify a vendor name, in ASCII, for
the processor implementation (Figure 3-10). All bytes after the end of the string up to the 16th byte
are zero. Earlier ASCII characters are placed in lower number register and lower numbered byte
positions.

CPUID register 2 is an ignored register (reads from this register return zero).

CPUID register 3 contains several fields indicating version information related to the processor
implementation.

CPUID register 4 provides general application-level information about processor features.

获取cpuid寄存器的汇编指令为:
_UInt64 _Asm_mov_from_cpuid (_UInt64 r3 [,_Asm_fence]);
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP