LinuxThe configuration process of a device is to use this information to configure the driver and working method of the device after detecting the device type and current working parameters of the device, for device detection process, see how to implement automatic hardware detection in Linux). To complete such a task, you need to do the following:
First, a detailed device information file is required, which describes the device ID, the device driver corresponding to the device ID, and the device configuration parameter device options) detailed descriptions of device settings, device configuration methods, aliases of devices, and the number of the primary devices.
The second is to set the configuration script file corresponding to the device according to the device type and the configuration script files of the same device for different linux versions installed.
Window System XFree86) configuration process
1. Introduction to the description file of the display card CardDB)
CardDB is the data file of the display card used by the X configuration program. When XFree86 is configured, the configuration program generally needs to read the content on it to complete the configuration of the display card. Its content is closely related to the XFree86 version used. Generally, it is stored in the/usr/X11R6/lib/X11/directory. Now we will briefly introduce the XFree86 4.1.0 CardDB file:
NAME
Name of the display card description
CHIPSET
Describes the chip set used by the display card.
SERVER
To be backward compatible with XFree86 of version 3.x, this field specifies the x servers that the display is stuck in XFree86 3. x, such as VGA16 and SVGA.
DRIVER
Describes the driver module of the display card in XFree86 v4.x.
LINE
Set the specific Option Information of the display card. This Option information appears in the Device section of XF86Config, corresponding to the Option parameter of the Device.
SEE
Indicates that the configuration information of this display card is exactly the same as that set by the SEE field. For example:
NAME Number Nine GXE64 with S3 Trio64
SEE S3 Trio64 (generic)
Indicates that the display card configuration of Number Nine GXE64 is identical to that of S3 Trio64 (generic.
RAMDAC
Control Chip model of RAM Direct Access Control
DACSPEED
Speed of Direct Access Control
CLOCKCHIP
The clock chip of this display card
NOCLOCKCHIP
No clock chip for this display card
UNSUPPORTED
This type of graphics card is not supported by XFree86.
COMMENT
Note
For example, for riva tnt video card, the information in XFree86 4.1.0 is as follows:
NAME RIVA TNT
CHIPSET RIVATNT
SERVER SVGA
DRIVER nv
NOCLOCKPROBE
2. Monitor Information Detection
The display information is very important in the XFree86 system. It corresponds to the Monitor section of the XFree86 configuration file. This section contains information such as the monitor's horizontal scan frequency range, vertical scan frequency range, and display mode supported by the monitor. Similarly, the automatic detection of the monitor means that the above information of the monitor is automatically read through the program. The correct settings play an important role in the normal display of XFree86.
For information detection of the monitor, it is required to support BIOS-level extension of vbeVESA ). When the monitor supports this extension, you can obtain the display details by calling the INT 10 h bios in the system real-time mode.
You may need to call the following BIOS sub-functions:
AH = 0x4F00
Obtain BIOS-level extensions for the VESA of the monitor
AH = 0x4F01
Obtain a specific Display Mode Supported by the monitor
AH = 0x4F02
Set the current video mode
AH = 0x4F03
Obtain the current video mode
AH = 0x4F04
Save/restore svga Display Mode
AH = 0x4F15
Obtain the monitor's EDID Extension Information
Generally, the display is interrupted by checking whether the display supports vesa bios-level extensions. If the display supports BIOS-level extensions, view the display modes supported by the display, then obtain the EDID extension information of the monitor. In the read EDID extension information, you can find the vertical and horizontal frequency ranges of the display, or calculate the display size, some monitors can also read the manufacturer information of the monitor from this information.
You can set the Monitoring Section of XF86Config for the Information read by the Monitor. For a display with the correct vertical return frequency range and horizontal return frequency range, X is automatically set to the display mode of the maximum Scan Frequency supported by the current display resolution. This display mode requires a corresponding Modeline ).
However, if your monitor does not support EDID extension information, you can only set the vertical return frequency range and horizontal return frequency range based on experience. If the range is higher than the actual range supported by the monitor, the display will be black.
For programming implementation, if you want to call the above bios interrupt, you must use the lrmi real-mode interface and set the correct register information to complete the system call. For specific examples of detecting the display information, you can refer to the ddcprobe source program under xcyclator, or the source program of the ddcxinfos command under the Mandrake system.
3. Window system configuration process
To correctly configure the Window System in linux, you actually need to generate the correct XFree86 configuration file. This file is generally stored in/etc/X11/, and in Version X is 3. x, the file name is XF86Config, which is 4 in X. x, its file name is generally XF86Config-4. In the current release version, hardware compatibility is considered. They generally make the XFree86 packages of both versions coexist. Therefore, you can also find the two files exist in the/etc/X11 directory at the same time. When you use the file, you need to check the version of the system's X server.
The XF86Config file of that version is composed of multiple sections. However, the content described in these sections mainly includes the keyboard, mouse, display, display card, and font color.
When Version X is 3.x, the Keyboard and mouse descriptions correspond to the Keyboard and Pointer Sections respectively. In Version X, it is 4. at the time of x, the description of the keyboard and mouse corresponds to the InputDevice section, but corresponds to different driver modules. The driver module of the keyboard is the keyboard, and the driver module of the mouse is the mouse. The information required for configuring these two sections can be obtained from/etc/sysconfig/keyboard and/etc/sysconfig/mouse. Their details are described in the previous sections of this article.
The configuration display is actually the Monitor section that generates the XF86Config file. The information to be configured generally includes the horizontal scan frequency range, vertical scan frequency range, display mode supported by the Monitor, and manufacturer information. For a display that supports vbe and edid extension, you can set the value of the corresponding field based on the information read from the display. However, if the display does not support the above extensions, you must manually set the display card. If you do not specify this section When configuring XFree86, XFree86 sets the display mode to 640x480, and the vertical scan frequency to 60Hz. Scan Frequency of different display modes:
Display resolution vertical scan frequency Hz) Horizontal Scan Frequency kHz)
640x480 60 31.50
640x480 72 36.50
640x480 75 37.50
640x480 85 43.27
800x600 60 37.80
800x600 72 48.00
800x600 85 55.84
800x600 100 64.02
1024x768 60 48.40
1024x768 70 56.50
1024x768 76 62.50
1024x768 85 70.24
1024x768 100 80.21
1280x1024 61 64.20
1280x1024 70 74.59
1280x1024 74 78.85
1280x1024 76 81.13
1280x1024 85 91.15
1280x1024 100 107.16
1600x1200 60 75.00
1600x1200 70 87.50
1600x1200 75 93.75
1600x1200 85 105.77
Table 6-1
As you can see from the table above, if you want to set the display to a certain resolution, the scanning frequency range also includes the lowest scanning frequency of the resolution in the table above. If your display does not reach this range, the XWindow will not work properly. If the scan frequency you set is higher than the actual Scan Frequency Range of the monitor, XFree86 will find the maximum scan frequency at the corresponding resolution for display, so XWindow is very likely to be black at this time.
When a configuration script is generated, the scan frequency range is not as low as possible. Setting a lower scanning frequency range is not suitable for some LCD monitors. For example, when a part of LCD displays have a resolution of X, the minimum vertical scanning frequency is 70Hz. Then, you must specify a horizontal scanning range of 48 kHz.
After configuring the monitor, you need to generate a description corresponding to the display card. This description corresponds to the Device section of the XF86Config file. This section describes the display card information, including: the X server X corresponding to the display card is in version 3.x), and the X Device Module X is in version 4.x ), display card device information supplier, model, support for video memory access mode and video memory size), and the device options supported by this display card, such as whether the display card supports hardware acceleration, whether supports soft cursor, and so on. The configuration process of the window generation system is generally based on the detection process of pci device identification) to obtain the type of the display card, you can find the corresponding display card description in the XFree86 configuration file CardDB in the/usr/X11R6/lib/X11/directory. You can set the description in this section.
The font and palette information describes the path where the font and palette are stored. if you add a new font, you must add the correct font path here. If you specify unix:-1 as the font path, you must first start the font server xfs before starting the X server, and then the font server completes the font access request.
After you set the preceding information correctly, you must store the information in the Screen section. This section describes how to display the corresponding display card, display, resolution, and default depth.
Finally, you must generate the ServerLayout section, which describes the display card configuration section, monitor configuration section, mouse configuration section, and keyboard configuration section used by the entire system.
After generating the/etc/X11/XF86ConfigXF86Config-4) file, you can test whether the configuration file is correct. For example, for XFree86 4.x, the generated configuration file is/etc/X11/XF86Config. test. The following command is used for testing:
XFree86-xf86config/etc/X11/XF86Config. test: 9
-Xf86config/etc/X11/XF86Config. test indicates that X server is started using the specified configuration file.
: 9 indicates running X server on Terminal 9
Generally, if the configuration process is programmed to implement X, the system must call fork as a sub-process to run the preceding command. After the X server is successfully started, run a small graphical program and let the user choose whether the configuration is successful.
Of course, if you cannot obtain the detailed device parameters of the video card, you can also use the probeonly option to obtain the detailed information of the display card. For example, use the following command for XFree86 4.x testing:
XFree86-probeonly: 9
After XFree86 is started normally, you can obtain the system output information by reading/var/log/XFree86.x. log. X refers to the terminal started by XFree86. Generally, this x is set to 0.
After the XF86Config file is configured, you can use startx to start XFree86. This file runs the. xinitrc file under your logon directory to modify the initial display status of the X Window System. This file is a script file. If the file does not exist,/usr/X11R6/lib/X11/xinit/xinitrc is used by default. At the same time, startx also needs to find/etc/X11/X. This file is a link file that points to the real X service program. Now, this program usually points to Xwrappers, it? Encapsulation of the embedded ghost service program. Of course, this file can also direct to X service program XFree86.