linux查看硬件信息及驱动设备相关整理(留存验证)

来源:互联网 发布:2014网络女歌手名字 编辑:程序博客网 时间:2024/05/16 09:31

在LINUX环境开发驱动程序,首先要探测到新硬件,接下来就是开发驱动程序。
常用命令整理如下:
用硬件检测程序kuduz探测新硬件:service kudzu start ( or restart)
查看CPU信息:cat /proc/cpuinfo
查看板卡信息:cat /proc/pci
查看PCI信息:lspci (相比cat /proc/pci更直观)
查看内存信息:cat /proc/meminfo
查看USB设备:cat /proc/bus/usb/devices
查看键盘和鼠标:cat /proc/bus/input/devices
查看系统硬盘信息和使用情况:fdisk & disk - l   & df
查看各设备的中断请求(IRQ):cat /proc/interrupts
查看系统体系结构:uname -a
dmidecode查看硬件信息,包括bios、cpu、内存等信息
dmesg | more 查看硬件信息
----------------------------------
我的FC5显示结果如下:
查看键盘和鼠标
[root@localhost input]# cat /proc/bus/input/devices
I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/class/input/input0
H: Handlers=kbd event0
B: EV=120013
B: KEY=4 2000000 3802078 f840d001 f2ffffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=7
I: Bus=0003 Vendor=06a2 Product=0001 Version=0100
N: Name="                  USB Mouse          "
P: Phys=usb-0000:00:03.2-2/input0
S: Sysfs=/class/input/input2
H: Handlers=mouse0 event1
B: EV=7
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=103
查看PCI设备:
[root@localhost proc]# lspci
00:00.0 Host bridge: Silicon Integrated Systems [SiS] 651 Host
00:01.0 PCI bridge: Silicon Integrated Systems [SiS] Virtual PCI-to-PCI bridge (AGP)
00:02.0 ISA bridge: Silicon Integrated Systems [SiS] SiS962 [MuTIOL Media IO]
(rev 04)
00:02.1 SMBus: Silicon Integrated Systems [SiS] SiS961/2 SMBus Controller
00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE]
00:02.7 Multimedia audio controller: Silicon Integrated Systems [SiS] Sound     //集成声卡
Controller (rev a0)
00:03.0 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f)
00:03.1 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f)
00:03.2 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f)
00:03.3 USB Controller: Silicon Integrated Systems [SiS] USB 2.0 Controller
00:04.0 Ethernet controller: Silicon Integrated Systems [SiS] SiS900 PCI Fast    //集成网卡
Ethernet (rev 90)
01:00.0 VGA compatible controller: Silicon Integrated Systems [SiS] 65x/M650/740PCI/AGP VGA Display Adapter                                                                                                   //集成显卡

查看CPU信息:
cat /proc/cpuinfo
processor        : 0
vendor_id        : GenuineIntel                 // Intel
cpu family       : 15
model            : 1
model name       : Intel(R) Celeron(R) CPU 1.70GHz
stepping         : 3
cpu MHz          : 1703.090
cache size       : 128 KB
fdiv_bug         : no
hlt_bug          : no
f00f_bug         : no
coma_bug         : no
fpu              : yes
fpu_exception    : yes
cpuid level      : 2
wp               : yes
flags            : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips         : 3411.63
查看内存信息:
cat meminfo
MemTotal:        321104 kB          // 256M+128M
MemFree:           5212 kB
Buffers:          10284 kB
Cached:          157304 kB
SwapCached:           0 kB
Active:          171456 kB
Inactive:        117120 kB
HighTotal:            0 kB
HighFree:             0 kB
LowTotal:        321104 kB
LowFree:           5212 kB
SwapTotal:       522104 kB
SwapFree:        522104 kB
Dirty:              116 kB
Writeback:            0 kB
Mapped:          177868 kB
Slab:             19224 kB
CommitLimit:     682656 kB
Committed_AS:    412960 kB
PageTables:        3736 kB
VmallocTotal:    704504 kB
VmallocUsed:       2776 kB
VmallocChunk:    701540 kB
HugePages_Total:      0
HugePages_Free:       0
Hugepagesize:      4096 kB
查看USB设备:
插上我的魅族:
cat /proc/bus/usb/devices
T:   Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=   1 Spd=480 MxCh= 6
B:   Alloc=   0/800 us ( 0%), #Int=   0, #Iso=   0
D:   Ver= 2.00 Cls=09(hub   ) Sub=00 Prot=01 MxPS=64 #Cfgs=   1
P:   Vendor=0000 ProdID=0000 Rev= 2.06
S:   Manufacturer=Linux 2.6.15-1.2054_FC5 ehci_hcd
S:   Product=EHCI Host Controller
S:   SerialNumber=0000:00:03.3
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=   0mA
I:   If#= 0 Alt= 0 #EPs= 1 Cls=09(hub   ) Sub=00 Prot=00 Driver=hub
E:   Ad=81(I) Atr=03(Int.) MxPS=    2 Ivl=256ms
T:   Bus=04 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=   6 Spd=480 MxCh= 0
D:   Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=   1
P:  Vendor=0471 ProdID=0000 Rev= 0.01
S:  Manufacturer=MEIZU Co., Ltd                      //魅族MP3
S:  Product=Meizu E3 HS
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:   If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:   Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:   Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
T:   Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=   1 Spd=12   MxCh= 2
B:   Alloc= 14/900 us ( 2%), #Int=   1, #Iso=   0
D:   Ver= 1.10 Cls=09(hub   ) Sub=00 Prot=00 MxPS=64 #Cfgs=   1
P:   Vendor=0000 ProdID=0000 Rev= 2.06
S:   Manufacturer=Linux 2.6.15-1.2054_FC5 ohci_hcd
S:   Product=OHCI Host Controller
S:   SerialNumber=0000:00:03.2
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=   0mA
I:   If#= 0 Alt= 0 #EPs= 1 Cls=09(hub   ) Sub=00 Prot=00 Driver=hub
E:   Ad=81(I) Atr=03(Int.) MxPS=    2 Ivl=255ms
T:   Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=   3 Spd=1.5 MxCh= 0
D:   Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=   1
P:   Vendor=06a2 ProdID=0001 Rev= 1.00                            //USB键盘
S:   Manufacturer=
S:   Product=   USB Mouse
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:   If#= 0 Alt= 0 #EPs= 1 Cls=03(HID   ) Sub=01 Prot=02 Driver=usbhid
E:   Ad=81(I) Atr=03(Int.) MxPS=    8 Ivl=10ms
T:   Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=   1 Spd=12   MxCh= 2
[root@localhost usb]#

 

 

在Linux中查看硬件信息的工具:

1、lspci 列出所有PCI 设备

lspci - list all PCI devices

2、dmesg

dmesg 是一个显示内核缓冲区系统控制信息的工具;比如系统在启动时的信息会写到/var/log/
注:dmesg 工具并不是专门用来查看硬件芯片组标识的工具,但通过这个工具能让我们知道机器中的硬件的一些参数;因为系统在启动的时候,会写一些硬件相关的日志到 /var/log/message* 或 /var/log/boot* 文件中;
如果我们用这个工具来查看一些硬件的信息;这个工具信息量太大,的确需要耐心;
[root@localhost beinan]# dmesg
[root@localhost beinan]# dmesg -c 注:清理掉缓冲区,下次开机的时候还会自动生成;

3、hwbrowser

hwbrowser 是 您当前硬件配置的图形化浏览器 ,这个工具是图形的。可能系统在默认的情况下没有安装。需要您安装才行。在Fedora 4.0 中,如果能用yum 或apt 应该是通过如下的命令来安装;
[root@localhost beinan]# yum install hwbrowser

[root@localhost beinan]# apt install hwbrowser
[root@localhost beinan]# hwbrowser
当然您也可以通过rpmfind.net 或者freshrpms.net 上寻找rpm 包来安装
[root@localhost beinan]# rpm -ivh hwbrowser*.rpm
我建议您最好是通过软件包更新工具yum 和apt来安装,这样能自动解决依赖关系;

4、lshal 和 hal-device-manager

通过 lshal 和hal-device-manager 也能知道硬件相关信息,不过这个工具对新手操作起来是有点麻烦,但我还是得介绍一下;
[root@localhost beinan]# lshal
hwbrowser 是 lshal 的图形化界;可能系统在默认的情况下没有安装,这个工具包是Fedora 扩展包,需要您安装才行。在Fedora 4.0 中,如果能用yum 或apt 应该是通过如下的命令来安装;
[root@localhost beinan]# yum install hal-device-manager

[root@localhost beinan]# apt install hal-device-manager
[root@localhost beinan]# hal-device-manager
当然您也可以通过rpmfind.net 或者freshrpms.net 上寻找rpm 包来安装
[root@localhost beinan]# rpm -ivh hal-device-manager*.rpm

原创粉丝点击