views:

231

answers:

2

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 info:

[root@tom i386]# cat /proc/cpuinfo 

<snip> 
vendor_id   : GenuineIntel
cpu family  : 6
model       : 15
model name  : Intel(R) Xeon(R) CPU            5148  @ 2.33GHz
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 i686

So if i want to automate the copying of generated RPM to a location, whichdirectory should i specify in the shell script? I am using uname -p which gives i686 but RPM generated i386.

A: 

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.

Preet Sangha
+1  A: 

In your case what it tells you is, you're running a 32-bit operating system on a 64-bit processor. Code 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 info, 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
Eddy Pronk