Linux fundamentals of hardware management hardware management

Author: North-South-North
from: League of Legends Community
Abstract: This article commentary in Linux, representation of hardware and viewing tools; the main purpose is that when we encounter a hardware problem, know how to solve the problem based on the hardware information ;


++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++
text
++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++


First, the Linux system, the hardware basis for the determination of identity;

In LinuxSir.Org forum, so we often see some of the brothers to describe their own hardware, "my brand of graphics card is XXX, Linux does not support how to do?." In fact, this description is the worst, we have no way to help; because Linux identifies the hardware vendor that is based on the chipset, rather than hardware brand; because now most of the hardware vendors are OEM, that is the main hardware chip that they can not produce, but they will be brought from the main chip hardware manufacturers, welding own board, which is the OEM of the process;

No matter what hardware vendors are based on the chipset is identified, rather than what the market see the brand, that brand; for example, we see in the market, there are a variety of graphics, in fact, look at them chips, mostly ATI and NVIDIA, ATI and NVIDIA all drivers are ATI and NVIDIA developed. So when we ask questions, we should say the hardware chip, the chip is driven by a unique identifier, rather than the brand! ! !

So when we are looking for hardware drivers, we must come to the information related to the drive hardware main chip;


Second, the view hardware information in Linux tool;

In Linux, you can not not see the hardware chip information tool, it should be said more clearly Linux tools to be able to view hardware information; Here are a few common tools; we are the most commonly used tools or lspci; other tools just to know a bit;


1, lspci lists all PCI devices;

lspci - list all PCI devices, primarily have to list the machine PCI devices, such as sound cards, video cards, cats, network cards and other devices can also be integrated motherboard listed; lspci is read hwdata database, provided by the package hwdata hwdata ; about the following documents;

[beinan@localhost ~]# rpm -ql hwdata-0.158-1
/etc/hotplug/blacklist
/etc/pcmcia
/etc/pcmcia/config
/usr/X11R6/lib/X11/Cards
/usr/share/doc/hwdata-0.158
/usr/share/doc/hwdata-0.158/COPYING
/usr/share/doc/hwdata-0.158/LICENSE
/usr/share/hwdata
/usr/share/hwdata/CardMonitorCombos
/usr/share/hwdata/Cards
/usr/share/hwdata/MonitorsDB
/usr/share/hwdata/pci.ids
/usr/share/hwdata/pcitable
/usr/share/hwdata/upgradelist
/usr/share/hwdata/usb.ids

lspci There are two parameters we used, -b and -v, lspci to usb interface will be listed;

For example:

[root@localhost beinan]# lspci -b
00:00.0 Host bridge: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)
00:00.1 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)
00:00.3 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)
00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02)
00:02.1 Display controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 83)
00:1f.0 ISA bridge: Intel Corporation 82801DBM (ICH4-M) LPC Interface Bridge (rev 03)
00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller (rev 03)
00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 03)
00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 03)
00:1f.6 Modem: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 03)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
02:09.0 CardBus bridge: Texas Instruments Texas Instruments PCIxx21/x515 Cardbus Controller
02:09.2 FireWire (IEEE 1394): Texas Instruments Texas Instruments OHCI Compliant IEEE 1394 Host Controller
02:09.3 Unknown mass storage controller: Texas Instruments Texas Instruments PCIxx21 Integrated FlashMedia Controller
02:09.4 Class 0805: Texas Instruments Texas Instruments PCI6411, PCI6421, PCI6611, PCI6621, PCI7411, PCI7421, PCI7611, PCI7621 Secure Digital (SD)

Analyze what this machine equipment, mainly to see on the line, associated with our application;

00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02) 
00:02.1 Display controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02)    注:这是显示卡;

USB Controller  表示的是USB 接口;我们看到有三个这样的设备;我的笔记本上正好有三个USB 接口;

Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 03) 注:这是声卡;

Modem: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 03)  注:这是猫;

Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)  注:这是网卡,芯片是8139的;

FireWire (IEEE 1394): Texas Instruments Texas Instruments OHCI Compliant IEEE 1394 Host Controller   注:这是1394接口的信息;事实上我的笔记本也有这样的接口;



That get this information what use is it? If the device supports some bad machine, we can use this information to search on Google, for example, I feel my sound card has a problem, it can be related to the search for ways to find solution to the problem based on sound information; this information, we you can also go to the official hardware chipset to find answers or drive;

If you want to know more hardware details, we can check with lspci -v;

[root@localhost beinan]# lspci -v

For example, we can see by what lspci -v irq the hardware interrupt; for example, the card does not work well, is not the irq conflict? If you do not know how to solve the hardware can not be driven, it is imperative lspci -v hardware information corresponding to the whole posted out, this is the only way to solve the problem; it is also extremely important to learn to ask questions;

Some systems releases, and lsusb tool, try it yourself;


2, the storage device and to view an operating tool;

We view the storage device tools are fdisk; parted; cfdisk etc; the most common and most convenient is fdisk; parted on when a supplement it, this tool now seems not too ripe;

Please refer to:

"Linux view disk partitions, file systems, the use of commands and tools introduced"
"instances to use fdisk commentary"


3, by looking at / proc directory of the file to get some hardware information;

When we see the / etc / fstab, you will notice a line;

/dev/proc               /proc                   proc    defaults        0 0

proc looks like a file system, in fact, he is not a real file system, which is "proc - process information pseudo-filesystem ", roughly translated into Chinese means "the process of steganography File System" Oh, this is my translation, there may be wrong, please correct me a lot;
"at the proc filesystem iS a pseudo-filesystem Which iS Used AS AN interface to Kernel the Data
Structures It iS Commonly Mounted AT / proc Most of IT iS the Read-only, But some Files.. the allow
Kernel to the Variables BE changed. "

I come random interpret a little longer and then understood in terms of their understanding of the content of / proc. proc filesystem interface to the kernel as the kernel data structures, some information (such as hardware information, including CPU, network card, graphics card, memory, file systems, SCSI devices ....) kernel is written proc filesystem, proc mont is to / proc directory; / proc directory has mostly large data file is read-only, but some data is based on changes in the core varies; data / proc directory is constantly changing, for each system process has a PID; can be found in / proc in; we can also ps -aux | to see the process more;

We can read the files in / proc directory by the cat command, such as cpu information;

[root@localhost beinan]# cat /proc/cpuinfo

You need to have detailed content to slowly view; understanding / proc is also necessary;


4、dmesg

a tool information is displayed dmesg kernel buffer control system; such as system startup information is written in / var / log /

Note: dmesg tool is not designed to view the hardware chipset identification tool, but this tool let us know some of the parameters of the machine hardware; because the system at boot time, write some hardware-related logs to / var / log / message * or / var / log / boot * file;

If we use this tool to see some hardware information; this tool too much information, really need patience;

[root@localhost beinan]# dmesg

[root@localhost beinan]# dmesg -c  注:清理掉缓冲区,下次开机的时候还会自动生成;


5、 hwbrowser

hwbrowser is your current hardware configuration of graphical browsers, this tool is graphical. The system might not installed by default. You need to install the job. In Fedora 4.0, if it should be able yum or apt to install by command;

[root@localhost beinan]# yum  install hwbrowser


[root@localhost beinan]# apt install hwbrowser

[root@localhost beinan]# hwbrowser

Of course, you can also look through the rpm package to install on rpmfind.net or freshrpms.net

[root@localhost beinan]# rpm -ivh hwbrowser*.rpm

I suggest that you are the best tools to install the update packages via yum and apt, this can automatically resolve dependencies;


6、lshal 和 hal-device-manager

By lshal and hal-device-manager also knew hardware-related information, but this is the tool for beginners to operate a little trouble, but I still have to explain;

[root@localhost beinan]# lshal

hwbrowser is the graphic interface of lshal; may the system is not installed in the default case, this kit is Fedora expansion pack requires you to install the job. In Fedora 4.0, if it should be able yum or apt to install by command;

[root@localhost beinan]# yum  install hal-device-manager


[root@localhost beinan]# apt install hal-device-manager

[root@localhost beinan]# hal-device-manager

Of course, you can also look through the rpm package to install on rpmfind.net or freshrpms.net

[root@localhost beinan]# rpm -ivh hal-device-manager*.rpm

I suggest that you are the best tools to install the update packages via yum and apt, this can automatically resolve dependencies;


Third, different hardware and different tool configuration profile corresponding thereto;

There are various different hardware configuration tools, but also with the appropriate configuration files; for example configuration files on the monitor and graphics card is /etc/X11/xorg.conf, for older Linux versions should be / etc / X11 / X86Config or X86Config-4, xorg X86 profile or configuration and further comprising a control X desktop environment in a mouse, keyboard or the like;

Sound card configuration file is /etc/modprobe.conf or /etc/modules.conf;

The system configuration file is a file / etc / fstab;

Sound card configuration tools, under normal circumstances is alsaconf

Of course, different distributions have the appropriate hardware configuration or management tool, such as Fedora Core 4.0 has the following hardware configuration or management tool;

[root@localhost beinan]# system-config-mouse
[root@localhost beinan]# system-config-network-tui
[root@localhost beinan]# gnome-system-monitor
[root@localhost beinan]# system-config-network
[root@localhost beinan]# system-config-printer-gui
[root@localhost beinan]# system-config-soundcard
[root@localhost beinan]# setup

Of course, these graphical tools are not a panacea, they still have great functionality limitations; so on the hardware configuration, mostly through text or mode of operation;


Fourth, the hard drive is supported by the kernel, but the drivers are stored?

Hardware drivers must be supported by the kernel, whether it is our own to install the driver, or kernel driver alike. If the hard drive is supported by the kernel module, driver directory is located at: / lib / modules / kernel version / kernel / directory or / lib / modules / kernel version / kernel / drivers directory;

[root@localhost beinan]# uname -r
2.6.11-1.1369_FC4
[root@localhost beinan]# ls /lib/modules/2.6.11-1.1369_FC4/kernel
arch crypto drivers fs lib net sound

Note: Only drivers in the kernel module to the method of support, or our own drives installed, the drive was located in / lib / modules / corresponding directory; if it is directly into the kernel, will not appear in the / lib / modules drive relevant directories;


Fifth, the hardware is not supported by the system how to do?

If a Linux system does not support your hardware, the solution is nothing more than two, one is to download the driver to install their own, most of the Linux open source community driven development, fewer vendors; sometimes you may want to re-compile the kernel , mainly to see the driver inside the documentation how to say. Because the driver was supposed to be supported by the kernel, compile the kernel is also very normal;

It is worth noting: If we want to recompile the kernel, it is best to get a clear idea of ​​the situation of hardware, such as a mouse, floppy disk drives, USB devices; hard disk, the file system ... ... should be carefully looked at;

Please refer to:


postscript:

Linux hardware support few years ago, the current situation is much better than that, such as sound cards, network cards, video cards (non-3D acceleration, 3D acceleration if it is to download the driver vendor, if the vendor does not provide, it is mostly no way, because the hardware manufacturers do not disclose relevant parameters, there is no way to develop the open source community, right);? for some hardware that we still need to install the driver or compile their own kernel to solve;

Linux-driven development of the hardware, the open source community is very positive, but manufacturers rarely offer non-Windows drivers, most Linux drivers are open source community dedication; some might say the most likely Windows hardware drivers, but I do not think so, I have heard ISA sound card interface, makes noises in windows 98 and winme in 2000 but did not drive in windows. But in Linux but support is very good. Ah. . .

Linux on hardware not everyone had said, the older the older hardware to run up the best, Linux support for new devices, manufacturers might just put out products, the open source community, someone studied. A solution will be found in the open source community; but some hardware vendors do not provide parameter-driven development, information and the like, so sometimes the open source community for such hardware is helpless, but this device now appears to be relatively small; most hardware support Linux;

If you encounter a hardware-related issue, it may come through I said above clues to solve, for now without much problem. Just a little careful, small snack, learn how to use Google search, most of the problems can still be solved.


Related documents:

1, "compiled kernel operation flow ── Beginner's Guide to"
2, "Overview of Kernel Management"
3, "with a sound card driver ALSA Detailed Process"
. 4, "the HAL 4.0 Fedora Core Plug mobile storage configuration (USB and 1394) in practice "
5,
" operating and storage device partition file system management Overview "
6, " Fedora / Redhat package Manager's Guide, "
7, " hardware related sites collect "

Reproduced in: https: //www.cnblogs.com/licheng/archive/2008/01/21/1047263.html

Guess you like

Origin blog.csdn.net/weixin_34153893/article/details/92633130