XFree86-4.2.1

Introduction to XFree86

Download location:              ftp://ftp.xfree86.org/pub/XFree86/4.2.0/source/
Version used:                   4.2.1
Package size:                   108 MB
Estimated Disk space required:  535 MB
Estimated build time:           63m (667 MHz)
XFree86 depends on: freetype-2.1.2


XFree86 is a freely redistributable open-source implementation of the X Window System. XFree86 provides a client/server interface between display hardware (the mouse, keyboard, and video displays) and the desktop environment while also providing both the windowing infrastructure and a standardized application interface (API).

There are several files that need to be fetched from the download location:

X420src-1.tgz 25354 KB 
X420src-2.tgz 22683 KB   
X420src-3.tgz  9089 KB


In addition, the following file will be needed:

ftp://ftp.xfree86.org/pub/XFree86/4.2.1/patches/4.2.0-4.2.1.diff.gz


Installation of XFree86

Kernel Compilation Settings

If you have an Intel P6 (Pentium Pro, Pentium II and later) it is recommneded that you compile MTRR (Memory Type Range Registers) support into the kernel. The kernel can map Cyrix and AMD CPUs to the MTRR interface so selecting this option is useful for those processors also. This option is found in the "Processor type and features" menu. It can increase performance of image write operations 2.5 times or more on PCI or AGP video cards.

In the "Character Devices" section, enable AGP Support and select the chipset support on your motherboard. If you do not know the chipset, you may select all the chip types at the expense of extra kernel size. You can usually determine your motherboard's chipset by doing:

cat /proc/pci


In the "Character Devices" section, disable Direct Rendering Manager unless you have a Direct Rendering Infrastructure (DRI) supported video card. See the DRI section below for a list. If you do enable DRI here, make sure you select the video card(s) you want to support as a module.

If you made any changes to the kernel configuration, recompile with

make dep &&
make bzImage &&
make modules &&
make modules_install


Copy /usr/src/linux/arch/i386/boot/bzImage and /usr/src/linux/System.map to /boot, edit /etc/lilo.conf appropriately and run lilo.

Note: If you build XFree86 in a chroot environment, make sure the kernel version of the base system and the target system are the same. This is especially important if you enabled DRI support as a module as instructed above.

Creating host.def

Although XFree86 will compile without a host.def file, the following file is recommended for customizing the installation. Start from the xc directory.

cat > config/cf/host.def << "EOF"
# Begin XFree86 hosts.def file
/* System Related Information.  If you read and configure only one
 * section then it should be this one.  The Intel architecture defaults are 
 * set for a i686 and higher.  Axp is for the Alpha architecture and Ppc is  
 * for the Power PC.  Note that there have been reports that the Ppc 
 * optimization line causes segmentation faults during build.  If that 
 * happens, try building without the DefaultGcc2PpcOpt line.  **************/
#define DefaultGcc2i386Opt  -O2 -fomit-frame-pointer -march=i686  
#define DefaultGcc2AxpOpt   -O2 -mcpu=ev6
#define DefaultGcc2PpcOpt   -O2 -mcpu=750
/* The following definitions are normally set properly by XFree86's scripts.
 * You can uncomment them if you want to make sure. ************************/
 
/* #define HasMTRRSupport      YES  */ /* Enabled in kernel see kernel docs */
/* #define HasMMXSupport        NO  */ /* Any i586 or above */
/* #define HasKatmaiSupport     NO  */ /* PIII SSE instuctions */
/* #define Has3DNowSupport      NO  */ /* AMD instructions */
/* This setting reduces compile time a little by omitting rarely used input 
 * devices.  You can find the complete list in config/cf/xfree86.cf ********/
 
#define XInputDrivers                 mouse void
/* VIDEO DRIVERS ***********************************************************/
/* If you are sure you only want the drivers for one or a few video cards,
 * you can delete the drivers you do not want. *****************************/ 
#define XF86CardDrivers mga glint nv tga s3virge rendition \
                        cirrus vmware tseng chips apm \
                        fbdev i128 \
                        ati AgpGartDrivers DevelDrivers ark cyrix \
                        vesa vga XF86OSCardDrivers
/* FONT SERVER AND LIBRARY SETTINGS ****************************************/
/* These setting should be set by default, but we are making sure. *********/
#define BuildFontServer          YES  /* Need for GhostScript Print Server */
#define SharedLibFont            YES  
#define CompressAllFonts         YES
#define GzipFontCompression      YES
/* These setting ensure we use the proper version of freetype **************/
#define HasFreetype2             YES
#define BuildFreetype2Library     NO
#define Freetype2Dir            /usr
/* The font path can be redefined in the XF86Config file *******************/
#define DefaultFontPath                $(FONTDIR)/misc/,$(FONTDIR)/75dpi/,\
$(FONTDIR)/100dpi/,$(FONTDIR)/Type1,$(FONTDIR)/local,\
$(FONTDIR)/TrueType,$(FONTDIR)/CID,$(FONTDIR)/Speedo
/* INTERNATIONAL FONTS.  Change to YES if you need any of them.  These  are
 * the defaults. ***********************************************************/
#define BuildCyrillicFonts            NO
#define BuildArabicFonts              NO
#define BuildISO8859_6Fonts           NO
#define BuildGreekFonts               NO
#define BuildISO8859_7Fonts           NO
#define BuildHebrewFonts              NO
#define BuildISO8859_8Fonts           NO
#define BuildKOI8_RFonts              NO
#define BuildJapaneseFonts            NO
#define BuildJISX0201Fonts            NO
#define BuildKoreanFonts              NO
#define BuildChineseFonts             NO
/* DOCUMENTATION SETTINGS **************************************************/
/* These setting are the defaults. *****************************************/
#define BuildLinuxDocHtml             NO    /* X Docs in Html format */
#define BuildLinuxDocPS               NO    /* X Docs in PostScript format */
#define BuildAllSpecsDocs             NO    /* Various docs */
#define BuildHtmlManPages             NO
/* Linux Distribution Information - Not essential that it is totally right.*/
#define LinuxDistribution         LFS 
/* GENERAL SETTINGS: You generally want to leave these alone when
 * building X on an LFS system *********************************************/
#define GccWarningOptions         -pipe
#define TermcapLibrary            -lncurses
#define XprtServer                YES /* Needed by realplayer */
#define XnestServer               YES
#define XAppLoadDir               EtcX11Directory/app-defaults
#define VarLibDir                 /var/lib
#define XFree86Devel               NO
#define FSUseSyslog               YES
#define ThreadedX                 YES
#define HasZlib                   YES
#define HasNCurses                YES
#define HasPam                     NO        
#define SystemManDirectory        /usr/share/man
#define HasLibCrypt               YES
#define InstallXinitConfig        YES
#define InstallXdmConfig          YES
#define ForceNormalLib            YES
#define BuildSpecsDocs             NO
# End XFree86 host.def file
EOF


Edit the file for your hardware and desires.

Build Commands

Install XFree86 by running the following commands:

patch -Np1 -i ../4.2.0-4.2.1.diff &&
make World 2>&1 | tee xfree-compile.log &&
make install &&
make install.man &&
ln -sf /usr/X11R6/bin /usr/bin/X11 &&
ln -sf /usr/X11R6/lib/X11 /usr/lib/X11 &&
ln -sf /usr/X11R6/include/X11 /usr/include/X11


Command explanations

make World 2>&1 | tee xfree-compile.log &&: This command runs multiple makefiles to completely rebuild the system. 2>&1 redirects error messages to the same location as normal output. The tee command allows viewing of the output while logging the results to a file.

Note: When rebuildng, a separate command that may be used if only minor changes are made to the sources is make Everything. This does not automatically remove generated files and only rebuilds those files or programs that are out of date.

ln -sf /usr/X11R6/bin /usr/bin/X11, ln -sf /usr/X11R6/lib/X11 /usr/lib/X11, and ln -sf /usr/X11R6/include/X11 /usr/include/X11: These commands are present to enable other (broken) packages to build against XFree86. We do this even though the Filesystem Hierarchy Standard says: "In general, software must not be installed or managed via the above symbolic links. They are intended for utilization by users only."

Configuring XFree86

Edit /etc/ld.so.conf and add /usr/X11R6/lib. Run

ldconfig


Add /usr/X11R6/bin to your PATH environment variable in .bash_profile. The statement should look something like PATH=$PATH:/usr/X11R6/bin and be placed before the export PATH statement.

Run

source ~/.bash_profile


Set up your mouse:

cd /dev
ln -s psaux mouse
Adjust the symbolic link as necessary for other types of mice. For instance, a serial mouse on the first serial port would be linked to ttyS1.

Create the XF86Config file with

cd ~
XFree86 -configure
The screen will go black and you may hear some clicking of the monitor. This command will create a file, XF86Config.new in your home directory.

Edit XF86Config.new to suit your system. The details of the file are located in the man page man XF86Config. Some things you may want to do are:

Test the system with

XFree86 -xf86config ~/XF86Config.new
You will only get a grey background with an X-shaped mouse cursor, but it confirms the system is working. Exit with Control-Alt-Backspace. If the system does not work, take a look at /var/log/XFree86.0.log to see what went wrong.

Move the confiuration file to its final location

mv ~/XF86Config.new /etc/X11/XF86Config-4


Create .xinitrc

cat > ~/.xinitrc << "EOF"
# Begin .xinitrc file
xterm  -g 80x40+0+0   &
xclock -g 100x100-0+0 &
twm
EOF
This provides an initial screen with an xterm and a clock that is managed by a simple window manager, Tab Winow Manager. For details of twm, see the man page.

Start X with

startx
to get basic funtional X Windows System.

Contents

The XFree86 package contains the X Windows system for Linux (and other operating systems). It includes the X server, fonts, xterm, a simple window manager (twm), various utilities, video output drivers, and various input drivers including the mouse and keyboard.

XFree86 also contains libraries and header files for development of X Windows programs.

Description

Note: The following list of programs is not comprehensive. The full list is in /usr/X11R6/bin. For additional information about these programs, see the respective man page.

XFree86

XFree86 is the X11R6 implementation of the X Windows server.

xf86config

An interactive program for generating an XF86Config file for use with XFree86 X servers.

xf86cfg

A tool to configure XFree86 that can be used to either write the initial configuration file or make customizations to the current configuration.

startx

A script to initialize the X session. It runs xinit.

xinit

This program is used to start the X Window System server.

twm

A Tab Window Manager for the X Window System.

xterm

A terminal emulator for X.

xwininfo

A window information utility for X.

x11perf

An X11 server performance test program.

xlsfonts

A program to list fonts available to the X server.

xvidtune

A video mode tuner for XFree86.

xload

A system load average display for X.

xcalc

A scientific calculator for X.

xclock and oclock

Clock programs for X.

xmodmap

A utility for modifying keymaps and pointer button mappings in X.