“机器硬件”和“机器硬件”之间的差异和“硬件平台”
我的 Linux 机器报告“uname -a”输出如下:
[root@tom i386]# uname -a
Linux tom 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:34:33 EDT 2009 i686 i686 i386 GNU/Linux
[root@tom i386]#
根据 uname 的手册页,条目“i686 i686 i386”表示:
- 机器硬件名称 (i686)
- 处理器类型 (i686)
- 硬件平台 (i386)
其他信息:
[root@tom i386]# cat /proc/cpuinfo
<snip>
vendor_id : GenuineIntel
CPU family : 6
model : 15
model name : Intel(R) Xeon(R) CPU 5148 @ 2.33 GHz
stepping : 6
CPU MHz : 2328.038
cache size : 4096 KB
</snip>
只是为了添加,为什么我有兴趣知道它。当我在这台机器上构建RPM时,我在RPM目录下发现了两个目录,i386
和i686
。
因此,如果我想自动将生成的 RPM 复制到某个位置,我应该在 shell 脚本中指定哪个目录?我使用的 uname -p
给出了 i686
但 RPM 生成了 i386
。
My Linux machine reports "uname -a" outputs as below:
[root@tom i386]# uname -a
Linux tom 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:34:33 EDT 2009 i686 i686 i386 GNU/Linux
[root@tom i386]#
As per man page of uname, the entries "i686 i686 i386" denotes:
- machine hardware name (i686)
- processor type (i686)
- hardware platform (i386)
Additional information:
[root@tom i386]# cat /proc/cpuinfo
<snip>
vendor_id : GenuineIntel
CPU family : 6
model : 15
model name : Intel(R) Xeon(R) CPU 5148 @ 2.33 GHz
stepping : 6
CPU MHz : 2328.038
cache size : 4096 KB
</snip>
Just to add, why I am interested to know it. When I build an RPM on this machine, I found two directories under RPM directory, i386
and i686
.
So if I want to automate the copying of a generated RPM to a location, which directory should I specify in the shell script? I am using uname -p
which gives i686
but RPM generated i386
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您的情况下,它告诉您的是,您正在 64 位处理器上运行 32 位操作系统。代码与 386 兼容。
它们是:
第一个表示有关检测到的 CPU 的信息。第二个关于 uname 程序编译到的目标体系结构。在某些 CPU 上,它们默认为“未知”。内核应该提供此信息,但如果没有可用的信息,则默认为硬编码字符串。
就我而言:
$ uname -a
$ uname --machine
$ uname --hardware-platform
In your case what it tells you is, you're running a 32-bit operating system on a 64-bit processor. Code is compatible with a 386.
They are:
The first one says something about the CPU that was detected. The second one about target architecture the uname program was compiled to. On some CPU's they default to 'unknown'. The kernel should provide this information, but if there is nothing available it defaults to hard coded strings.
In my case:
$ uname -a
$ uname --machine
$ uname --hardware-platform
在这种情况下,我认为区别在于硬件平台是家庭硬件,即。 i386 兼容集或处理器。而机器指的是您的特定机器,即 i686,它属于 i386 处理器系列。
In this case I think the distinction is that hardware platform is family hardware ie. the i386 compatible set or processors. Whereas machine refers to your particular machine ie a i686 which is in the famility on i386 processors.