summaryrefslogtreecommitdiff
path: root/doc/usage/cmd/cpuid.rst
blob: cccf9262ed4d80c7a6bd117804b8f6e51a83e43b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
.. SPDX-License-Identifier: GPL-2.0+

.. index::
   single: cpuid (command)

cpuid command
=============

Synopsis
--------

::

    cpuid <op>

Description
-----------

The cpuid command requests CPU-identification information on x86 CPUs. The
operation <op> selects what information is returned. Up to four 32-bit registers
can be update (eax-edx) depending on the operation.

Configuration
-------------

The cpuid command is only available on x86.

Return value
------------

The return value $? is 0 (true).

Example
-------

::

    => cpuid 1
    eax 00060fb1
    ebx 00040800
    ecx 80002001
    edx 178bfbfd

This shows checking for 64-bit 'long' mode::

    => cpuid 80000000
    eax 8000000a
    ebx 68747541
    ecx 444d4163
    edx 69746e65
    => cpuid 80000001
    eax 00060fb1
    ebx 00000000
    ecx 00000007
    edx 2193fbfd   # Bit 29 is set in edx, so long mode is available

On a 32-bit-only CPU::

    => cpuid 80000000
    eax 80000004
    ebx 756e6547
    ecx 6c65746e
    edx 49656e69
    => cpuid 80000001
    eax 00000663
    ebx 00000000
    ecx 00000000
    edx 00000000   # Bit 29 is not set in edx, so long mode is not available