Automatic hardware detection and configuration in Linux
Source: Internet
Author: User
Article Title: Automatic hardware detection and configuration in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
After my two articles on Hardware Detection and configuration, "How to Implement hardware detection in Linux" and "how to implement device configuration in Linux, I have received some emails from readers one after another. They asked a lot about hardware configuration. Now I want to sort out the most typical problems and write them into this article. Since it is impossible for me to access all hardware devices, I can only provide some methodological guidance for the built-in MODEM and sound card, rather than providing a detailed description of each step of the configuration process. I hope this article will help you learn and use Linux.
Author: Yu Chen Tao, software engineer of Lenovo (Beijing) computer company. At present, I am mainly engaged in the development of Linux system installation programs. I am mainly interested in operating system working mechanisms and developing underlying system programs. You can contact him by email scu_yct@263.net.
1. I successfully configured my sound card with ALSA, but every time I start LINUX, I have to re-configure the alsaconf command in the alsaconf-0.4.3b directory in ALSA, which is why it is very inconvenient, how can I solve this problem?
A: By default, the ALSA driver will mute all audio output. To obtain the sound, you must unmute The main volume and PCM volume. The following command sets the audio output's main volume, encoding, and decoding volume. In general, enable these two settings to output the audio.
Amixer-c 0 sset 'master', 0 100%, 100% unmute
Amixer-c 0 sset 'PCM ', 0 100% unmute
To enable the mute function every time the audio card driver is inserted, you can enable the mute function at/etc/modules. conf (for earlier Linux versions, such as Redhat 6.2, this file is/etc/conf. modules) Add the following statements:
Post-install snd-card-xxxx amixer-c 0 sset 'master', 0 100%, 100% unmute & amixer-c 0 sset 'PCM ', 0 100% unmute
Snd-card-xxxx indicates the alsa driver module corresponding to the sound card.
2. How can I change the display update rate in LINUX? My eyes can't stand the 60Hz update rate?
A: In Linux, to configure X-Windows, the/usr/X11R6/bin/Xconfigurator command is generally used for configuration. Before configuration, you 'd better first know the model and display model of the video card, and then configure the refresh frequency.
The Xconfigurator program will first perform self-check on the display type. According to the detected display model, in the configuration file/etc/X11/XF86Config (for XFree86 4. in Version x, the configuration file is/etc/X11/XF86Config-4) to set the field frequency range supported by the display. In this way, after the X system is started, the vertical refresh rate is automatically set to the highest refresh rate supported by the current resolution.
However, if your monitor does not have any type information or is not supported by the Xconfigurator, you can only set the display to some common display modes. In these display modes, the higher the refresh frequency is the 70Hz vertical scan frequency at the 1024x768 resolution.
If you want to set a high update rate (Vertical Scan Frequency of 85Hz), you only need to do it manually. The refresh frequency corresponding to the general display mode defined by each Vesa can be found in "how to configure devices in Linux. In this case, you need to modify the Monitor section of the XF86Config file. The Monitor section describes the display information. Each XF86Config file contains at least one Monitor section. When a display supports vbe and edid expansion, all its information, including the display size, the refresh frequency range supported by the display, and the display manufacturer information, can be read from the display. The general format of this section is as follows:
Section "Monitor"
Identifier
Entries
EndSection
Its key descriptive information is:
HorizSync horizsync-range
The range of horizontal refresh frequency supported by the monitor. The Unit is kHz and the default value is 28-33 kHz.
VertRefresh vertrefresh-range
The range of vertical refresh frequencies supported by the monitor. The Unit is Hz and the default value is 43-72Hz.
To set a higher update rate for the monitor, you must use vi to modify the two fields in the/etc/X11/XF86Config file, for example:
HorizSync 28-60
VertRefresh 60-100
The above settings can be used to set the display resolution to 85Hz for vertical fl at X and 70Hz for vertical fl at X.
Note: If the display does not reach such a high horizontal scanning frequency range, black screen will appear on the display. If a black screen appears, you can first use Ctrl + Alt + Backspace to kill the current X service process, and then re-Modify the XF86Config file to try to refresh the display at a lower frequency.
3. Why can't C ++ be used to develop device drivers in LINUX? I tested whether g ++ compilation options are incorrect, but what are the correct compilation options?
A: In Linux, the implementation of the C ++ compiler is different from that of the C compiler. Because function overloading and polymorphism are involved, C ++ uses the virtual table mechanism during compilation and implementation. This is very different from the direct access method for compiling the target code in C language. Most Linux kernels are compiled in C language, and the Linux driver adopts a mechanism similar to a function call table in advance. Therefore, developers should use gcc to develop drivers most directly and efficiently.
4. I have a blue dot 1.0 system, and the inner cat installed is the Tplink ia5628v model. Its chip is ambient 5628d and cannot be driven. I downloaded intel's r-335-5 driver and followed the prompts to install it unavailable. In Windows ME, the cat uses the com4 port. I tried ttys0 ~ Ttys3.ttys10 does not respond. Please advise.
A: The biggest problem with incorrect configuration of the internal modem is that the device does not have a suitable driver. Most vendors do not want to disclose the internal technical details of the product, so there are very few internal cat drivers on the Internet, and fewer drivers can work normally. If you want to find the driver of inner cat, you need to run it first,
Lspci-v
Check the detailed device information of inner cat, including the device ID and manufacturer ID, and then visit the site www.linmodems.org to obtain detailed information about inner cat driver.
If your chip type is ambient, you 'd better try the driver http://linmodems.org/clmodem-0.3.0.tar.gz. After downloading the driver, you need to manually unbind the tar package and install the driver correctly.
After the driver is successfully installed, the inner cat driver generally generates a simulated serial port device. Because many programs use the device file/dev/modem to access the modem, you may need to manually create a link file to use the modem device normally. For example, if your inner cat simulation device is ttyS4, run the following command:
Ln-sf/dev/ttyS4/dev/modem
Which serial port device is used depends on which serial port it simulates. After performing the preceding steps, you can execute minicom and then run the AT command ATZ to test whether the modem works properly. If OK is displayed, the modem configuration is successful. Otherwise, the modem configuration fails.
5. In LINUX, I use the DATE command to set the time, but it is not written to CMOS, and the time does not change after the machine restarts. How can I solve this problem?
A: I am afraid the bios of your machine is not exactly the same as the standard bios (or something wrong). The date command calls the system function stime, which is a glibc function, it also transmits the control to the lowest-level bios call and sets the time. If the clock mechanism of your machine is not like this, the time setting will not work.
6. I want to install dual OS, linux and win98. However, I cannot see win98, but I can't see it. On the server, I directly went to linux without a graphical interface. In Linux, you can only enter commands. I installed linux radhat7.0. The memory of the host is 64 MB, and the cpu is Ben San. The win98 system before linux is installed may have been overwritten or formatted, now I want to reinstall win98 and linux. I want these two operating systems to be available at startup.
A: To set Dual Boot for Linux, you must modify the configuration file/etc/lilo. conf of lilo after installing the Linux system. For example,
Boot =/dev/hda
Map =/boot/map
Install =/boot. B
Vga = normal
Default = linux
Image =/boot/vmlinuz
Label = linux
Root =/dev/hda2
Other =/dev/hda1
Label = win98
This simple example sets up a Dual Boot for a machine with win98 and linux operating systems. win98 is installed on the hda1 partition, which is the first primary partition of the first hard disk. The Linux partition is installed on the hda2 partition.
Generally, you 'd better install the Windows operating system first. For the sake of security, you 'd better customize a Windows system to recover the floppy disk and then install the Linux operating system. When installing Linux, be sure to select a partition different from the Windows partition (we strongly recommend that you install the Linux operating system on the primary partition, that is, the partition numbered hda1 to hda4) during installation, you also need to create a Linux system swap partition. After installing Linux, you must run the LILO command to enable lilo to take over the system boot sector and make the configuration in/etc/lilo. conf take effect.
7. I am using Lenovo Chaoyang notebook, installed with Red hat linux7.1, using Lenovo EASY10M/100 M Nic which cannot be identified and cannot work now. What should I do? No information exists in/proc/bus/pccard/drivers, and PCMCIA has been started. The act link light of the NIC is on. I don't know if the driver has been added. The test loop is only lo. FAILED is displayed in eth0 at startup.
A: First, you need to install the driver of the NIC. The driver of the PCMCIA type is saved in the pcmcia-cs package. You must first install the pcmcia-cs package.
After the pcmcia-cs package is installed on the laptop, you can first check whether the/proc/bus/pccard directory exists in the system for automatic detection of the PCMCIA device, if this directory does not exist, insert pcmcia_core.
Modprobe pcmcia_core (or insmod pcmcia_core)
After this module is successfully inserted, the/proc/bus/pccard directory is generated. After that, you can
Lspci-v
Check the pci system device, find the system bridge, and obtain the bridge module you want to insert according to the bridge type. In Linux, only i82365 or tcic is applicable to the bridging module. If you cannot obtain an accurate bridge driver, you can try to insert two modules until they are successful. Run the following command:
Modprobe i82365 (or modprobe tcic)
Then, to configure your pccard in real time, you must start the pcmcia service,
/Etc/rc. d/init. d/pcmcia start
And the service starts the program cardmgr. Cardmgr monitors card insertion and pop-up operations on the pcmcia slot. After the card is inserted, cardmgr queries the configuration database of the card. If the card is identified, the corresponding device driver is automatically loaded. After the pop-up card,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service