Basic knowledge of the Linux graphical interface (the relationship between X, X11, Xfree86, Xorg, GNOME, KDE) __linux

Source: Internet
Author: User
Tags object model

Reprint: http://apps.hi.baidu.com/share/detail/11596555


Linux beginners often don't know what the relationship is between Linux and X, between x and Xfree86, X and Kde,gnome. Often confusing concepts, this paper explains the relationship between X,x11,xfree,wm,kde,gnome and so on in a relatively easy to understand way.

Linux itself does not have a graphical interface, Linux is now the implementation of the graphical interface is only under the Linux application implementation.

The graphical interface is not a part of Linux, Linux is just a command-line based operating system, Linux and Xfree relationship is equivalent to the same year's DOS and WINDOWS3.0, windows3.0 is not a stand-alone operating system, it is only a DOS expansion, is a DOS application-level system, not a stand-alone operating system, the same xfree is only a Linux application. Not part of the system, but the presence of x makes it easier for users to use the computer. WINDOWS95 and later versions are not the same, their graphical interface is part of the operating system, the graphical interface is implemented in the kernel, without a graphical interface windows will not become windows, but Linux is not the same, no graphical interface Linux or Linux, Many Linux-loaded Web servers do not install X servers at all. This is also one of the important differences between Windows and Linux.


Two, X is an agreement, not a specific software.

X is the protocol, just like the HTTP protocol, the IP protocol. This concept many beginners even learn Linux for some time people are confused, an X-based application needs to run and display content when he is connected to the X server, beginning with the X protocol and server conversation. For example, an X application to output a circle on the screen then he said to the X server with the X protocol: Hey! I need to draw a circle on the screen. x application is only responsible for telling the X server where in the screen with what color to draw a large circle, and the specific "painting" action, such as how the circle generated, with what graphics card driver to command the video card completion and so on work is done by the X server. X server is also responsible for capturing the keyboard and mouse action, assuming that the X server caught the left mouse button was pressed, he told the X application: Dear application sir, I found the mouse was pressed, do you have any instructions? If the X application is designed to draw a square on the screen when the mouse Zuojian is pressed, X app says to x server: Please draw a square again, of course he will tell the server where to paint with what size square, but do not care about how to draw--that is the server thing.

Then the protocol needs specific software to implement, and that's what I'm going to talk about here:

Iii. the relationship between X and XFree86.

With a protocol, you need specific software to implement this Protocol. Like we have traffic regulations, we need the police to maintain the traffic order according to the regulations. Xfree86 is such a "traffic policeman" to achieve the agreement according to the law. He did the X-Protocol to complete the on-screen tasks presented by the X. Application. Of course, not only a certain traffic police can go to maintain and implement this law, such as also by traffic wardens to achieve traffic regulations, when necessary, the police can intervene, of course, if they must understand the traffic laws, That is to understand the agreement. So the software that implements the X protocol is not only xfree86,xfree86 a free x server software that implements the X protocol. Commercially used motif, and now there are xorg, and a lot of small X-ray services written by amateurs. Software. You can even run an X server on Windows so that you can run an X application on a Linux system and then display it on another Windows system. How magical. You can use Google to find this kind of x server software. Only the most common on Linux is XFree86. (Linux distributions are now xorg) by the way, Apple Computer graphics interface is also the X protocol, and is considered to do the best X protocol graphics interface, and his implementation of the X protocol is in the system core, so the performance is significantly better, which is why it is Many large three-dimensional graphic design software is the reason on the Apple platform.

To facilitate understanding of the HTTP protocol to compare:


Protocol is HTTP (Hyper Text transmission protocol)
Common servers to implement this protocol are: Apache IIS, etc.
The clients requesting these servers to transfer files are: IE, MOZILLA, Netscape, and so on.

Protocol is X

The common servers to implement this Protocol are XFREE86, Xorg, xnest, etc.

Customers requesting these servers to complete the display task: all x applications.

Only the HTTP protocol's servers and clients are usually implemented between two different computers (servers and clients), so it's easier for people to understand this. and the X protocol server and client programs are usually on the same computer, As a result, many users find this difficult to understand. Since it's a protocol, it's definitely not platform-independent, so you can have the X application appear on any remote computer that has an X server installed. To a Windows system that is displayed on a xnest server. Only in most cases, X applications use the native X server, and then the X server outputs the results to the local monitor. This is why many people don't understand that X is a protocol.

What is the relationship between X and X11R6?

Don't know if beginners have noticed/usr/x11r6 this directory, which is the default installation directory for Xfree
X11R6 is actually X Protocol version one release 6
(x Agreement 11th Edition Sixth issue) means that the current X protocol is in the 11th edition, And then after 6 minor revisions. Different versions of the X protocol are not able to communicate. Just as we are now IPV4 and IPV6 can't communicate, but don't worry, now the X server Software and x applications follow X11R6.

In addition, these versions of XFree86 3.3.6 XFree86 4.3.6 are the version number of the software XFree86 that implements the X protocol. This is often the concept of high confusion for beginners.

Protocol version and the version of the software that implements the protocol--Do you know the difference between the two concepts?

What is the relationship between the X server and the WM (Windows Manager window manager)?

How do we start the graphical interface at ordinary times?
It would be a shame if you went into the graphical interface as soon as you opened it. It should be a good time for you to learn about the X server START process. You open a xterm input:

Init 3

You can safely return to the character interface.

Well, when you're done with the following experiments, you fully understand what the relationship is between X and the WM (Windows Manager window manager).

First enter the following command:
#startx

The starting graphical interface you see is a peaceful time to use the same complete graphical interface operating environment.
You can maximize, minimize, move, close windows, and so on.

Press Ctrl+alt+backspace to back up the character interface.

Input:
#xinit

Start the graphical interface again and you see what you see a xterm. and can't move. But you can enter the command in this xterm to open the X application if I enter:
#mozilla
Open the browser, you see the browser and what is the difference between the usual? He is in the middle of the screen, cannot move, cannot be minimized, cannot be maximized, has no border.

Why is the same x application different? Because we also started a WM (the window manager) when we used the STARTX to start the graphical interface, and if you used KDE to move KDE, If you use GNOME, you start gnome, but you don't start the WM when you start the graphical interface with Xinit.

Now do you understand the role of the window manager? His role is to maximize, minimize, move, close the window, and so on. And these are not X servers responsible for the completion.

If you use the Xinit to start the graphical interface and enter the TWM in the xterm, see what happens?
Xterm is added a border, you can move through this border, maximize, minimize this xterm,twm is the XFree86 of the window manager, is a relatively simple window manager, but he has the full characteristics of the window manager.

If you enter gnome-session without entering TWM, you can start gnome
or input startkde to start KDE.

Through the above experiments you can clearly understand their relationship.

Vi. about KDE and GNOME

KDE and Gnome are the most common graphical interface operating environments in Linux, and they are not just a window manager, KDE is K Desktop environment . He is not only a window manager, there are many supporting applications and easy-to-use desktop environment, such as taskbar, Start menu, desktop icons and so on.

GNOME is an abbreviation for the GNU Network Object Model environment. Like KDE, it is also a powerful integrated environment.

In addition to other UNIX systems, CDE is often used as such an environment.

The other small window managers are:
Windows Maker,after step,blackbox,fvwm,fvwm2, and so on, are common good window managers. REDHAT9 has window maker but the default does not install, we can install to try. As long as the Xinit wmaker& can be used windowmaker.

A summary of the hierarchical relationship between Linux graphics interface

Linux itself-->x server <-[through the X Protocol Conversation]-> window Manager (Integrated desktop environment)--&GT;X application.

The implementation of the XFREE86 server consists of two parts, some of which are low-level to deal directly with the graphics card, and some are the upper layers dealing with the X application. The upper level is responsible for receiving application requests and mouse keyboard actions. and the graphics card directly dealing with the bottom of the command to generate graphics, in fact, is the graphics driver. When the upper layer receives the application's request, the request content is handled appropriately, and then presented to the graphics driver to direct the video card to complete the drawing. In addition, the upper portion of the capture keyboard and mouse action provides the application with mouse and keyboard status information, and the application receives the information to decide whether or not to act accordingly.

Usually said VESA,VGA, Fbdev and so on is actually for the different mode graphics card driver.
VESA (Video Electronics Standards Association)
VGA (video Graphics Array)
Fbdev (framebuffer Device)
Wait
are different graphics standards, but these standards are already very old. Today's graphics cards are compatible with these modes.

The framebuffer-mode video card itself does not have the ability to compute data, and he is like a pool of water for temporary storage. The CPU puts the result of the operation into this pool, the sink then streams the results to the monitor. The data is not processed in the middle. In this case, all display tasks have CPU completion, CPU load is heavy. From the name of Frambuffer, we can guess his function (Data reconnaissance buffer).

There is a framebuffer mechanism in the Linux kernel that mimics the functionality of the Framebuffer graphics card. His advantage is to abstract the hardware structure of the graphics card, all the graphics card as a "pool" To use. The application can also read the contents of the pool directly. Framebuffer's device name is/DEV/FB
You can use the command:
#dd If=/dev/zero OF=/DEV/FB
Clear the screen. If your x is using a framebuffer drive, the screen will all turn black. By moving the mouse, switching the window, and so on, can make the original content again display.

If you do not use Framebuffer driver, you can do this experiment in character mode. The screen will all be emptied.
The following commands:
#dd IF=/DEV/FB Of=fbfile
You can save the content in FB and then write back to the screen later:
#dd If=fbfile OF=/DEV/FB

The function is similar to screen capture, but the truncated figure cannot be seen in the normal picture browser.

Now you know the magic of framebuffer devices in Linux.
Linux character interface at high resolution, the launch will have a small Penguin logo, this logo is used framebuffer function to write on the screen.

VESA and VGA are much better than FB, but his display ability is also limited. The CPU still has to deal with most of the display tasks.

Now the video card is not the same, the CPU almost no parameter display task, and focus on the operation. We usually install graphics drivers in Linux, which is to replace the bottom part of the XFree86. So that he has a stronger ability to display. For example, your video card is nvidia, xfree default driver is "NV", he is a general driver of Nvidia graphics card, but he can't play the performance of Nvidia graphics card. This "NV" drive module can be used in:

/usr/x11r6/lib/modules/drivers

Directory to find the file name is: NV_DRV.O

There are also many graphics driver modules in this directory.
APM_DRV.O DUMMY_DRV.O NSC_DRV.O SIS_DRV.O
ARK_DRV.O FBDEV_DRV.O NV_DRV.O TDFX_DRV.O
ATI_DRV.O GLINT_DRV.O R128_DRV.O TGA_DRV.O
ATIMISC_DRV.O I128_DRV.O RADEON_DRV.O TRIDENT_DRV.O
CHIPS_DRV.O I740_DRV.O RENDITION_DRV.O TSENG_DRV.O
CIRRUS_ALPINE.O I810_DRV.O S3_DRV.O VESA_DRV.O
CIRRUS_DRV.O Linux S3VIRGE_DRV.O VGA_DRV.O
CIRRUS_LAGUNA.O MGA_DRV.O SAVAGE_DRV.O
CYRIX_DRV.O NEOMAGIC_DRV.O SILICONMOTION_DRV.O

Fbdev VGA EVSA etc. are in it.

As long as you specify what drivers are in the section module segment in the xf86conf file, X is driven by which.
Code:

section "Module"
Load "DBE"
Load "Extmod"
Load "FBDEVHW" #这里用的是fbdev
Load "GLX"
Load "Record"
Load "FreeType"
Load "Type1"
Load "DRI"
Endsection

This is the XFREE86 4.0 version of the method. That is, the X main program and the drive module are separate.

The main program is/USR/X11R6/BIN/XFREE86 (that is, the upper part)
The main program then starts by deciding which driver to use according to the configuration file.

However, in previous versions of XFree86 (3.3.6), the X main program and the driver module were combined, so there were many versions of the previous XFREE86 3.3.6 for different video cards.

Other x servers such as kdrive are also driven by the main program, so the same kdrive x server will have VESA, SVGA, and Fbdev versions. Because these are lightweight x servers, in order to simplify the structure he does this.

The benefit of Xfree86 4 as a driver and main program separation is that users can add their own upgrade drivers.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.