没有驱动的硬件怎么办?
windows下有一大堆硬件检测工具,像驱动之家、everest等。
FreeBSD下呢?Linux下呢?
FreeBSD下,可以使用pciconf来检测硬件。
# pciconf
usage: pciconf -l [-bcev]
pciconf -a selector
pciconf -r [-b | -h] selector addr[:addr2]
pciconf -w [-b | -h] selector addr value
我们只用第一种,也就是-l项。
# pciconf -l
hostb0@pci0:0:0:0: class=0x060000 card=0x84971043 chip=0x01588086 rev=0x09 hdr=0x00
pcib1@pci0:0:1:0: class=0x060400 card=0x84971043 chip=0x01518086 rev=0x09 hdr=0x01
none0@pci0:0:26:0: class=0x0c0320 card=0x84971043 chip=0x1c2d8086 rev=0x05 hdr=0x00
pcib2@pci0:0:28:0: class=0x060400 card=0x84971043 chip=0x1c108086 rev=0xb5 hdr=0x01
pcib3@pci0:0:28:4: class=0x060400 card=0x84971043 chip=0x1c188086 rev=0xb5 hdr=0x01
pcib4@pci0:0:28:5: class=0x060400 card=0x84971043 chip=0x1c1a8086 rev=0xb5 hdr=0x01
none1@pci0:0:29:0: class=0x0c0320 card=0x84971043 chip=0x1c268086 rev=0x05 hdr=0x00
pcib5@pci0:0:30:0: class=0x060401 card=0x84971043 chip=0x244e8086 rev=0xa5 hdr=0x01
isab0@pci0:0:31:0: class=0x060100 card=0x84971043 chip=0x1c528086 rev=0x05 hdr=0x00
ahci0@pci0:0:31:2: class=0x010601 card=0x84971043 chip=0x1c028086 rev=0x05 hdr=0x00
none2@pci0:0:31:3: class=0x0c0500 card=0x84971043 chip=0x1c228086 rev=0x05 hdr=0x00
em0@pci0:3:0:0: class=0x020000 card=0x83691043 chip=0x10d38086 rev=0x00 hdr=0x00
em1@pci0:4:0:0: class=0x020000 card=0x83691043 chip=0x10d38086 rev=0x00 hdr=0x00
vgapci0@pci0:5:5:0: class=0x030000 card=0x84ea1043 chip=0x20001a03 rev=0x10 hdr=0x00
上面的结果中,每行代表一个硬件,@前面是驱动名,比如倒数第二和第三行,代表两块网卡,驱动名为em,表示intel千兆网卡。
none代表没有驱动的硬件,注意没有驱动有多种原因,有些是FreeBSD本身不支持,更多的情况下,是没有编译相应的内核模块。
除了驱动名外,其他的都难以读懂了,我们想看厂商和硬件的文本信息怎么办呢?以下我只列出网卡的部分:
# pciconf -lc
em0@pci0:3:0:0: class=0x020000 card=0x83691043 chip=0x10d38086 rev=0x00 hdr=0x00
vendor = 'Intel Corporation'
device = '82574L Gigabit Network Connection'
class = network
subclass = ethernet
em1@pci0:4:0:0: class=0x020000 card=0x83691043 chip=0x10d38086 rev=0x00 hdr=0x00
vendor = 'Intel Corporation'
device = '82574L Gigabit Network Connection'
class = network
subclass = ethernet
这次能看懂了吧,两块Intel千兆网卡,芯片为82574L,写的清清楚楚了。
再进一步,看一下网卡的性能方面的参数:
# pciconf -lc
em0@pci0:3:0:0: class=0x020000 card=0x83691043 chip=0x10d38086 rev=0x00 hdr=0x00
cap 01[c8] = powerspec 2 supports D0 D3 current D0
cap 05[d0] = MSI supports 1 message, 64 bit
cap 10[e0] = PCI-Express 1 endpoint max data 128(256) link x1(x1)
speed 2.5(2.5) ASPM disabled(L1)
cap 11[a0] = MSI-X supports 5 messages in map 0x1c enabled
ecap 0001[100] = AER 1 0 fatal 0 non-fatal 1 corrected
ecap 0003[140] = Serial 1 60a44cffffe651f8
em1@pci0:4:0:0: class=0x020000 card=0x83691043 chip=0x10d38086 rev=0x00 hdr=0x00
cap 01[c8] = powerspec 2 supports D0 D3 current D0
cap 05[d0] = MSI supports 1 message, 64 bit
cap 10[e0] = PCI-Express 1 endpoint max data 128(256) link x1(x1)
speed 2.5(2.5) ASPM disabled(L1)
cap 11[a0] = MSI-X supports 5 messages in map 0x1c enabled
ecap 0001[100] = AER 1 0 fatal 0 non-fatal 1 corrected
ecap 0003[140] = Serial 1 60a44cffffe651f9
这些是硬件的参数,可以知道该网卡支持MSI-X,支持5个消息队列,64位的网卡。
更为神奇的,我觉得应该是可以显示硬件的错误信息:
# pciconf -le
em0@pci0:3:0:0: class=0x020000 card=0x83691043 chip=0x10d38086 rev=0x00 hdr=0x00
PCI-e errors = Correctable Error Detected
Unsupported Request Detected
Corrected = Advisory Non-Fatal Error
em1@pci0:4:0:0: class=0x020000 card=0x83691043 chip=0x10d38086 rev=0x00 hdr=0x00
PCI-e errors = Correctable Error Detected
Unsupported Request Detected
Corrected = Advisory Non-Fatal Error
vgapci0@pci0:5:5:0: class=0x030000 card=0x84ea1043 chip=0x20001a03 rev=0x10 hdr=0x00
Linux下呢?Ubuntu下有一个lshw,跟这个命令相似。
该贴由hui.chen转至本版2014-11-5 17:04:58