Difference between "machine hardware" and "hardware platform"
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
m开发者_StackOverflow中文版odel : 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
.
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 machine hardware name (sometimes called the hardware class or hardware type).
- the hardware platform name (sometimes called the hardware implementation)
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
Linux godiva 2.6.30-amd64 #1 SMP Tue Oct 27 09:12:19 UTC 2009 x86_64 GNU/Linux
$ uname --machine
x86_64
$ uname --hardware-platform
unknown
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.
精彩评论