The configuration process of the device under Linux refers to the use of this information to configure the driver, operating mode, etc. (see how the device's detection process "is used, and how to implement hardware under Linux. automatic detection"). To complete such tasks, you need to do two works:
One is a detailed device information file. This file describes the device ID, the device driver corresponding to the device identification, the device configuration parameter (device option), the device settings, the device configuration method description, the alias corresponding to the device , The main device number of the device and other information.
The current Linux kernel uses KMOD to complete the automatic load of the device module, and its general working mechanism is: When the device module is first referenced, the kernel uses system command / sbin / modprobe to load this device module. In order to make this mechanism work normally, you first need to use DepMod -a to establish file modules.Dep between representation modules, and then set the correct device alias in /etc/modules.conf (About /etc/modules.conf) Detailed introduction See Appendix A of this article, if you need to set the parameters corresponding to the device. For example, in setting up a network card, the driver of the NE2K-PCI is NE2K-PCI. The device alias of the NIC is eth0, and the alias Alias Eth0 NE2K-PCI is added in the file /etc/modules.conf, set the NE2000-compatible PCI network card. When the program is to try to access the network, the kernel will automatically load the NIC driver NE2K-PCI.
Its second is to set the device corresponding script file for the installed Linux system version according to the type of device, and the installed Linux system (different Linux distributions for configuration script files for the same device).
1 Configuring Keyboard 1.1 Configuring the device module of the keyboard generally has three types for our common keyboard, which is an old-fashioned five-pin keyboard, which is a PS / 2 keyboard, and the third is a USB mouse. For the first two keyboards, the current Linux distribution will be packaged into the kernel, so there is no need to perform additional module insertion operations, the keyboard can work. For the USB type keyboard, in general, to make it properly working must first insert the corresponding device module.
For the USB type keyboard, if you work by manually load the module, you must first insert the USB bridge module, then you must also insert the keyboard module USBKBD.O, and KeybDev.o, so the USB keyboard can work properly . At this point, the running system command: / sbin / modprobe USBKBD / SBIN / MODPROBE KEYBDEV
For the 2.2.x series kernel to automatically load the KMOD of the kernel, you must set an alias USB-Interface in the /etc/modules.conf file, which corresponds to the bridge module you are using. For example, when the type of bridge is UHCI, add the device alias in /etc/modules.conf: Alias USB-Interface USB-UHCI
For the 2.4.x series kernel, this device alias changes to: Alias USB-Controller USB-UHCI After setting this alignment, the system is automatically detected when the system starts. When the detection process finds a connection device is system support, the system will automatically insert the desired module.
1.2 Keyboard configuration file keyboard configuration file / etc / sysconfig / keyboard, its content is simple, optional configuration item is KeyTable (the content of this file will vary with the content of this file, but this field is the most important ). For example, when setting KeyTable = "US", the system is represented using a American keyboard. Then, in order to correctly use the function keys on the keyboard, you also need to call the command dumpkeys to generate file /etc/sysconfig/console/default.kmap. / usr / bin / dumpkeys> /etc/sysconfig/console/default.kmap This file describes the keyboard scan code of the keyboard and the corresponding keyboard scanning code of the keyboard after the keyboard is added.
Similarly, in order to operate normally in the X system environment, you may also need to set the keyboard under the X system, then you must use XModMap to set the correct keyboard mapping. For example, / usr / x11r6 / bin / xmodmap /usr/share/xmodmap/xmodmap.fr Sets your keyboard under your X system to the French keyboard.
After the correctly configured / etc / sysconfig / keyboard file, the X system's configuration program is configured to configure X of the keyboard configuration in the information of this file. When this file is incorrect or this file does not exist, the X system is unable to start and configure.
2 Configuring the basic information of the mouse 2.1 LINUX supports four different bus mouse hardware interfaces: Inport (Microsoft), Logitech, PS / 2, and ATI-XL. 2.4 The kernel also supports the IBM PC110 digitizer and Apple Desktop mouse.
Inport MiceInport Mice contains most old types of Microsoft mouse. Inport Mice is typically connected to the main board's interface card. If the mouse line connecting head is round, there are 9-pin, it may be inport mice. Logitech mice ps / 2 mice ati Combo Video / Mice IBM PC110 Palmtop Digitizer Apple Desktop Mouse Hybrid Mice
For mouse agreements, most bus mice use the BUSMOUSE protocol, some old logitech mouse use the MouseSystems protocol, and some older Microsoft mouse use the Logitech protocol. The PS / 2 mouse always uses the PS / 2 protocol.
Different types of mice corresponding device files:
Interface type Equipment master number secondary device number logitech / dev / logibm100ps / 2 / dev / psaux101inport / dev / inportBM102TI-XL / DEV / ATIBM103USB MOUSE / DEV / INPUT / MOUSB MOUSE / DEV / INPUT / MICE1363 Table 2-1
Create a command for the corresponding device:
MKNOD / DEV / LOGIMM C 10 0
MKNOD / DEV / PSAUX C 10 1
MKNOD / DEV / InportBM C 10 2
MKNOD / DEV / ATIBM C 10 3
Mknod / dev / input / mice c 13 63
After creating the device file corresponding to the mouse, because many programs use / dev / mouse as the default mouse device file, in order to make the mouse normally you have to create a symbolic connection / dev / mouse point to true mouse devices file. For example, for PS / 2 mice, / dev / mouse points to / dev / psaux, for USB mouse, / dev / mouse / point / dev / input / mice, for serial mouse / dev / mouse points / dev / ttys0. For different Linux release, these files may vary, the above introduction is mainly based on the configuration of the RedHat release. For the three most common mice: serial mouse, PS / 2 mouse and USB mouse, because the PS / 2 mouse support is generally hit in the kernel, you don't need to insert the device module before the mouse work. But for other two mice, the operation of the insertion module is generally necessary. For serial mouse, you must first insert module serial.o, / sbin / modprobe serial
After successful insertion module, if the serial mouse supports the plug-and-play serial protocol, you can read the type information of the mouse from the serial port (/ dev / ttys *), then this information, complete the mouse configuration file. For USB mouse, in order to make it work properly, you must first insert module USBMouse.o and mouseDev.o / sbin / modprobe USBMOUSE / SBIN / MODPROBE MOUSEDEV, in order to make the mouse driver automatically load, you also need to be available / etc / Create a USB-Interface (USB-Controller) alias in the modules.conf file.
2.2 Mouse configuration file Correctly configure the mouse to generate a configuration file / etc / sysconfig / mouse, which includes the following options: MouseType, XMouseType, FullName, Xemu3, Device. The mouse configuration file is also the basis for the M Mouse configuration section in the X configuration file. If there is no file, many X configuration programs will not work.
MouseType = Configure the type of mouse, including PS / 2, Busmouse, Imps2, NetMouse, Microsoft, Logitech, Mouseman, Mmhittab, MouseSystems, PNP, Logim, MS3, MMSeries, and so on.
The type of mouse configured under xmousetype = x system, including Mouseman, Intellimouse, MMSeries, Mmhittab, Logitech, Mouseman, Microsoft, MouseSystems, PS / 2, BUSMOUSE, etc.
FullName = Describes the full name of the mouse device. For example, for a normal PS / 2 mouse, its full name is PS / 2 | STANDARD.
XEMU3 = Whether the three-button mouse is simulated, the optional parameter is YES or NO.
Device = Describes the device file corresponding to the mouse. E.g. For ordinary PS / 2 mice, the device file is PSAUX.
2.3 Configuration Tips of the mouse can use the mouse in the command line mode via GPM. In this way, in the console mode, the mouse can be used to use the mouse. For example, for the PS / 2 mouse, its configuration is: gpm -t ps / 2 -m / dev / psaux If the -m option is not specified, then the system will look for files / dev / mouse.
The mouse movement is not ruled because the mouse has an error. If the new Logitech mouse does not use the Logitech protocol, use the Microsoft Agreement (Mouseman). If your mouse moves irregular, then you may first need to try to replace the value specified by MouseTyPE (XMOUSETYPE). Under the X system, you can perform XModMap -e "Pointer = 3 2 1" if you need to replace the left and right key of the mouse. 3 NIC configuration procedure 3.1 Configuring a network card device module According to the bus type, the current Ethernet card mainly has a PCI network card, an ISA network card, and a PCMCIA network card. To make these network cards working properly, set the device alias Eth0 in /etc/modules.conf, and the device parameters to be passed to the driver. This kernel is automatically loaded with the required device module using the kernel service KMOD using the system command ModProbe (Insmod) when using the driver.
When configuring a network card, if this network card can be automatically detected, you only need to identify the device driver in the device description information file, and then configure a network card. However, this method is not suitable for the NE2000 compatible network card of the ordinary ISA bus, as they generally do not satisfy the ISAPNP specification when designing, so they cannot read their device information. However, this type of NIC usually uses NE as a device driver, but in order to make it properly operated, the IRQ of the IO address and the occupied IRQ are required.
For example, for Ne2000 compatible ISA network cards, such as DE220X, their drivers are NE. At this point, this network card is working normally, you need to add: Alias Eth0 Neoptions Ne IO = 0x300 IRQ = 5
In general, for this network card, only the correct I / O address space is specified, the NIC will work properly. This address is exactly the same as the port address used by this NIC under DOS. If you can't find the NIC on the port address 0x300, you can try 0x240 and other addresses.
3.2 NIC configuration files To properly configure the network card, you must generate the following script file, / etc / sysconfig / network, / etc / sysconfig / network-scripts / ifcfg-eth0 (multiple network cards for IFCFG-Eth1, IFCFG) For only one network card -TH2 pushes in this class) and / etc / hosts. If you need to configure a domain name resolution service, then generate file /etc/resolv.conf.
For the / etc / sysconfig / network script file, the most commonly used setup items include Networking, Forward_IPv4, Hostname, DomainName, Gateway, GatewayDev. Note: This file is also set when there is no configured network card, so that the ring loop device (LO) of this unit can work normally, this device is the basis for many Linux internal communications.
Networking = indicates whether the system uses the network, typically set to YES. If set to NO, the network cannot be used, and many system service programs will not be able to start.
Forward_IPv4 = indicates whether IPv4 automatic forwarding is supported. Generally, this item is False when there is only one network card.
Hostname = Sets the host name of this machine, where the host name set, and the host name set in / etc / hosts.
DomainName = Sets the domain name of this unit.
Gateway = Set the IP address of the gateway connected to the unit. For example, the gateway is 10.0.0.2
GatewayDev = Network card device alias used when communicating with this gateway. For example, when a network card is used, the gateway is connected, the value at this time is Eth0. The setting is available when no network card is:
Networking = "yes"
Forward_IPv4 = "false"
Hostname = "localhost.localdomain"
DomainName = "LocalDomain"
/ etc / sysconfig / network-scripts / ifcfg- * describes information about the network interface. Each different network interface corresponds to a different file. For example, IFCFG-ETH0 corresponds to configuration information that may occur in Eth0 of the first block. Common configuration options include Device, Bootproto, iPaddr, Netmask, Network, Broadcast, Onboot.
Device = Describe the device alias corresponding to the network card, such as the file of IFCFG-ETH0 is Eth0.
Bootproto = Set the network card to get the IP address, the possible options are static, DHCP, or BOOTP, respectively correspondingly specified IP addresses, and the IP address obtained by the BOOTP protocol, respectively, with the IP address obtained by the DHCP protocol.
IPaddr = If the network card is set to get the IP address is static, this field specifies the IP address corresponding to the NIC.
Netmask = network mask corresponding to the NIC.
Network = network address corresponding to the network card.
Broadcast = The corresponding subnet broadcast address.
ONBOOT = Whether the system is set to set this network interface, when set to YES, the system is activated when the system is activated.
/etc/resolv.conf, the system generates this file for domain name analysis. Otherwise, the reverse name of the installation process cannot work. Possible options: Search DomainName Specifies the domain name Nameserver DNSSERVER Domain Name Server, you can specify multiple. / etc / hosts, add the host name list to this file.
4 MODEM Configuration Process For Modem's configuration procedure, we now usually use KPPP to dial, using this program, the entire dialing process will become very simple. Therefore, this article will no longer introduce the manual dialing procedure using PPPD and CHAT. This article only describes how to set the basic device driver module and the configuration of the underlying device file. After configuring these files, you can use KPPP to dial.
4.1 External Modem When configuring an external Modem, because most of the modems are connected to the computer via the serial port, you must insert the serial driver module serial.o before configuring modem. After successfully inserting the serial communication module, you can connect the device / dev / modem to the appropriate serial port device. For example, the MODEM is connected to / DEV / TTYS0 (corresponding to COM1 in Windows), then connects: ln -sf / dev / ttys0 / dev / modem
After this, the external serial number MODEM can work normally. You can detect and configure MODEM's working mode by sending an AT command to the serial port using Minicom. Regularly used commands:
AT Command Command Description ATDT (ATDP) Perform Dial ATZ Reset Modem ATH Suspension The ATI0 Returns the Status ATI1 ATI1 Execute the ROM Check and Check and Return Value ATI2 Verify the ROM verification, return OK or Errorati3 Return to ROM components Software version number. The ATI4 query the status information of the modem, including the baud rate, parity bit length, word length, dial mode, register status, etc. The ATI5 queries status information in the RAM of the modem. The ATI6 query the link status information of the modem, including the number of transmitted (received, lost) characters, the number of transmitted data blocks, the link connection state, the last dial time, and the like. ATI7 gets a preface file, this file described information includes: MODEM supported communication protocol, FAX version number, EPROM version number. ATI8 gets the connection time ATI9 to obtain the description name table 4-1 of the modem, for example, for a Lenovo's external Modem, after starting minicom, input ATI9 return value is: (1.0AKY1010 // Modem / AKY1010 / 56K Data Fax Voice MODEM) FF
4.2 Built-in LinmodeMlinmodem is the Linux implementation of WinModem. About further information about Linmodem You can access www.linmodems.org. The current LINMODEM is generally the PCI type, and you can also obtain the device device description information through the PCI detection process. After obtaining the description information, you can compare if your MODEM belongs to the Modem type listed below. The LINMODEM now supported includes:
CONEXANT / ROCKWELL HSF Its driver is at http://www.olitec.com/pci56kv2.html or http://linmodems.org. The Ambient Technology (Formerly Cirrus Logic) driver is at http://linmodems.org/clmodem-0.3.0.tar.gz. Lucent LTHTTP: //LINMODEMS.ORG/LINUX568.ZIP PCTELPCI, AMR and ZOLTRIX PHANTOM type binary drivers: http://www.kcdata.com/~gromitkc/winmodem.html#drivers. ESS56T-PI (PCI) And ES56V-I (ISA) binary driver: ISA: ftp://ftp.sstech.com/pub/modem/isa/unsupported/56v-i/linux/kernel61/linux11.zip. PCI: ftp://ftp.sstech.com/pub/modem/pci/unsupported/56t-pi/linux/kernel61/111.zip. 3Com Mini-PCI has no available drivers.
In order to some extent and the programming interface of the external modem, Linmodem is usually generated to generate an emulated serial device. In order to generate these device files, the command MKNOD can be usually used.
Lucent LT: MKNOD / DEV / TTYS14 C 62 78 PCTEL: MKNOD / DEV / TTYS15 C 62 79 Esscom: MKNOD / DEV / ESSCOM C 127 1. Esscom users want to connect to / dev / ttys14 to / dev / esscom to make only the PPP dial program that only identify TTYS * can be used normally. ChGRP UUCP / DEV / TTYS14CHMOD 666 / DEV / TTYS14 allows non-root users to use this service dial. Ln -s / dev / devicefile / dev / modem You can also use SetSerial, modify the serial port configuration, such as setting the boat rate of the serial port, can also set the operating parameters of the serial port. SetSerial -Agv / DEV / TTYS * 5 Sound Card Configuration Procedure 5.1 Configuration of Dermage Soundtrack Drivers Now is using the sound cards that are currently using primary PCI and ISA. Under the Linux system, the configuration process of both type sound cards is actually generating profile /etc/modules.conf, establishing the correct device alias and the correspondence of the sound card device driver. After the correct setting drive module, use the mixer program to set the output volume of the sound card.
If your sound card is an ISA PNP type, then if this sound card works well under the DOS (Windows) system, you can remember the working parameters of the sound card, including IRQ, DMA, and I / O. In general, the same parameters as DOS should be used under Linux systems.
If you don't know its working parameters, you can get the configuration space of the sound card via / proc / isapnp, including information such as DMA, IOOPORT, and IRQ. You can then you can learn free IRQs, IOPORTS, and DMA and other information in the system by checking / proc / interfaces, / proc / iports, and / proc / dma files, whereby the appropriate sound card configuration parameters can then be selected.
In the 2.4.x kernel, ISA PNP support is implemented, and a part of the sound card driver now supports automatic detection and configuration without using the ISAPNP tool. For more information about sound card devices, you can also view files in core document / usr / src / linux / documentation / sound /.
For PCI sound cards, their drivers contain automatic detection process, so you only need to insert the correct drive module, and the sound card will usually work.
When the sound card module is first referenced, the kernel will request to load the corresponding drive module. The device alias corresponding to the sound card module is Sound-slot-0 (0 represents a sound card in the system, and push it). For example, add: Alias Sound-Slot-0 EssoLO1 configured an Ess Solo-1 sound card. This statement indicates that the module Esssolo1 is automatically loaded when the sound card is required.
Sometimes the device module corresponding to Sound-Slot-0 is loaded, and all the functions of the sound card cannot take effect. At this time, the device will request access to the Sound-Service-0-N alias. n represents different devices:
Number The corresponding device 0 mixer (Mixer) 2MIDI3, 4DSP Table 5-1
At this time, you will ask you to set the correct sound card service module, so the sound card can work properly. Equipment file corresponding to sound card:
Device File Name Device Description / dev / audio Normal connection to / dev / audio0 / dev / audio0sun workstation compatible sound equipment (partially implementation, do not support the Sun IOCTL interface, only U-LAW code) / dev / audio1 second Sound equipment (using multiple sound cards) / DEV / DSP Normal connection to / dev / dsp0 / dev / dsp0 first digital sampling device / DEV / DSP1 second digital sampling device / dev / mixer connection to / dev / dev / Mixer0 / DEV / Mixer0 First Sound Mixer / DEV / MIXER1 Second Sound Mixer / DEV / MUSIC Advanced Serialization Interface / DEV / SEQUENCER Bottom MIDI, FM and GUS Access / DEV / SEQUENCER2 Normal connection To / dev / music / dev / midi00 first original MIDI port / dev / midi01 second original MIDI port / dev / midi02 third original MIDI port / dev / midi03 fourth original MIDI port / dev / sndstat display Sound Driver Status Table 5-2PC Speaker Provides the following devices:
/ dev / pcaudio is equivalent to / dev / Audio
/ DEV / PCSP equivalent / dev / dsp
/ dev / pcmixer equivalent / dev / mixer
You can send the sound file directly into the corresponding device, for example, the original sample can be sent to / dev / dsp by playing the .au sound file to play it in / dev / audio. Cat Sample.su> / dev / audio
But doing this general effect is poor, and the play command should be used when playing. For WavPlay and VPlay (SND-Util Packages) will play WAV files with the best effect, but they cannot identify Microsoft ADPCM compressed WAV files. If you have a correct parameter, SPLAY is used to play most sound files.
The sampling data returned by the read / dev / audio and / dev / dsp can be redirected to a file. VREC can make this process easier. You may need a mixer program to select the appropriate input device.
5.2 ALSA Sound Card Driver Configuration For the sound card driver, in addition to the drivers of the kernel, you can also use the drivers provided by Advanced Linux Sound Architecture (ALSA, http://www.alsa-project.org/) . It supports a series of mainstream sound cards, and it is compatible with the sound structure of the kernel. To some extent, it can be said to be supplemented by the kernel's sound card drive module.
The general naming rule of the ALSA sound card driver is SND-CARD-
If you need two modules SND-PCM-OSS and SND-MIXER-OSS that are backward compatible with the Linux kernel sound drive. For multiple mixers set in Amixer, they are all for different devices. For example, the setting of the CD channel is for the CD player. And many applications, such as MPG123, XMMS, RealPlayer, depend on the setting of the PCM channel. MIC represents the microphone. Different GAIN parts provide special gains for different uses.
By default, AlSA mutes all outputs. In order to get the sound, the main volume and the mute of the PCM volume must be released. Amixer -c 0 sset 'master', 0 100%, 100% unmuteamixer -c 0 sset 'pcm', 0 100% unmute
Options include Mute, Unmute, Capture, Nocapture, Rec, Norec, Digital, or Left: Right. Amixer returns the setting of all channels on the sound card without parameters. In order to open the mute every time you insert a sound card drive module, you can add the following footprints in /etc/modules.conf: Post-install snd-card-sb16 amixer -c 0 sset 'master', 0 100%, 100% Unmute && amixer -c 0 sset 'pcm', 0 100% unmute After successfully inserting the ALSA sound card module, the system will appear / proc / asseound directory, which describes the work of the sound card, and the created device file.
After you load the SND-PCM-OSS device module, you can also use the sound card with the OSS-compatible way. At this time, the following mapping will be completed:
ALSA Equipment OSS Equipment Number / DEV / SND / PCMC0D0 / DEV / AUDIO0 (/ DEV / AUDIO) 4 / DEV / SND / PCMC0D0 / DEV / DSP0 (/ DEV / DSP) 3 / DEV / SND / PCMC0D1 / DEV / ADSP (/ dev / ad) 12 / dev / SND / PCMC1D0 / DEV / AUDIO120 / DEV / SND / PCMC1D0 / DEV / DSP119 / DEV / SND / PCMC1D1 / DEV / ADSP128 / DEV / SND / PCMC2D0 / DEV / AUDIO236 / DEV / SND / PCMC2D0 / DEV / DSP235 / DEV / SND / PCMC2D1 / DEV / ADSP244 Table 5-3
For / dev / mixer devices, you want to load SND-MIXER-OSS to ensure compatibility with old OSS mixers. If you have inserted the above device, the sound system still does not work normally, you can run the SndDevices command to create the correct device file.
Since it is necessary to set up ALSA, you need to set a large amount of device alias. The following is given an example of /etc/modules.conf, which can complete the auto configuration of the ESS Solo1 sound card. The settings of other ALSA devices are basically the same as this sound card.
# Set the main device number of the ALSA device, which is fixed to 116Alias char-mass-116 SND
# Set the main device number of the OSS device, which is fixed to 14, which makes the ALSA multiplex OSS device Alias Char-Major-14 Soundcore
# ALSA Equipment Alias Alias Sound-Card-0 SND-CARD-ES1938
# 斯S device alias alias Sound-slot-0 Sound-Card-0
# Installation Different Sound Card Services Alias Sound-Service-0-0 SND-Mixer-Osalias Sound-Service-0-1 SND-SEQ-OSALIAS SOUND-Service-0-3 SND-PCM-OSALIAS SOUND-Service-0-8 SND-SEQ-OSALIAS SND-Minor-OSS-12 SND-PCM-OSS
# Run the amixer command, open the sound output Post-install snd-card-es1938 amixer -c 0 sset 'master', 0 100%, 100% unmute && amixer -c 0 sset 'pcm', 0 100% unmute
6 Window System (XFree86) Configuration Procedure 6.1 Description File of Display Card (CARDDB) CARDDB is the display card data file used by the X configuration program. When configuring XFree86, the configuration program typically needs to read the contents of the content on which the display card is completed. Its content is closely related to the version used by Xfree86. In general, its preserved position is in / usr / x11r6 / lib / x11 / directory. Now we will make a simple introduction to the CardDB file of Xfree86 4.1.0: Name Display Card Description Name Chipset
Describe the chip set used by the display card
Server is compatible with the 3.x version of XFree86, which specifies this display card in X servers under Xfree86 3.x, such as VGA16, SVGA, etc.
Driver describes the driver module that displays the card under the 4.x version of XFree86.
LINE Sets the option information that displays the card, such option information appears in the XF86Config Device section, the Option parameter of the corresponding device.
See means that the configuration information of this display card is exactly the same as the display card set by the SEE field, for example
Name Number Nine GXE64 with S3 TRIO64
See S3 TRIO64 (Generic)
The display card configuration of Number Nine GXE64 is identical to the configuration of S3 TRIO64 (Generic).
Ramdac
RAM direct access control control chip model
DACSPEED direct access control speed
Clockchip's clock chip
NoClockChip This display card is not a clock chip
Unsupported This type of graphics card, this version of XFree86 can not provide support
Comment comment
For example, for the Riva TNT graphics card, the information in Xfree86 4.1.0 is as follows: Name Riva TNT
Chipset RivatNT
Server Svga
Driver nv
Noclockprobe
6.2 Display Information Detection The display of the display is very important in the XFree86 system, which corresponds to the Monitor section of the XFree86 configuration file. In this section, the horizontal scan frequency range of the monitor, the vertical scan frequency range, the display mode supported by the display, and other information. Similarly, the automatic detection of the display is to automatically read the above information of the display by the program. Its correct settings make a very important role for XFree86. For information detection of the display, it is required to support VBE (VESA BIOS-level extensions). When the display supports this extension, the INT 10H can be obtained by the BIOS in the system real mode, and the details of the display can be obtained. The possible required BIOS sub function call is: AH = 0x4f00 Gets the BIOS level extended information about the monitor's VESA, AH = 0x4f01 Gets a specific display mode AH = 0x4f02 set the current video mode AH = 0x4f03 to obtain the current video mode AH = 0x4f03 AH = 0x4f04 Save / Restore SVGA Display Mode AH = 0x4f15 Gets the Monitor EDID Extension Information General Display Use the above interrupt method: Check if the display supports VESA's BIOS-level extension, if the display supports the BIOS-level extension, view the display Supported display mode, then get the edid extension information of the display. In the read eDID extension information, you can detect the vertical back sweep frequency range of the display and horizontal backswouting frequency range, or the size of the display can be calculated, and the monitor can read from the monitor information from this information. . The information read by the display can set the MONITOR segment of the XF86Config. For the displayed display of the correct vertical back sweep frequency range and the horizontal swivel frequency range, X is automatically set to the display mode of the highest scan frequency supported by the current display resolution ( This display mode requires a corresponding modeline. But if your monitor does not support EDID extension information, you only have the vertical back sweep frequency range and horizontal back sweep frequency range based on experience. If the set range is higher than the actual support range of the monitor, the display will appear in a black screen. For programming implementation, if you want to call the BIOS interrupt above, you must use the LRMI this real mode interface, and set the correct register information to complete the system call. For example, an example of detecting display information, you can refer to the source program of DDCPROBE under XConfigurator, or you can refer to the source program of the DDCXINFOS command under the Mandrake system. 6.3 Configuration Process of Window System To properly configure window system under Linux, actually generating the correct XFree86 configuration file, this file is usually saved in / etc / x11 / under the X version is 3.x, its file Named XF86Config, when the X version is 4.x, its file name is generally XF86Config-4. In the current release, they are in hardware compatibility, they generally make these two versions of XFree86 packages. Therefore, you can also find these two files at the same time in the / etc / x11 directory, then use that file to see the version of the system's X server. Whether it is the version of the XF86config files, these sections describe the contents of these sections mainly include: keyboard, mouse, display, display card, font (color), etc. When the X version is 3.x, the description of the keyboard and the mouse corresponds to the Keyboard and Pointer section, respectively. When the X version is 4.x, the description of the keyboard and the mouse corresponds to the InputDevice section, just a corresponding different drive module, the keyboard drive module is a keyboard, the mouse drive module is MOUSE.
Configuring the information required for these two sections can be obtained from / etc / sysconfig / keyboard and / etc / sysconfig / mouse, their details, the previous chapter of this article has been introduced. Configuring the display is actually the Monitor section of the XF86Config file. The information that needs to be configured generally includes: horizontal scan frequency range, vertical scan frequency range, display mode supported by the monitor, manufacturer information. For a display that supports VBE and EDID extensions, the value of the corresponding field can be set according to the information read from the display. However, if the display does not support the above extension, the setting of the display card must be done manually by the user. If you do not specify this section when configuring XFree86, XFree86 sets the display mode 640x480, and the vertical scan frequency is 60 Hz. Scan frequency of different display modes:
Display resolution Vertical scanning frequency (Hz) horizontal scanning frequency (kHz) 640x4806031.50640x4807236.50640x4807537.50640x4808543.27800x6006037.80800x6007248.00800x6008555.84800x60010064.021024x7686048.401024x7687056.501024x7687662.501024x7688570.241024x76810080.211280x10246164.201280x10247074.591280x10247478.851280x10247681.131280x10248591 . 1512801600x12007075.501600x12007087.501600x12007593.751600x12007593.77 Table 6-1 From the above table, you can see that the display reaches an a resolution, then corresponds to this, its scan frequency range also includes the above table The lowest scan frequency of this resolution. If your monitor does not meet this range, XWindow will not work properly. If the scanning frequency you set is higher than the actual scan frequency range of the display, since Xfree86 will look for the highest scanning frequency at the corresponding resolution, the XWindow will be very likely to black. When generating a configuration script, the scan frequency is not, the lower the better. Setting a lower scan frequency range is not suitable for some LCD displays. For example, a part of the LCD display at 800x600 resolution, the lowest supported vertical scan frequency is 70 Hz, then you specified the horizontal back sweep range at this time must include 48kHz. After configuring the monitor, you need to generate a description corresponding to the display card. Such a description information corresponds to the Device section of the XF86Config file. The main description of this section includes: the X server corresponding to the display card (X version in 3.x), the corresponding X device module (X version is 4.x), display card device information (supplier, model) , Support the memory access mode and the memory size, etc.), and the device options supported by this display card, such as whether the display card supports hardware acceleration, whether to support soft cursors. The configuration process of the generated window system is generally the type of the display card first by the PCI device identifier (see the process of detection), whereby the configuration file CardDB in Xfree86 (this file can be found in / usr / x11r6 / lib / x11 / directory The description of this section can be set in this section. The font and palette information describes the path stored by the font and palette. If you add a font, you need to add the correct font path here. When setting the font path, if it is specified for UNIX: -1, then you must first start the font server XFS before starting the X server, and then complete the font access request by the font server. After you set the above information correctly, you must store this information in the Screen section. This section describes information such as display corresponding display cards, displays, resolutions, and default depths. Finally, you must also generate the ServerLayout section, which describes the display card configuration segments used by the entire system, the monitor configuration festival, the mouse configuration section, the keyboard configuration section and other information. After generating / etc / x11 / xf86config (xf86config-4) file, you can test if this profile is correct. For example, for Xfree86 4.x, the generated configuration file is /etc/x11/xf86config.test, the test uses the following command: xfree86 -xf86config /etc/x11/xf86config.test: 9
-xf86config /etc/x11/xf86config.test means that the X server is started using the specified profile: 9 indicates that the X server is run on the terminal 9
In general, if it is programmed to implement the X-shaped configuration process, run the above command as a child process (system calling fork), after the X server is successfully launched, run a small graphics program, so that the user selects whether to configure success. Of course, if you don't get a detailed device parameter of the graphics card, you can also use the ProBeonly option to get the details of the display card. For example, use the following command for Xfree86 4.x: Xfree86 -Probeonly: 9 After normal startup xfree86, the information output is available, you can get it by reading /var/log/xfree86.x.log. x refers to the terminal that is started with XFree86, which is typically set to 0. Once the XF86Config file configuration, you can use StartX to boot xfree86. This file runs the .xinitrc file in your login directory to modify the initial display status of the X WINDOW system. This file is a script file. If this file does not exist, the system will use / usr / x11r6 / lib / x11 / xinit / xinitrc by default. At the same time, StartX is also looking for / etc / x11 / x, this file is a link file, which pointing to the real X service, now this program generally points to xwrappers, which is a package for the X service program. Of course, this document can also directly point to the X service XFree86. 6.4 Configuration Process FrameBuffer devices supporting a FrameBuffer mode refers to an X11 support device without a video acceleration. The advantages of this way are mainly three points: one is when the console mode works, you can set a larger console display area, such as a console of 1024x768 resolution size; its second is to start XF86_FBDEV on it. Under xfree86 4.x, starting module fbdev); its third is to display startup logo (a fat penguin) at startup. When the XFree86 driver corresponding to the display card does not work properly, and when you need more rich colors, starting FrameBuffer is often a must. When FrameBuffer is started, the resolution of XFree86 starts is determined by the startup mode of FrameBuffer. The device capable of starting FrameBuffer is a frame buffer device compatible with VESA 2.0 standard compatible with the VESA 2.0 standard, but now does not support FrameBuffer on the graphics card supporting VESA 1.2. This is because VESA 1.2 does not support linear frame buffer (linear frame buffering means that the CPU can access each bit of the graphics card). You can download patch to support VESAFB to support VESA 1.2 graphics cards, such as some older S3 series graphics cards. It is mainly available to support VESA 2.0:
ATI PCI videoExpression 2MB (Max. 1280x1024 @ 8bit)
ATI PCI All-in-Wonder
Matrox Millennium PCI - BIOS V3.0
Matrox Millennium II PCI - BIOS V1.5
Matrox Millennium II AGP - BIOS V1.4
Matrox Millennium G200 AGP - BIOS V1.3
Matrox MyStique & Mystique 220 PCI - BIOS V1.8
Matrox MyStique G200 AGP - BIOS V1.3
Matrox Productiva G100 AGP - BIOS V1.4
All Riva 128 Based CardsDiamond Viper V330 PCI 4MB
GenoA Phantom 3D / S3 Virge / DX
Hercules StingRay 128 / 3D with TV Output
Hercules Stingray 128 / 3D WITHOUT TV Output - Needs Bios Upgrade (Free from
Support@hercules.com)
SIS 6326 PCI / AGP 4MB
STB LightSpeed 128 (NVIDA RIVA 128 BASED) PCI
STB Velocity 128 (NVIDA RIVA 128 BASED) PCI
Jaton Video-58P ET6000 PCI 2MB-4MB (Max. 1600x1200 @ 8bit)
VOODOO2 2000
Motherboard integration display card:
Trident cyber9397
SIS 5598
Starting FrameBuffer Must set the kernel's launch display mode, setting this parameter is achieved by kernel parameters VGA =. For example, when setting the 16-bit color after the startup is 640x480, the passing parameter is VGA = 785 (decimal). You can also set this parameter in the /etc/lilo.conf file, passing the kernel parameters by the LILO. The FrameBuffer display mode supported by kernels is as follows:
Display depth 640x400640x480800x6001024x7681152x8641280x10241600x12004 bits0x3028 bits0x3000x3010x3030x3050x1610x3070x31C15 bits0x3100x3130x3160x1620x3190x31D16 bits0x3110x3140x3170x1630x31A0x31E24 bits0x3120x3150x3180x31B0x31F32 bits0x164 Table 6-2 vesa transfer options to the kernel further comprises: a comma between Option is available, the plurality of options; pharmaceutically options:: video = vesa ypan use vesa Protected Mode Interface display, The visual screen is a window for video memory. PRO Quick full screen rolls, allows rollback. The Kontra part rolls to produce some flash effects. YWRAP is fast than YPAN, but is poor compatibility. Redraw defaults to redraw over the affected screen area. Vgapal is default, the standard VGA tongue version register. PMIPAL uses the color palette interface of the protection mode. For example, the following operation sets the display of the FrameBuffer device: export framebuffer = / dev / fb1fbset -fb / dev / fb1 -vyres 600fbset -fb $ framebuffer 1024x768 @ 60StartX -: 0 -bpp 16 VT06 in the virtual control terminal 6 at 16 Color depth starts the X server. If you want to program a frame buffer device, you can read, write, locate, and mmap (), read, write, position, and mmap (). Different, the device you operate at this time is located in the video device memory. / DEV / FB * The device also supports several IOCTL operations, thereby obtaining or seting device information. The processing of color tables uses ioctl (). 6.5 XF86Config file format (version 4.x series) 6.5.1 The basic components of the file is composed of the following parts: section "sectionname"
Sectionentry
...
Endsection
SectionName includes: Files file path name ServerFlags server logo
Module dynamic module loading
InputDevice Enter Device Description
DEVICE graphics device description
VideoAdaptor XV video card description
Monitor monitor description
MODES video mode description
SCREEN screen configuration
ServerLayout comprehensive laminated
DRI DRI specific configuration
Vendor supplier specific configuration
For the purpose of downward compatibility, the following items have been abolished but the configuration file can still be identified. In a new configuration file, you should use the new InputDevice item. Keyboard keyboard Configuring the PoinPut section The old XINPUT section has been abolished. ServerLayout is at the highest layer. The input and output devices they bind will be used in this section. The input device is described by InputDevice, and the output device typically has a plurality of independent components. Multiple components constitute a Screen section. The graphics board and monitor are bound together for each Screen section. The display card is described by the DEVICE section, and the monitor is described by the Monitor section. 6.5.2 Files Festival Files Section Specifies the font path, palette path, and module path of the X server.
FontPath "Path" sets the query path of the font. For the representation of the font server, the following form:
If this section does not specify, the default font path is:
/ USR / X11R6 / LIB / X11 / FONTS / MISC /
/ USR / X11R6 / LIB / X11 / FONTS / SPEEDO /
/ USR / X11R6 / LIB / X11 / FONTS / TYPE1 /
/ USR / X11R6 / LIB / X11 / FONTS / CID /
/ USR / X11R6 / LIB / X11 / FONTS / 75DPI /
/ USR / X11R6 / LIB / X11 / FONTS / 100DPI /
In general, the recommended font path is:
/ USR / X11R6 / LIB / X11 / FONTS / LOCAL /
/ USR / X11R6 / LIB / X11 / FONTS / MISC /
/ usr / x11r6 / lib / x11 / fonts / 75dpi /: unscaled
/ USR / X11R6 / LIB / X11 / FONTS / 100DPI /: UNSCALED
/ USR / X11R6 / LIB / X11 / FONTS / TYPE1 /
/ USR / X11R6 / LIB / X11 / FONTS / CID /
/ USR / X11R6 / LIB / X11 / FONTS / SPEEDO /
/ USR / X11R6 / LIB / X11 / FONTS / 75DPI /
/ USR / X11R6 / LIB / X11 / FONTS / 100DPI /
RGBPath "Path" RGB color database path, the default value is: / usr / x11r6 / lib / x11 / RGB. ModulePath "Path" Sets the lookup path of the loaded X server module. 6.5.3 The ServerFlags section ServerFlags section is used to specify a global X server option, in general, this part is empty.
Option "NOTRAPSIGNALS" "Boolean" This option prevents the X server from capturing unwisered deadly signals and is clean. The X server exits and erases the Core file. Option "DONTZAP" "Boolean" Once this option is opened, Ctrl Alt BackSpace can be prohibited. Option "DONTZOOM" "Boolean" Opens this option to disable the key Ctrl Alt KeyPad-Plus and Ctrl Alt KeyPad-minus to switch the video mode. Option "DisablevidModeExtension" "Boolean" can be used to disable VidMode extensions. Option "AllownonLocalxvidTune" "Boolean" opens allows XvidTune customers to connect from other hosts. Option "Disablemodindev" "Boolean" Off can disable XFree86-MISC extension (available to dynamically modify the settings of the input device). Option "AllownonLocalModindev" "Boolean" allows customers to connect another host and change the settings of the keyboard and mouse on the running server. Option "AllowMouseOpenfail" "Boolean" Allows the X server to start even if the mouse device cannot be opened / initialized. Option "vtinit" "Command" runs the command after the VT used by the server is opened. This command is transmitted to "/ bin / sh -c" to run in STDIN and STDOUT set with this VT. Option "VTSYSREQ" "Boolean" makes the non-SYSV system VT support SYSV-style switching sequence. This means that the function key (FN) is followed after ALT-SYSRQ. This prevents the X server from capturing a switching sequence key for default VT (which has enabled customers to access them). Option "BlankTime" "Time" sets the timeout time of the black screen. TIME is in minutes, default for 10 minutes. (XSET Dynamic Settings) Option "StandBytime" "time" option "suspendtime" "office" "time" sets the time to support the DPMS, which is only suitable for support VESA DPMS compatible monitors. The default time is 20 minutes. (The screen is set to have a DPMS option setting) Option "Pixmap" "BPP" Set the format of the pixel format use depth 24. Option "NOPM" "Boolean" Disable Power Management Option "xinerama" "Boolean" enabled or disable xinerama extension 6.5.4 Module section This section is used to specify the loaded X server module. This section is ignored when the X server is established in a static manner. The modules loaded in this section typically be the X server extension module and the grating font module. Most other modules are automatically loaded when needed. Load "Modulename", for example: TYPE 1 Raster Font Module is loaded by the lower increment: load "type1" subsection "Modulename"
Option "ModuleOption"
Endsubsection
6.5.5 InputDevice Section This section is written from / etc / sysconfig / mouse and / etc / sysconfig / keyboard, and the settings of the two are required to be substantially consistent. In general, there are two input devices: one is the core keyboard, the other is the core pointer, the pointer equipment is mainly to the mouse, but it can also be other devices such as touch screens. Section "InputDevice"
Identifier "Name"
Driver "InputDriver"
Options
...
Endsection
The most common INPUTDRIVER is "Keyboard" and "Mouse". Option "Corepointer" device is installed as a core pointer. The system must have a core pointer. Option "CoreKeyboard" is set as the core keyboard when this option is set. There is only one core keyboard in the system. Option "Alwayscore" "Boolean" option "sendcoreeeevents" "Boolean" two options are equivalent, which causes the input device to always report the core event. It can be used for additional pointer devices to generate a core event. Option "HistorySize" Number "Sets the size of the mobile history, the default is 0. 6.5.6 Device Section This section describes the information corresponding to the card, which is generally obtained from the description corresponding to the card in the CARDDB file. If this device section is referenced by the Screen section, this section is considered to be available. Section "Device"
Identifier "Name"
Driver "driver"
entries
...
Endsection
BusID "Bus-ID" Specifies the bus position of the graphics card. For the PCI / AGP card, the bus-id string has the format of PCI: Bus: Device: Function. Xfree86 supports multiple display cards while displaying the Screen Number VideoRam MEM This option specifies the number of RAMs in the graphics card, in KB. The X service program automatically detects the display card, so this field is generally not required. Chipset "Chipset" chipset type on a graphics card. Ramdac "ramdac-type" DacSpeed speed DacSpeed speed-8 speed-16 speed-24 speed-32 ClockChip "clockchip-type" BiosBase baseaddress MemBase baseaddress IOBase baseaddress ChipID id ChipRev rev TextClockFreq freq than 10 fields, which represent some specific X Configuration parameters. It is generally not specified when configuring the X server, and the value is determined by automatic detection. 6.5.7 Monitor Section Monitor Section Describes the information of the display, at least one display section. All of its information can be read from the display when the display supports VBE and EDID extensions. Section "Monitor"
Identifier "Name"
entries
...
Endsection
The Vendorname "Vendor" manufacturer model "Model" Monitor of the MODELNAME monitor HORIZSYNC HORIZSYNC-RANGE The horizontal refresh frequency range supported by the monitor. The unit is KHz, the default range is 28-33kHz. The vertical refresh frequency range supported by the Vertrefresh VertRefresh-Range monitor supports. The unit is Hz, the default range is 43-72 Hz. Gamma Gamma-Valuegamma Red-Gamma Green-Gamma Blue-Gamma is used for GAMMA correction, ranges from 0.1 to 10.0, the default is 1.0. Not all drivers have the ability to use this information. UseModes "MODESECTION-ID" includes the MODES section called the mode collection listed by MODESECTION-ID. This makes these modes available for this display. Mode "Name" Sets the detailed definition of video mode. At the end of the EndMode keyword. DotClock Clock Click Clock Rate in this mode. Htimings HDISP HSYNCSTART HSYNCEND HTOTAL specifies the horizontal timing of the mode. VTIMINGS VDISP vSyncStart vsyncend vtotal specifies the vertical timing of the mode. Flags "flag" ... flag specified mode settings. "Interlace" setting mode is interleaved. "DoubleScan" specifies that each scan line is twice. " Hsync" and "-hsync" specifies the polarity of the HSYNC signal. " Vsync" and "-vsync" specify the polarity of the VSYNC signal. "Composite" specifies the composite synchronization signal. " Csync" and "-csync" specifies the polarity of the composite synchronous signal. HSKEW HSKEW Specifies the number of times the pixel Vscan vscan per scan line is drawn. "DoubleScan" double this value. Modeline "Name" Mode-DescriptionMode item compact version. In most cases, the VESA display mode contained in the X service program is enough, you do not need to specify. 6.5.8 Screen Festival A configuration file can have multiple Screen section, but at least one. This section represents information from the display card and monitor. When it appears in ServerLayout, the information represented by this section is activated, otherwise the system selects the first SCREEN section as an active. This section describes information display resolution, default depth, and other information. It must contain at least one DISPLAY sub-festival, which provides information related to display depth. Section "Screen" Identifier "Name"
Device "devid"
Monitor "MONID"
entries
...
Subsection "Display"
entries
...
Endsubsection
...
Endsection
Device "Device-ID" Specifies the same for the Device section used in this section, the device-id, and the application of the Device section. Monitor "Monitor-id" Specifies the Monitor Description VideoAdAptor "XV-ID" in this section Specify an optional XV Adapter Description DefaultDepth Depth Specifies the default display depth. The defaultfbbpp bpp specifies the frame buffer depth used by default. Display Pins: Subsection "Display"
Depth depth
entries
...
Endsubsection
DEPTH Depth Specifies the depth of this section. FBBPP BPP Specifies the frame buffer format represented by this section. Weight Red-Weight Green-Weight Blue-Weight Specifies the 16-bit display, the weight Virtual XDIM YDIM setting logic virtual xdim ydim setting logic virtual screen is generally required for an integer multiple of 8 or 16. Note: Some drivers are not allowed to set up virtual screens. ViewPort X0 Y0 Sets the left upper left corner of the initial display. MODES "Mode-Name" ... Set the video mode list under this depth. Nothing specified must be enclosed by a double quotation. This must correspond to the information specified by the Monitor section, that is, the scan frequency range specified by the Monitor section must contain the corresponding mode. Visual "visual-name" visual-name types available are StaticGray GrayScale StaticColor PseudoColor TrueColor DirectColor Black red green blue White red green blue, respectively, can be specified in black and white colors 6.5.9 ServerLayout section of each profile can have multiple sections ServerLayout A ServerLayout represents a combination of multiple Screen and one or more input devices (InputDevice section). Section "ServerLayout"
Identifier "Name"
Screen "screen-id"
...
InputDevice "Idev-ID"
...
Options
...
Endsection
Screen Screen-Num "Screen-id" position-information screen-information is forced, specifying the reference Screen section InputDevice "IDEV-ID" "Option" ... IDEV-ID is also forced, specifying the referenced InputDevice section, Multiple options can be specified, and they are separated by quotation marks, which is also supported by the InputDevice section, including: "Corepointer", "CoreKeyboard", "Sendcoreeevents". For example, specify two mice: section "serverlayout"
Identifier "Layout 1"
Screen "MGA 1"
Screen "MGA 2" Rightof "MGA 1"
InputDevice "Keyboard 1" "CorekeyBoard"
InputDevice "Mouse 1" "Corepointer"
InputDevice "Mouse 2" "Sendcoreeevents"
Option "BlankTime" "5"
Endsection