免费注册 查看新帖 |

Chinaunix

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

关于isainfo查看cpu位数是32或64的疑问? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-10-18 20:06 |只看该作者 |倒序浏览
大家知道用isainfo -b可以查看内核位数。
在solaris上执行命令显示如下:
# isainfo -b
64
然后用psrinfo查看cpu信息。
# psrinfo -v
Status of processor 0 as of: 10/18/07 19:56:15
  Processor has been on-line since 10/08/07 10:02:44.
  The sparcv9 processor operates at 440 MHz,
        and has a sparcv9 floating point processor.
从isainfo -b 看内核是64位,CPU 为SPARC V9,从《solaris  内核结构》中知道64位SPARC V9 二进制代码的ABI规定栈是不可以执行的。
但是pmap命令显示结果如下:
# pmap -x 24621
24621:  SAU_CSC_TST
Address   Kbytes Resident Shared Private Permissions       Mapped File
00010000     848     376       -     376 read/exec         SAU_CSC_TST
000F2000      32      32       -      32 read/write/exec   SAU_CSC_TST
000FA000   21576   21576       -   21576 read/write/exec     [ heap ]
-----------------------------------------------------
FE50C000       8       8       -       8 read/write/exec     [ anon ]
FE608000      16      16       -      16 read/write/exec     [ anon ]
FE60E000       8       8       -       8 read/write/exec     [ anon ]
FE70C000       8       8       -       8 read/write/exec     [ anon ]
FE710000       8       8       -       8 read/write/exec     [ anon ]
FE80E000       8       8       -       8 read/write/exec     [ anon ]
FE9E4000       8       8       -       8 read/write/exec     [ anon ]
FE9F4000       8       8       -       8 read/write/exec     [ anon ]
FEA00000     120     120     112       8 read/exec         libthread.so.1
FEA2E000       8       8       -       8 read/write/exec   libthread.so.1
FEA30000      48      40       -      40 read/write/exec   libthread.so.1
FEA40000      16      16       8       8 read/exec         libmp.so.2
FEA54000       8       8       -       8 read/write/exec   libmp.so.2
--------------------------
FEB68000       8       8       -       8 read/write/exec   libCrun.so.1
FEB6A000      16       -       -       - read/write/exec   libCrun.so.1
FEB80000     672     672     664       8 read/exec         libc.so.1
FEC38000      32      32       -      32 read/write/exec   libc.so.1
FEC50000     168     120      88      32 read/exec         libcurses.so.1
FEC8A000      32      32       8      24 read/write/exec   libcurses.so.1
FEC92000       8       -       -       - read/write/exec   libcurses.so.1
FECA0000     216     216       -     216 read/exec         dev:136,7 ino:253198
FECE4000      80      24       -      24 read/write/exec   dev:136,7 ino:253198
-----------------------------------------
FED64000      88      40       -      40 read/write/exec     [ anon ]
FED80000     552     400       -     400 read/exec         dev:136,7 ino:253193
FEE18000     200      48       -      48 read/write/exec   dev:136,7 ino:253193

FF378000      16      16       -      16 read/write/exec   dev:136,7 ino:253196
FF37C000       8       8       -       8 read/write/exec     [ anon ]
FF390000       8       8       -       8 read/exec         libw.so.1
FF3A0000       8       8       -       8 read/write/exec     [ anon ]
FF3B0000     136     136     128       8 read/exec         ld.so.1
FF3E2000       8       8       -       8 read/write/exec   ld.so.1
FFBEC000      16      16       -      16 read/write/exec     [ stack ]
--------  ------  ------  ------  ------
total Kb   30440   26544    1656   24888

疑问1:如果从isainfo命令显示结果判断cpu是64位的为什么pmap显示的地址空间都是32位呢?(00010000)
疑问2:如果cpu是64位的sparc v9,那么【stack】的模式应该是不可执行的。而pmap显示的结果是如下:
FFBEC000      16      16       -      16 read/write/exec     [ stack ]
【stack】可执行。
疑问3:如果不能用isainfo看cpu位数信息,那么solaris下有什么命令可以看?
疑问4:内核位数不等于cpu位数吗?
希望高手解答,谢谢!

论坛徽章:
0
2 [报告]
发表于 2007-10-18 20:55 |只看该作者
file /usr/bin/ls,就知道了
内核和操作系统支持64位并不等于全部都是32位的应用。
具体的可以参考《Solaris(64 位)开发者指南>>那本术

论坛徽章:
0
3 [报告]
发表于 2007-10-18 21:47 |只看该作者
你先用 file YourProgramFile 测试你的程序
如最简单的helloWorld程序,编译为32位和64位,其大小是略有差别的。
wuqingping@t1000 ~/testpro]$ls -l hello32 hello64
-rwxr-xr-x   1 wuqingping 5095        7144 May  5 07:48 hello32
-rwxr-xr-x   1 wuqingping 5095        7592 May  5 07:48 hello64

再用 file 命令确认文件的版本。
wuqingping@t1000 ~/testpro]$file hello32
hello32:        ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, dynamically linked, not stripped

wuqingping@t1000 ~/testpro]$file hello64
hello64:        ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped

论坛徽章:
0
4 [报告]
发表于 2007-10-19 08:27 |只看该作者
谢谢楼上两位的回答,你们的答案好像是回答如何看应用程序是否是32位的了。但是如何看cpu的位数信息呢?
是否isainfo命令,显示的是内核可以支持的最高位数?

论坛徽章:
0
5 [报告]
发表于 2007-10-19 08:40 |只看该作者
目前SUN的CPU都是64位的,32位的停产快10年了

论坛徽章:
0
6 [报告]
发表于 2007-10-25 14:13 |只看该作者
学习中
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP