From c3eef312825b6de1d1175e878e17a2735b0d8252 Mon Sep 17 00:00:00 2001 From: Marc Fonvieille Date: Thu, 26 Aug 2004 20:19:07 +0000 Subject: [PATCH] Update the whole chapter for Xorg. The chapter covers the installation and configuration of both Xorg and XFree86 4.X with emphasis on Xorg. A "Moving from XFree86 to Xorg" section was also added, and some sentences reworded. (I may also add a NVIDIA drivers section soon) A great thanks to Ken Tom for his help! --- .../books/handbook/x11/chapter.sgml | 403 ++++++++++++------ 1 file changed, 264 insertions(+), 139 deletions(-) diff --git a/en_US.ISO8859-1/books/handbook/x11/chapter.sgml b/en_US.ISO8859-1/books/handbook/x11/chapter.sgml index e843529af8..5b2aa5b8d1 100644 --- a/en_US.ISO8859-1/books/handbook/x11/chapter.sgml +++ b/en_US.ISO8859-1/books/handbook/x11/chapter.sgml @@ -5,19 +5,47 @@ --> + + + + Ken + Tom + Updated for X.Org's X11 server by + + + Marc + Fonvieille + + + + The X Window System Synopsis - FreeBSD uses &xfree86; to provide users with - a powerful graphical user interface. &xfree86; - is an open-source implementation of the X Window System. This chapter - will cover installation and configuration of - &xfree86; on a FreeBSD system. For more - information on &xfree86; and video hardware that - it supports, check the &xfree86; web site. + FreeBSD uses X11 to provide users with + a powerful graphical user interface. X11 + is an open-source implementation of the X Window System that + includes both &xorg; and + &xfree86;. &os; versions up to and + including &os; 4.10-RELEASE and &os; 5.2.1-RELEASE + will find the default installation to be + &xfree86;, the X11 server released by + The &xfree86; Project, Inc. As of &os; 5.3-RELEASE, the + default and official flavor of X11 was changed to + &xorg;, the X11 server developed by + the X.Org Foundation. + + This chapter will cover the installation and configuration + of X11 with emphasis on + &xorg;. + + For more information on the video hardware that X11 + supports, check either the &xorg; or &xfree86; web + sites. After reading this chapter, you will know: @@ -28,8 +56,7 @@ - How to install and configure - &xfree86;. + How to install and configure X11. @@ -37,8 +64,7 @@ - How to use &truetype; fonts in - &xfree86;. + How to use &truetype; fonts in X11. @@ -53,6 +79,17 @@ Know how to install additional third-party software (). + + + This chapter covers the installation and the configuration + of both &xorg; and + &xfree86; X11 servers. For the most + part, configuration files, commands and syntaxes are identical. + In the case where there are differences, both + &xorg; and + &xfree86; syntaxes will be + shown. + @@ -62,32 +99,35 @@ familiar with other graphical environments, such as µsoft.windows; or &macos;. - It is not necessary to understand all of the details of various - X components and how they interact; however, some basic knowledge makes + While it is not necessary to understand all of the details of various + X components and how they interact; some basic knowledge makes it possible to take advantage of X's strengths. Why X? X is not the first window system written for &unix;, but it is the - most popular. X's original development team had worked on another - window system before writing X. That system's name was - W (for Window). X is just the next + most popularof them. X's original development team had worked on another + window system prior to writing X. That system's name was + W (for Window). X was just the next letter in the Roman alphabet. X can be called X, X Window System, - X11, and other terms. Calling X11 - X Windows can offend some people; - see &man.X.7; for a bit more insight on this. + X11, and a number of other terms. You may find + that using the term X Windows to describe X11 + can be offensive to some people; for a bit more insight on + this, see &man.X.7;. The X Client/Server Model X was designed from the beginning to be network-centric, and - adopts a client-server model. In the X model, the + adopts a client-server model. + + In the X model, the X server runs on the computer that has the keyboard, - monitor, and mouse attached. The server is responsible for managing + monitor, and mouse attached. The server's responsibility includes tasks such as managing the display, handling input from the keyboard and mouse, and so on. Each X application (such as XTerm, or &netscape;) is a client. A @@ -96,8 +136,8 @@ messages such as The user just clicked on the OK button. - If there is only one computer involved, such as in a home or small - office environment, the X server and the X clients will be running on + In a home or small + office environment, the X server and the X clients will most likely running on the same computer. However, it is perfectly possible to run the X server on a less powerful desktop computer, and run X applications (the clients) on, say, the powerful and expensive machine that serves @@ -109,7 +149,7 @@ server to be the big powerful machine down the hall, and the X client to be the machine on their desk. - Remember that the X server is the machine with the monitor and + It is important to remember that the X server is the machine with the monitor and keyboard, and the X clients are the programs that display the windows. @@ -120,8 +160,9 @@ various free and commercial applications available that do exactly that. - The X server that ships with FreeBSD is called - &xfree86;, and is available for free, under a + Starting with &os; 5.3-RELEASE, the X server that + installs with &os; is &xorg;, + and is available for free, under a license very similar to the FreeBSD license. Commercial X servers for FreeBSD are also available. @@ -272,64 +313,102 @@ - Installing &xfree86; + Installing X11 - Before installing &xfree86;, decide on which - version to run. &xfree86; 3.X is a maintenance - branch of &xfree86; development. It is very - stable, and it supports a huge number of graphics cards. However, no new - development is being done on the software. &xfree86; 4.X - is a complete redesign of the system with many new - features such as better support for fonts and anti-aliasing. - Unfortunately this new architecture requires that the video drivers be - rewritten, and some of the older cards that were supported in 3.X are not - yet supported in 4.X. As all new developments and support for new - graphics cards are done on that branch, &xfree86; 4.X - is now the default version of the X Window System on - FreeBSD. + &xorg; or + &xfree86;may be installed on &os;. + Beginning with &os; 5.3-RELEASE, + &xorg; is the default X11 + implementation for &os;. &xorg; is + the X11 server of the X11R6.7 distribution released by the X.Org + Foundation. X11R6.7 is based on the code of + &xfree86 4.4RC2 and X11R6.6. + The X.Org Foundation released X11R6.7 in April 2004. - The FreeBSD setup program offers users the opportunity to install - and configure &xfree86; 4.X during installation - (covered in ). To install and run - &xfree86; 3.X, wait until after the base - FreeBSD system is installed, and then install - &xfree86; 3.X. For example, to build and install - &xfree86; 3.X from the ports collection: + The FreeBSD setup program (sysinstall) offers users the opportunity to install + and configure X11 during installation + (covered in ). - &prompt.root; cd /usr/ports/x11/XFree86 -&prompt.root; make all install clean + To build and install &xorg; from the + ports collection: - Alternatively, either version of &xfree86; - can be installed directly from the FreeBSD binaries provided on the - &xfree86; web site. A binary - package to use with &man.pkg.add.1; tool is also available for - &xfree86; 4.X. When the remote fetching - feature of &man.pkg.add.1; is used, the version number of the - package must be removed. &man.pkg.add.1; will automatically fetch - the latest version of the application. So to fetch and install the - package of &xfree86; 4.X, simply type: + &prompt.root; cd /usr/ports/x11/xorg +&prompt.root; make install clean - &prompt.root; pkg_add -r XFree86 - - You can also use the ports collection to install - &xfree86; 4.X, for that you simply need - to type the following commands: + To build and install &xfree86; + from the ports collection: &prompt.root; cd /usr/ports/x11/XFree86-4 &prompt.root; make install clean + Alternatively, X11 + can be installed directly from packages. + Binary packages to use with &man.pkg.add.1; tool are also available for + X11. When the remote fetching + feature of &man.pkg.add.1; is used, the version number of the + package must be removed. &man.pkg.add.1; will automatically fetch + the latest version of the application. + + So to fetch and install the package of + &xorg;, simply type: + + &prompt.root; pkg_add -r xorg + + The &xfree86; 4.X package can be + installed by typing: + + &prompt.root; pkg-add -r XFree86 + The examples above will install the complete - &xfree86; distribution including the - servers, clients, fonts etc. Separate packages and ports for - different parts of &xfree86; 4.X are also + X11 distribution including the + servers, clients, fonts etc. Separate packages and ports of X11 + are also available. The rest of this chapter will explain how to configure - &xfree86;, and how to set up a productive desktop + X11, and how to set up a productive desktop environment. - + + Moving from <application>&xfree86;</application> to + <application>&xorg;</application> + As with any port, you should check the + /usr/ports/UPDATING file for changes. + Included in this file are instructions for converting your + system from &xfree86; to + &xorg;. + + Use CVSup to update your ports + tree prior to attempting any conversion. You will also need + to install sysutils/portupgrade prior to + converting your X11 installation. + + In your /etc/make.conf you will need + to add the variable X_WINDOW_SYSTEM=xorg. + This ensures that your system knows which X11 is being used. + The older XFREE86_VERSION variable has been + deprecated and has been replaced with the + X_WINDOW_SYSTEM variable. + + Then, use the following commands: + + &prompt.root; pkg_delete -f /var/db/pkg/imake-4* /var/db/pkg/XFree86-* +&prompt.root; cd /usr/ports/x11/xorg +&prompt.root; make install clean +&prompt.root; pkgdb -F + + The &man.pkgdb.1; command is part of the + portupgrade software and will + update various packages dependencies. + + + To build &xorg; in its + entirety, be sure to have at least 2GB of free space + available. + + @@ -343,16 +422,18 @@ - &xfree86; Configuration + X11 Configuration &xfree86; 4.X &xfree86; + &xorg; + X11 Before Starting - Before configuration of &xfree86; 4.X, + Before configuration of X11 the following information about the target system is needed: @@ -365,7 +446,7 @@ vertical scan rate The specifications for the monitor are used by - &xfree86; to determine the resolution and + X11 to determine the resolution and refresh rate to run at. These specifications can usually be obtained from the documentation that came with the monitor or from the manufacturer's website. There are two ranges of numbers that @@ -373,7 +454,7 @@ rate. The video adapter's chipset defines what driver module - &xfree86; uses to talk to the graphics + X11 uses to talk to the graphics hardware. With most chipsets, this can be automatically determined, but it is still useful to know in case the automatic detection does not work correctly. @@ -386,36 +467,47 @@ - Configuring &xfree86; 4.X + Configuring X11 - Configuration of &xfree86; 4.X is + Configuration of X11 is a multi-step process. The first step is to build an initial - configuration file with the option to - &xfree86;. As the super user, simply + configuration file. + As the super user, simply run: + &prompt.root; Xorg -configure + + In the case of &xfree86; + type: + &prompt.root; XFree86 -configure - This will generate a skeleton - &xfree86; configuration file in the + This will generate an + X11 configuration skeleton file in the /root directory called - XF86Config.new (in fact the directory used - is the one covered by the environment variable $HOME, - and it will depend from the way you got the superuser rights). The - &xfree86; program will attempt to probe - the graphics hardware on the system and will write a + xorg.conf.new (whether you &man.su.1; or + do a direct login affects the inherited supervisor + $HOME directory variable). + For &xfree86;, this configuration + file is called XF86Config.new. The + X11 program will attempt to probe + the graphics hardware on the system and write a configuration file to load the proper drivers for the detected hardware on the target system. The next step is to test the existing - configuration to verify that &xfree86; + configuration to verify that &xorg; can work with the graphics - hardware on the target system. To perform this task, the user - needs to run: + hardware on the target system. To perform this task, + type: + + &prompt.root; Xorg -config xorg.conf.new + + &xfree86; users will type: &prompt.root; XFree86 -xf86config XF86Config.new - If a black and grey grid and an X mouse cursor appear, + If a black and grey grid and an X mouse cursor appears, the configuration was successful. To exit the test, just press Ctrl @@ -423,18 +515,18 @@ Backspace simultaneously. - If the mouse does not work, be sure the device - has been configured. See + If the mouse does not work, you will need to first + configure it before proceeding. See in the &os; install chapter. - &xfree86; 4 Tuning + X11 Tuning - Next, tune the XF86Config.new + Next, tune the xorg.conf.new (or XF86Config.new if you are running &xfree86) configuration file to taste. Open the file in a text editor such as &man.emacs.1; or &man.ee.1;. First, add the frequencies for the target system's monitor. These are usually expressed as a horizontal and vertical synchronization rate. These - values are added to the XF86Config.new file + values are added to the xorg.conf.new file under the "Monitor" section: Section "Monitor" @@ -446,7 +538,7 @@ EndSection The HorizSync and - VertRefresh keywords may not exist in the + VertRefresh keywords may be missing in the configuration file. If they do not, they need to be added, with the correct horizontal synchronization rate placed after the HorizSync keyword and the vertical @@ -464,10 +556,13 @@ EndSection Option "DPMS" - XF86Config + xorg.conf + + + XF86Config - While the XF86Config.new + While the xorg.conf.new (or XF86Config.new) configuration file is still open in an editor, select the default resolution and color depth desired. This is defined in the "Screen" section: @@ -478,6 +573,7 @@ EndSection Monitor "Monitor0" DefaultDepth 24 SubSection "Display" + Viewport 0 0 Depth 24 Modes "1024x768" EndSubSection @@ -486,39 +582,62 @@ EndSection The DefaultDepth keyword describes the color depth to run at by default. This can be overridden with the command line switch to - &man.XFree86.1;. + &man.Xorg.1; (or &man.XFree86.1;). The Modes keyword describes the resolution to run at for the given color depth. Note that only VESA standard modes are supported as defined by the target system's graphics hardware. In the example above, the default color depth is twenty-four bits per pixel. At this color depth, the accepted resolution is - one thousand twenty-four pixels by seven hundred and sixty-eight + 1024 by 768 pixels. Finally, write the configuration file and test it using - the test mode given above. If all is well, the configuration + the test mode given above. + + + One of the tools available to assist you during + troubleshooting process are the X11 log files, which contain + information on each device that the X11 server attaches to. + &xorg; log files are in the format + of /var/log/Xorg.0.log + (&xfree86; log files follow the + format of XFree86.0.log). The exact name + of the log can vary from Xorg.0.log to + Xorg.8.log and so forth. + + + If all is well, the configuration file needs to be installed in a common location where - &man.XFree86.1; + &man.Xorg.1; (or &man.XFree86.1;) can find it. - This is typically /etc/X11/XF86Config or - /usr/X11R6/etc/X11/XF86Config. + This is typically /etc/X11/xorg.conf or + /usr/X11R6/etc/X11/xorg.conf (for + &xfree86; it is called + /etc/X11/XF86Config or + /usr/X11R6/etc/X11/XF86Config). + + &prompt.root; cp xorg.conf.new /etc/X11/xorg.conf + + For &xfree86;: &prompt.root; cp XF86Config.new /etc/X11/XF86Config - Once the configuration file has been placed in a common - location, configuration is complete. In order to start + The X11 configuration process is now + complete. In order to start &xfree86; 4.X with &man.startx.1;, install the x11/wrapper port. - &xfree86; 4.X can also be started with + &xorg; already includes the wrapper + code and does not require the installation of the wrapper port. + The X11 server may also be started with the use of &man.xdm.1;. - There is also a graphical tool for configuration, - &man.xf86cfg.1;, that comes with the - &xfree86; 4.X distribution. It + There is also a graphical configuration tool, + &man.xorgcfg.1; (&man.xf86cfg.1; for &xfree86;), that comes with the + X11 distribution. It allows to interactively define your configuration by choosing - the appropriate drivers and settings. This program can be used under console as well, just use the command xf86cfg -textmode. For more details, - refer to the &man.xf86cfg.1; manual page. + the appropriate drivers and settings. This program can be invoked from the console, by typing the command xorgcfg -textmode. For more details, + refer to the &man.xorgcfg.1; and &man.xf86cfg.1; manual pages. @@ -532,7 +651,7 @@ EndSection Configuration with &intel; i810 integrated chipsets requires the agpgart - AGP programming interface for &xfree86; + AGP programming interface for X11 to drive the card. The &man.agp.4; driver is in the GENERIC kernel since releases 4.8-RELEASE and 5.0-RELEASE. On prior releases, you will @@ -575,7 +694,7 @@ EndSection later) and messages about unresolved symbols like fbPictureInit appear, try adding the following line after Driver "i810" in the - &xfree86; configuration file: + X11 configuration file: Option "NoDDC" @@ -591,19 +710,18 @@ EndSection - Using Fonts in &xfree86; + Using Fonts in X11 Type1 Fonts The default fonts that ship with - &xfree86; are less than ideal for typical + X11 are less than ideal for typical desktop publishing applications. Large presentation fonts show up jagged and unprofessional looking, and small fonts in &netscape; are almost completely unintelligible. However, there are several free, high quality Type1 (&postscript;) fonts available which can be readily used - with &xfree86;, either version 3.X or - version 4.X. For instance, the URW font collection + with X11. For instance, the URW font collection (x11-fonts/urwfonts) includes high quality versions of standard type1 fonts (Times Roman, Helvetica, Palatino and others). The Freefonts collection @@ -611,9 +729,10 @@ EndSection many more fonts, but most of them are intended for use in graphics software such as the Gimp, and are not complete enough to serve as screen fonts. In addition, - &xfree86; can be configured to use - &truetype; fonts with a minimum of effort: see the - section on &truetype; fonts later. + X11 can be configured to use + &truetype; fonts with a minimum of effort. For more details on + this, see the &man.X.7; manual page or the + section on &truetype; fonts. To install the above Type1 font collections from the ports collection, run the following commands: @@ -621,11 +740,13 @@ EndSection &prompt.root; cd /usr/ports/x11-fonts/urwfonts &prompt.root; make install clean - And likewise with the freefont or other collections. To tell the X - server that these fonts exist, add an appropriate line to the - XF86Config file (in /etc/ for - &xfree86; version 3, or in - /etc/X11/ for version 4), which reads: + And likewise with the freefont or other collections. To have the X + server detect these fonts, add an appropriate line to the + X server configuration file in /etc/X11/ + (xorg.conf for + &xorg; and + XF86Config for + &xfree86;), which reads: FontPath "/usr/X11R6/lib/X11/fonts/URW/" @@ -654,12 +775,13 @@ EndSection TrueType - &xfree86; 4.X has built in support + Both &xfree86; 4.X and &xorg; have built in support for rendering &truetype; fonts. There are two different modules that can enable this functionality. The freetype module is used in this example because it is more consistent with the other font rendering back-ends. To enable the freetype module just add the following line to the "Module" section of the + /etc/X11/xorg.conf or /etc/X11/XF86Config file. Load "freetype" @@ -676,7 +798,7 @@ EndSection and copy all of the &truetype; fonts into this directory. Keep in mind that &truetype; fonts cannot be directly taken from a &macintosh;; they must be in &unix;/&ms-dos;/&windows; format for use by - &xfree86;. Once the files have been + X11. Once the files have been copied into this directory, use ttmkfdir to create a fonts.dir file, so that the X font renderer @@ -696,7 +818,7 @@ EndSection &prompt.user; xset fp rehash or add a FontPath line to the - XF86Config file. + xorg.conf (or XF86Config) file. That's it. Now &netscape;, Gimp, @@ -714,7 +836,7 @@ EndSection Joe Marcus Clarke - Updated for &xfree86; 4.3 by + Updated by @@ -725,14 +847,17 @@ EndSection fonts anti-aliased - Anti-aliasing has been available in - &xfree86; since 4.0.2. However, font + Anti-aliasing has been available in X11 since + &xfree86; 4.0.2. However, font configuration was cumbersome before the introduction of - &xfree86; 4.3.0. Starting in version 4.3.0, - all fonts in /usr/X11R6/lib/X11/fonts/ and + &xfree86; 4.3.0. + Beginning with + &xfree86; 4.3.0, all fonts in X11 + that are found + in /usr/X11R6/lib/X11/fonts/ and ~/.fonts/ are automatically made available for anti-aliasing to Xft-aware applications. Not - all applications are Xft-aware yet, but many have received Xft support. + all applications are Xft-aware , but many have received Xft support. Examples of Xft-aware applications include Qt 2.3 and higher (the toolkit for the KDE desktop), GTK+ 2.0 and higher (the toolkit for the @@ -861,7 +986,7 @@ EndSection your changes to be ignored. The default font set that comes with - &xfree86; is not very + X11 is not very desirable when it comes to anti-aliasing. A much better set of default fonts can be found in the x11-fonts/bitstream-vera @@ -872,7 +997,7 @@ EndSection file. Merge the contents of this file into /usr/X11R6/etc/fonts/local.conf, and the Bitstream fonts will automatically replace the default - &xfree86; Serif, Sans Serif, and Monospaced + X11 Serif, Sans Serif, and Monospaced fonts. Finally, users can add their own settings via their personal @@ -1092,7 +1217,7 @@ EndSection chooser and the login screens. This is where the appearance of the login program can be modified. The format is identical to the app-defaults file described in the - &xfree86; documentation. + X11 documentation. @@ -1283,7 +1408,7 @@ DisplayManager.requestPort: 0 GNOME anti-aliased fonts - Starting with version 4.0.2, &xfree86; + X11 supports anti-aliasing via its RENDER extension. GTK+ 2.0 and greater (the toolkit used by GNOME) can make use of this @@ -1547,8 +1672,8 @@ esac KDE anti-aliased fonts - Starting with version 4.0.2, - &xfree86; supports anti-aliasing via + X11 + supports anti-aliasing via its RENDER extension, and starting with version 2.3, Qt (the toolkit used by KDE) supports this extension. Configuring this is described in