Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible values for `uname -m`

Tags:

linux

unix

The uname(1) command-line utility has a -m option which prints the "machine hardware name".

On Linux, this field comes from the machine member of struct utsname, as populated by the uname(2) system call.

Many other language APIs return this information:

  • Python: os.uname() and platform.machine()
  • PHP: php_uname()

What are the possible values for the "machine" field?

like image 659
Jonathon Reinhart Avatar asked Jul 16 '17 05:07

Jonathon Reinhart


People also ask

How do you find uname?

Use the uname linux command with argument -n to check the Hostname or Network name of your operating system. 5. To check the Kernel release version just use the uname Linux command with argument -r.

What is the result of the uname command?

How to Display General System Information ( uname ) To display system information, use the uname command. Displays the operating system name as well as the system node name, operating system release, operating system version, hardware name, and processor type.

What is $( uname?

uname is a command-line utility that prints basic information about the operating system name and system hardware.

What does uname return?

As of OS/390® Release 2, the uname() function will return "OS/390" as the sysname value, even if the true name of the operating system is different. This is for compatibility purposes. The version value will increase at every new version of the operating system.


1 Answers

Linux

(v4.12 - 2017-July)

Let's refer to the source of the newuname system call.

Tracking this down is complicated by the fact that Linux has UTS namespaces, but the init_uts_ns machine field is initialized by the UTS_MACHINE macro, which is defined per-architecture.

Further complicating matters, machine can be overridden via override_architecture(), if the process is running under a 32-bit "compat" personality, to COMPAT_UTS_MACHINE.

UTS_MACHINE defaults in Makefile to the same thing as ARCH. However, many platforms have separate sub-architectures under the same arch directory, so they set UTS_MACHINE themselves

With the list of directories in arch/ and a little grep-ing of the Linux kernel sources (git grep 'UTS_MACHINE\s*:=' and git grep COMPAT_UTS_MACHINE), we can arrive at this list:

  • alpha
  • arc

  • arm

  • aarch64_be (arm64)
  • aarch64 (arm64)
  • armv8b (arm64 compat)
  • armv8l (arm64 compat)

  • blackfin

  • c6x
  • cris
  • frv
  • h8300
  • hexagon
  • ia64
  • m32r
  • m68k
  • metag
  • microblaze
  • mips (native or compat)
  • mips64 (mips)
  • mn10300
  • nios2
  • openrisc
  • parisc (native or compat)
  • parisc64 (parisc)
  • ppc (powerpc native or compat)
  • ppc64 (powerpc)
  • ppcle (powerpc native or compat)
  • ppc64le (powerpc)
  • s390 (s390x compat)
  • s390x
  • score
  • sh
  • sh64 (sh)
  • sparc (native or compat)
  • sparc64 (sparc)
  • tile
  • unicore32
  • i386 (x86)
  • i686 (x86 compat)
  • x86_64 (x64)
  • xtensa
like image 177
Jonathon Reinhart Avatar answered Oct 01 '22 13:10

Jonathon Reinhart