初学者,如何知道自己的机器硬件对Linux的支持情况?

CPU/显卡/打印机/USB设备等硬件问题
回复
头像
bjlaoshu
帖子: 15
注册时间: 2011-10-27 11:27
系统: Gentoo
来自: http://www.linuxcoming.com
联系:

初学者,如何知道自己的机器硬件对Linux的支持情况?

#1

帖子 bjlaoshu » 2016-07-15 13:27

如果我们想要安装或者升级Linux系统,此时我们就需要我们收集硬件信息了,比如内存,BIOS,CPU等等.在 dmidecode命令的帮助下,我们无需打开机箱,就可以知道所有的硬件细节.dmidecode命令适用于常见的Linux系统,比如RHEL,CentOS,Fedora,Ubuntu等等.

dmidecode通过读取DMI表来获取硬件数据,并展示有用的硬件信息,比如硬件细节,序列号,BIOS版本,处理器等等.要使用dmidecode,你可能需要root用户权限.对于初学者, 我们可以使用一个Live CD来启动一个Linux环境通过dmidecode命令查看硬件信息.

1.dmidecode基本输出
下面是dmidecode命令的一个输出示例:

代码: 全选

# dmidecode 2.11
SMBIOS version fixup (2.31 -> 2.3).
SMBIOS 2.3 present.
45 structures occupying 1642 bytes.
Table at 0x000E0010.

Handle 0x0000, DMI type 0, 20 bytes
BIOS Information
        Vendor: Phoenix Technologies LTD
        Version: 6.00
        Release Date: 12/06/2006
        Address: 0xE78A0
        Runtime Size: 100192 bytes
        ROM Size: 64 kB
        Characteristics:
                ISA is supported
                PCI is supported
                PC Card (PCMCIA) is supported
                PNP is supported
                APM is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                ESCD support is available
               USB legacy is supported
                Smart battery is supported
                BIOS boot specification is supported
2.如何获取DMI类型
dmidecode 可以通过 "-t" 或者 "-type"选项指定硬件编号,这将给我显示出指定的硬件信息. 比如"dmidecode -t 6"将给我们显示内存设备信息.

代码: 全选

[root@localhost ~]# dmidecode -t 6
# dmidecode 2.11
SMBIOS version fixup (2.31 -> 2.3).
SMBIOS 2.3 present.

Handle 0x0009, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: RAM socket #0
        Bank Connections: 0 1
        Current Speed: Unknown
        Type: EDO DIMM
        Installed Size: 1024 MB (Single-bank Connection)
        Enabled Size: 1024 MB (Single-bank Connection)
        Error Status: OK

Handle 0x000A, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: RAM socket #1
        Bank Connections: 2 3
        Current Speed: Unknown
        Type: EDO DIMM
        Installed Size: Not Installed
        Enabled Size: Not Installed
        Error Status: OK

Handle 0x000B, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: RAM socket #2
        Bank Connections: 4 5
        Current Speed: Unknown
        Type: EDO DIMM
        Installed Size: Not Installed
        Enabled Size: Not Installed
        Error Status: OK

Handle 0x000C, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: RAM socket #3
        Bank Connections: 6 7
        Current Speed: Unknown
        Type: EDO DIMM
        Installed Size: Not Installed
        Enabled Size: Not Installed
        Error Status: OK
下面是设备类型编号列表:

代码: 全选

		Type   Information
		----------------------------------------
          0		BIOS
          1		System
          2		Base Board
          3		Chassis
          4		Processor
          5		Memory Controller
          6		Memory Module
          7		Cache
          8		Port Connector
          9		System Slots
         10		On Board Devices
         11		OEM Strings
         12		System Configuration Options
         13		BIOS Language
         14		Group Associations
         15		System Event Log
         16		Physical Memory Array
         17		Memory Device
         18		32-bit Memory Error
         19		Memory Array Mapped Address
         20		Memory Device Mapped Address
         21		Built-in Pointing Device
         22		Portable Battery
         23		System Reset
         24		Hardware Security
         25		System Power Controls
         26		Voltage Probe
         27		Cooling Device
         28		Temperature Probe
         29		Electrical Current Probe
         30		Out-of-band Remote Access
         31		Boot Integrity Services
         32		System Boot
         33		64-bit Memory Error
         34		Management Device
         35		Management Device Component
         36		Management Device Threshold Data
         37		Memory Channel
         38		IPMI Device
         39		Power Supply
相反的使用,我们也可以使用"dmidecode -t"选项指定硬件类型的关键字来获取设备详情,下面是硬件类型的关键字:

代码: 全选

	Keyword     Types
       ------------------------------
       bios        0, 13
       system      1, 12, 15, 23, 32
       baseboard   2, 10
       chassis     3
       processor   4
       memory      5, 6, 16, 17
       cache       7
       connector   8
       slot        9
比如,我们要获取系统的缓存信息,你可以执行下面的命令来代替 "dmidecode -t 7"命令.

代码: 全选

[root@tecmint ~]# dmidecode -t cache
# dmidecode 2.11
SMBIOS version fixup (2.31 -> 2.3).
SMBIOS 2.3 present.

Handle 0x000D, DMI type 7, 19 bytes
Cache Information
        Socket Designation: L1 Cache
        Configuration: Enabled, Socketed, Level 1
        Operational Mode: Write Back
        Location: Internal
        Installed Size: 16 kB
        Maximum Size: 16 kB
        Supported SRAM Types:
                Burst
                Pipeline Burst
                Asynchronous
        Installed SRAM Type: Asynchronous
        Speed: Unknown
        Error Correction Type: Unknown
        System Type: Unknown
        Associativity: Unknown

Handle 0x000E, DMI type 7, 19 bytes
Cache Information
        Socket Designation: L2 Cache
        Configuration: Enabled, Socketed, Level 2
        Operational Mode: Write Back
        Location: External
        Installed Size: 0 kB
        Maximum Size: 512 kB
        Supported SRAM Types:
                Burst
                Pipeline Burst
                Asynchronous
        Installed SRAM Type: None
        Speed: Unknown
        Error Correction Type: Unknown
        System Type: Unknown
        Associativity: Unknown
dmidecode命令的更多信息可以使用"man dmidecoide"命令.

硬件信息收集完成之后, 我们就可以到对应硬件厂商的官网查找对应型号的Linux驱动,有些驱动可能已经集成在内核中了,所有除了查看官网的Linux, 你也需要到kernel.org去查看下内核对你硬件的支持情况
Gentoo Linux忠实粉丝, 目前已经稳定使用超过三年.喜欢分享,欢迎到我的个人网站联系我 http://www.linuxcoming.com
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: 初学者,如何知道自己的机器硬件对Linux的支持情况?

#2

帖子 科学之子 » 2016-07-19 19:28

bjlaoshu 写了:如果我们想要安装或者升级Linux系统,此时我们就需要我们收集硬件信息了,比如内存,BIOS,CPU等等.在 dmidecode命令的帮助下,我们无需打开机箱,就可以知道所有的硬件细节.dmidecode命令适用于常见的Linux系统,比如RHEL,CentOS,Fedora,Ubuntu等等.

dmidecode通过读取DMI表来获取硬件数据,并展示有用的硬件信息,比如硬件细节,序列号,BIOS版本,处理器等等.要使用dmidecode,你可能需要root用户权限.对于初学者, 我们可以使用一个Live CD来启动一个Linux环境通过dmidecode命令查看硬件信息.

1.dmidecode基本输出
下面是dmidecode命令的一个输出示例:

代码: 全选

# dmidecode 2.11
SMBIOS version fixup (2.31 -> 2.3).
SMBIOS 2.3 present.
45 structures occupying 1642 bytes.
Table at 0x000E0010.

Handle 0x0000, DMI type 0, 20 bytes
BIOS Information
        Vendor: Phoenix Technologies LTD
        Version: 6.00
        Release Date: 12/06/2006
        Address: 0xE78A0
        Runtime Size: 100192 bytes
        ROM Size: 64 kB
        Characteristics:
                ISA is supported
                PCI is supported
                PC Card (PCMCIA) is supported
                PNP is supported
                APM is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                ESCD support is available
               USB legacy is supported
                Smart battery is supported
                BIOS boot specification is supported
2.如何获取DMI类型
dmidecode 可以通过 "-t" 或者 "-type"选项指定硬件编号,这将给我显示出指定的硬件信息. 比如"dmidecode -t 6"将给我们显示内存设备信息.

代码: 全选

[root@localhost ~]# dmidecode -t 6
# dmidecode 2.11
SMBIOS version fixup (2.31 -> 2.3).
SMBIOS 2.3 present.

Handle 0x0009, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: RAM socket #0
        Bank Connections: 0 1
        Current Speed: Unknown
        Type: EDO DIMM
        Installed Size: 1024 MB (Single-bank Connection)
        Enabled Size: 1024 MB (Single-bank Connection)
        Error Status: OK

Handle 0x000A, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: RAM socket #1
        Bank Connections: 2 3
        Current Speed: Unknown
        Type: EDO DIMM
        Installed Size: Not Installed
        Enabled Size: Not Installed
        Error Status: OK

Handle 0x000B, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: RAM socket #2
        Bank Connections: 4 5
        Current Speed: Unknown
        Type: EDO DIMM
        Installed Size: Not Installed
        Enabled Size: Not Installed
        Error Status: OK

Handle 0x000C, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: RAM socket #3
        Bank Connections: 6 7
        Current Speed: Unknown
        Type: EDO DIMM
        Installed Size: Not Installed
        Enabled Size: Not Installed
        Error Status: OK
下面是设备类型编号列表:

代码: 全选

		Type   Information
		----------------------------------------
          0		BIOS
          1		System
          2		Base Board
          3		Chassis
          4		Processor
          5		Memory Controller
          6		Memory Module
          7		Cache
          8		Port Connector
          9		System Slots
         10		On Board Devices
         11		OEM Strings
         12		System Configuration Options
         13		BIOS Language
         14		Group Associations
         15		System Event Log
         16		Physical Memory Array
         17		Memory Device
         18		32-bit Memory Error
         19		Memory Array Mapped Address
         20		Memory Device Mapped Address
         21		Built-in Pointing Device
         22		Portable Battery
         23		System Reset
         24		Hardware Security
         25		System Power Controls
         26		Voltage Probe
         27		Cooling Device
         28		Temperature Probe
         29		Electrical Current Probe
         30		Out-of-band Remote Access
         31		Boot Integrity Services
         32		System Boot
         33		64-bit Memory Error
         34		Management Device
         35		Management Device Component
         36		Management Device Threshold Data
         37		Memory Channel
         38		IPMI Device
         39		Power Supply
相反的使用,我们也可以使用"dmidecode -t"选项指定硬件类型的关键字来获取设备详情,下面是硬件类型的关键字:

代码: 全选

	Keyword     Types
       ------------------------------
       bios        0, 13
       system      1, 12, 15, 23, 32
       baseboard   2, 10
       chassis     3
       processor   4
       memory      5, 6, 16, 17
       cache       7
       connector   8
       slot        9
比如,我们要获取系统的缓存信息,你可以执行下面的命令来代替 "dmidecode -t 7"命令.

代码: 全选

[root@tecmint ~]# dmidecode -t cache
# dmidecode 2.11
SMBIOS version fixup (2.31 -> 2.3).
SMBIOS 2.3 present.

Handle 0x000D, DMI type 7, 19 bytes
Cache Information
        Socket Designation: L1 Cache
        Configuration: Enabled, Socketed, Level 1
        Operational Mode: Write Back
        Location: Internal
        Installed Size: 16 kB
        Maximum Size: 16 kB
        Supported SRAM Types:
                Burst
                Pipeline Burst
                Asynchronous
        Installed SRAM Type: Asynchronous
        Speed: Unknown
        Error Correction Type: Unknown
        System Type: Unknown
        Associativity: Unknown

Handle 0x000E, DMI type 7, 19 bytes
Cache Information
        Socket Designation: L2 Cache
        Configuration: Enabled, Socketed, Level 2
        Operational Mode: Write Back
        Location: External
        Installed Size: 0 kB
        Maximum Size: 512 kB
        Supported SRAM Types:
                Burst
                Pipeline Burst
                Asynchronous
        Installed SRAM Type: None
        Speed: Unknown
        Error Correction Type: Unknown
        System Type: Unknown
        Associativity: Unknown
dmidecode命令的更多信息可以使用"man dmidecoide"命令.

硬件信息收集完成之后, 我们就可以到对应硬件厂商的官网查找对应型号的Linux驱动,有些驱动可能已经集成在内核中了,所有除了查看官网的Linux, 你也需要到kernel.org去查看下内核对你硬件的支持情况
你也需要到kernel.org去查看下内核对你硬件的支持情况
在kernel.org哪里看?
头像
bjlaoshu
帖子: 15
注册时间: 2011-10-27 11:27
系统: Gentoo
来自: http://www.linuxcoming.com
联系:

Re: 初学者,如何知道自己的机器硬件对Linux的支持情况?

#3

帖子 bjlaoshu » 2016-07-20 9:56

科学之子 写了:
bjlaoshu 写了:如果我们想要安装或者升级Linux系统,此时我们就需要我们收集硬件信息了,比如内存,BIOS,CPU等等.在 dmidecode命令的帮助下,我们无需打开机箱,就可以知道所有的硬件细节.dmidecode命令适用于常见的Linux系统,比如RHEL,CentOS,Fedora,Ubuntu等等.

dmidecode通过读取DMI表来获取硬件数据,并展示有用的硬件信息,比如硬件细节,序列号,BIOS版本,处理器等等.要使用dmidecode,你可能需要root用户权限.对于初学者, 我们可以使用一个Live CD来启动一个Linux环境通过dmidecode命令查看硬件信息.

1.dmidecode基本输出
下面是dmidecode命令的一个输出示例:

代码: 全选

# dmidecode 2.11
SMBIOS version fixup (2.31 -> 2.3).
SMBIOS 2.3 present.
45 structures occupying 1642 bytes.
Table at 0x000E0010.

Handle 0x0000, DMI type 0, 20 bytes
BIOS Information
        Vendor: Phoenix Technologies LTD
        Version: 6.00
        Release Date: 12/06/2006
        Address: 0xE78A0
        Runtime Size: 100192 bytes
        ROM Size: 64 kB
        Characteristics:
                ISA is supported
                PCI is supported
                PC Card (PCMCIA) is supported
                PNP is supported
                APM is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                ESCD support is available
               USB legacy is supported
                Smart battery is supported
                BIOS boot specification is supported
2.如何获取DMI类型
dmidecode 可以通过 "-t" 或者 "-type"选项指定硬件编号,这将给我显示出指定的硬件信息. 比如"dmidecode -t 6"将给我们显示内存设备信息.

代码: 全选

[root@localhost ~]# dmidecode -t 6
# dmidecode 2.11
SMBIOS version fixup (2.31 -> 2.3).
SMBIOS 2.3 present.

Handle 0x0009, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: RAM socket #0
        Bank Connections: 0 1
        Current Speed: Unknown
        Type: EDO DIMM
        Installed Size: 1024 MB (Single-bank Connection)
        Enabled Size: 1024 MB (Single-bank Connection)
        Error Status: OK

Handle 0x000A, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: RAM socket #1
        Bank Connections: 2 3
        Current Speed: Unknown
        Type: EDO DIMM
        Installed Size: Not Installed
        Enabled Size: Not Installed
        Error Status: OK

Handle 0x000B, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: RAM socket #2
        Bank Connections: 4 5
        Current Speed: Unknown
        Type: EDO DIMM
        Installed Size: Not Installed
        Enabled Size: Not Installed
        Error Status: OK

Handle 0x000C, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: RAM socket #3
        Bank Connections: 6 7
        Current Speed: Unknown
        Type: EDO DIMM
        Installed Size: Not Installed
        Enabled Size: Not Installed
        Error Status: OK
下面是设备类型编号列表:

代码: 全选

		Type   Information
		----------------------------------------
          0		BIOS
          1		System
          2		Base Board
          3		Chassis
          4		Processor
          5		Memory Controller
          6		Memory Module
          7		Cache
          8		Port Connector
          9		System Slots
         10		On Board Devices
         11		OEM Strings
         12		System Configuration Options
         13		BIOS Language
         14		Group Associations
         15		System Event Log
         16		Physical Memory Array
         17		Memory Device
         18		32-bit Memory Error
         19		Memory Array Mapped Address
         20		Memory Device Mapped Address
         21		Built-in Pointing Device
         22		Portable Battery
         23		System Reset
         24		Hardware Security
         25		System Power Controls
         26		Voltage Probe
         27		Cooling Device
         28		Temperature Probe
         29		Electrical Current Probe
         30		Out-of-band Remote Access
         31		Boot Integrity Services
         32		System Boot
         33		64-bit Memory Error
         34		Management Device
         35		Management Device Component
         36		Management Device Threshold Data
         37		Memory Channel
         38		IPMI Device
         39		Power Supply
相反的使用,我们也可以使用"dmidecode -t"选项指定硬件类型的关键字来获取设备详情,下面是硬件类型的关键字:

代码: 全选

	Keyword     Types
       ------------------------------
       bios        0, 13
       system      1, 12, 15, 23, 32
       baseboard   2, 10
       chassis     3
       processor   4
       memory      5, 6, 16, 17
       cache       7
       connector   8
       slot        9
比如,我们要获取系统的缓存信息,你可以执行下面的命令来代替 "dmidecode -t 7"命令.

代码: 全选

[root@tecmint ~]# dmidecode -t cache
# dmidecode 2.11
SMBIOS version fixup (2.31 -> 2.3).
SMBIOS 2.3 present.

Handle 0x000D, DMI type 7, 19 bytes
Cache Information
        Socket Designation: L1 Cache
        Configuration: Enabled, Socketed, Level 1
        Operational Mode: Write Back
        Location: Internal
        Installed Size: 16 kB
        Maximum Size: 16 kB
        Supported SRAM Types:
                Burst
                Pipeline Burst
                Asynchronous
        Installed SRAM Type: Asynchronous
        Speed: Unknown
        Error Correction Type: Unknown
        System Type: Unknown
        Associativity: Unknown

Handle 0x000E, DMI type 7, 19 bytes
Cache Information
        Socket Designation: L2 Cache
        Configuration: Enabled, Socketed, Level 2
        Operational Mode: Write Back
        Location: External
        Installed Size: 0 kB
        Maximum Size: 512 kB
        Supported SRAM Types:
                Burst
                Pipeline Burst
                Asynchronous
        Installed SRAM Type: None
        Speed: Unknown
        Error Correction Type: Unknown
        System Type: Unknown
        Associativity: Unknown
dmidecode命令的更多信息可以使用"man dmidecoide"命令.

硬件信息收集完成之后, 我们就可以到对应硬件厂商的官网查找对应型号的Linux驱动,有些驱动可能已经集成在内核中了,所有除了查看官网的Linux, 你也需要到kernel.org去查看下内核对你硬件的支持情况
你也需要到kernel.org去查看下内核对你硬件的支持情况
在kernel.org哪里看?
从 kernel.org 上下载对应版本内核源码,源码中包含下面几个路径

代码: 全选

Documentation/devicetree
drivers
里面可以查看到当前内核支持的硬件驱动

简单的话, 直接在内核源码根目录执行 make menuconfig 命令,直接进入内核配置的命令行下查看是否有支持你的硬件驱动
Gentoo Linux忠实粉丝, 目前已经稳定使用超过三年.喜欢分享,欢迎到我的个人网站联系我 http://www.linuxcoming.com
回复