8. Installation of the X Window System (X11R6)

Contents of this section

8.1 General notes

The X Window System is what most users might regard as "the real Unix". Although working on the Linux virtual consoles has already become quite comfortable with color support and Cut & Paste abilities, X is much more interesting for most people.

X for Linux/m68k is currently derived from XFree86 3.1.2, which is a derivation of X11R6pl12 (read: X Window System Version 11, Release 6, patchlevel 12). It features all libraries, client programs and Xserver abilities you are probably used to from other ports. Porting of X software to Linux/m68k is as simple (or hard) as porting it to Linux/x86. Often, it's as simple as unpacking an archive, typing xmkmf and make.

A lot of software that is not part of the X11R6 core distribution has been compiled/ported by people from the Linux/m68k "team" and can be found on the FTP servers listed in the FAQ, usually under a directory like /pub/linux/680x0/X11R6. There are window managers, applications, graphic programs, tools, and more. If you find a program that has not yet been compiled by others, you might easily do it yourself.

Please note that this installation only contains "bare-bones" X11 - no famous clients (like xv, xpaint, Mosaic, fvwm or the like) are included. You will have to either compile those yourself or get pre-compiled binaries from the FTP servers mentioned in the FAQ. As far as pre-compiled binaries are concerned, these are usually tar'ed together so that you just have to unpack them from / to install everything in the right place.

8.2 Requirements

Memory:

Contrary to "bare bones" Linux with virtual consoles, X11R6 has vastly higher requirements, especially concerning main memory. A system with 8 MB RAM and 16 MB swap is to be regarded "smallest configuration". This will allow you to start the Xserver, a few small clients and get the feeling for it all.

If you plan to do serious work under X11, like recompiling kernels, creating documents in LaTeX (and viewing the resulting .dvi/.ps files) or image processing, you will need more main memory - the more the better.

Harddisk space:

My current X11R6 installation occupies about 50 MBytes, including fonts, manuals and also quite a lot of other small tools. The X11 distribution I'll explain requires about 30 MBytes. You will need that much space on a Linux partition and also about 15 MBytes of temporary space on an AmigaOS partition to put the archives to. You can delete the archives after you have installed them.

Libraries:

You should have prepared your system for ELF, the Executable and Linker Format. The currently recommended X11R6 binary release is compiled in ELF, and so it requires the other libraries (libc, ..) to also be in ELF. The file ftp://tsx.mit.edu/pub/linux/680x0/ELF/README gives details about turning your Linux installation into an ELF system.

Older kernels (before 0.9pl7 or so) required that you add a kernel patch to make it ELF-compatible, but the more current kernels already have this built in, so you do not have to worry about that.

The "old" X11R6 release which was compiled by Martin Schaller and Roman Hodek (most of this stuff is on tsx.mit.edu under /pub/linux/680x0/X11R6/) is regarded somewhat "obsolete" although there are a few binaries which you might need - and if this is the case, you will also need the old X11R6 libraries. Installing them is not explained here - all important programs should soon be available in pre-compiled form as ELF binaries. If you have some X11 client which does not run after you have performed the installation in this section, try the following:


ldd <binaryname>

If this says something like

/usr/X11R6/bin/xterm: can't load library '/usr/X11R6/lib/libX11.so.6'
        Exec format error

or (if you had installed the old shared libraries)

libXt.so.6 (DLL Jump 6.0) => /usr/m68k-linuxaout/lib/libXt.so.6.0
libX11.so.6 (DLL Jump 6.0) => /usr/m68k-linuxaout/lib/libX11.so.6.0
(some more lines to appear here)

(important are the "DLL Jump" words) you know that this is a binary that was linked against the old a.out shared libraries, so you will need those old libraries to run this binary. Alternatively, you might want to get the sources to that program and compile it yourself in ELF.

Graphic boards:

Hm, well. Right now we still only have very little support for graphic boards.

I (Frank) have written a simple driver for the "Rainbow 3" board which almost noone has, but if you have one and are interested, mail me. This driver is not yet integrated into the kernel.

There is an upcoming driver for the Cybervision by Martin Apel and Torsten Ebeling. Take a look at the FAQ for details (it's in the Under Construction / Todo section).

Geert Uytterhoeven has written a pretty extensive driver for the AGA chipset. This is not currently part of the kernel, but can be gotten from his ftp site: ftp://linux3.cc.kuleuven.ac.be/pub/Linux68k/ . The name should start with amifb_*, where the rest of the name changes too often to give it here. You'll have to compile your own kernel to use these features.

As for the rest, you are (at the moment) limited to the built-in video hardware (ECS, OCS) in monochrome mode. Let's hope this will sooner or later change.

Files:

You will need quite a couple of archives for a complete installation; in particular, these are:

Fortunately, almost all of these files can be found in the same place. Here is a list of FTP sites that carry them:

When this text was written, the files were not on tsx.mit.edu, for disk space reasons. Once they get uploaded there, they will be under /pub/linux/680x0/X11R6/X11R6pl12/.

The files you will need are (file sizes in brackets are for compressed files):

X11R6_950911_lib.tar.gz      (shared libraries etc, 1.1 MB)
X11R6_950911_servers.tar.gz  (The Xserver program, 1.6 MB)
X11R6_951009_bin.tar.gz      (client programs, 1.6 MB)
X11R6_950911_man.tar.gz      (manual pages, 512 KBytes)
X11R6_950911_fonts.tar.gz    (fonts, 8 MB)
X11R6_950911_include.tar.gz  (include files, 300 KByte)
X11R6_951009.readme
X11R6_950911.readme          (read these)

Look at the digits - don't get the wrong archives!

Put these onto an AmigaOS partition so that you can access them from Linux. Alternatively, you can put them onto a tape and restore them to a temporary location on a Linux (ext2) partition. This has the advantage that unpacking the archives is faster than reading the data from an affs partition (the current affs filesystem code is very slow for longer files).

Furthermore, you will need the archive X-devices.tar.gz from tsx.mit.edu . By unpacking it you create some necessary special files under /dev that provide the link between the X server and the hardware device driver (which is in the kernel).

Finally, some X11 clients might require other Unix programs - e.g. xrdb requires cpp to parse its input files. So, you should have installed gcc (preferably version 2.7.0 (or above)), which contains cpp and should have been part of your ELF installation process anyway.

8.3 Putting X11 files into place

Once you have all archives in a place accessible to Linux, you can install them. For the most part, this is simply done by unpacking them from the / (root) directory. If you are "upgrading" from an older X11 distribution, we recommend removing/renaming all old files (or just the entire /usr/X11R6 directory). Mixing old and new files can lead to confusion.

Be sure to backup all config files you modified or added yourself - like /usr/X11R6/lib/X11/Xconfig (which is called XF86Config now and resides in /etc), fvwm init files and the like. This mostly concerns all files under /usr/X11R6/lib/X11/. If you modified or added anything yourself in here, you will have to merge together the new installation with your old files manually.

If you have enough disk space, you could e.g. just rename /usr/X11R6 to /usr/X11R6.not. If you now unpack the new distribution from /, a new /usr/X11R6 will be created so that you could even switch between the two installations simply by swapping their directory names.

Please notice that old binaries (i.e. a.out binaries) also require the corresponding a.out shared libraries. As the ELF installation suggested, you should copy all *.o, *.a, *.so and *.sa files from library directories (including /usr/X11R6/lib, which was not mentioned in the ELF installation README) to /usr/m68k-linuxaout/lib/. Do not delete them - your older X11 clients will most definitely require them.

You do not have to install all fonts again if you already had done so before, but if you are uncertain whether your previous installation of fonts was complete, you may want to just delete it and install the new (and hopefully complete :-) package. By the way, in the new distribution all fonts are stored in compressed format, which reduces the required disk space for them by a couple of MB.

Please also notice that you might have to add other shared libraries in their ELF version. A good example is libXpm which quite a lot of applications require. Check out the FTP servers mentioned in the FAQ for precompiled binaries. Keep in mind: As long as you use the old binaries (a.out), you do not need ELF versions of the required shared libraries. Provided that the old shared libraries are kept under /usr/m68k-linuxaout/lib/, all old binaries will still work. However, in the long term it makes sense to replace all binaries and libraries with their ELF pendants to get rid of the fact that two copies of the same library (namely in a.out and ELF format) are kept in memory at the same time.

Ok, so go for it: Login as root and do:


cd /
tar xzvf <path_to_X11_archives>/X11R6_950911_lib.tar.gz
tar xzvf <path_to_X11_archives>/X11R6_951009_bin.tar.gz
tar xzvf <path_to_X11_archives>/X11R6_950911_man.tar.gz
tar xzvf <path_to_X11_archives>/X11R6_950911_servers.tar.gz
tar xzvf <path_to_X11_archives>/X11R6_950911_fonts.tar.gz
tar xzvf <path_to_X11_archives>/X11R6_950911_include.tar.gz

This already did most of the work for you. All files should have gone into /usr/X11R6/ with the exception of /etc/XF86Config (the XFree configuration file).

Now check if you have a "mouse" device node in /dev:


ls -l /dev/mouse

It should look like this:


crw-r--r--   1 root     wheel     10,   4 Nov 21  1994 /dev/mouse

If it's not yet there, do


cd /dev
mknod mouse c 10 4

Some more entries in /dev are required to allow communication between the X server and the frame buffer driver (which is part of the kernel). You could create these nodes manually or just unpack the X-devices.tar.gz archive:


cd /
tar xzvf <path_to_X11_archives>/X-devices.tar.gz

This will create some special files in /dev that all start with "fb". Don't be confused by the name; these sound very Atari-like, but the name doesn't matter at all. If you don't like them, you are free to rename them as long as you do not modify the major and minor device numbers of these special files.

While we are in /dev: You need a free virtual console for the X display. First there should be at least 8 virtual consoles in /dev, named tty1 to tty8. If they are not there, do:


cd /dev; ./MAKEDEV tty<num>

and do the last line with <num> for all missing numbers between 1 and 8.

Even if you already have 8 virtual consoles, make sure that at least one of them is unused - this means that no gettys should be running on it and no program should currently use it for output (like syslogd). If no console is available when trying to start X, the X server will not be able to come up.

Next step is to create two symbolic links that will make life easier for you:


cd /usr/lib
ln -s /usr/X11R6/lib/X11 X11
cd /usr/include
ln -s /usr/X11R6/include/X11 X11

Ok, we're almost done. To enable the run-time linker to find the X11 shared libraries, put this line into the file /etc/ld.so.conf:


/usr/X11R6/lib

To activate this new search path for shared libraries, refresh the cache file:


ldconfig -v

You should now see that /usr/X11R6/lib and all shared libraries in it are listed by ldconfig.

8.4 The great moment

Well, that's all for the moment. Time for a real test. Log in as an ordinary user and type startx. This should print some lines of informational messages from the Xserver and then switch to a graphic display with the X shaped mouse pointer in the middle of the screen. After some time, some xterm terminal emulators and the twm window manager should start up as initial applications.

To switch back to a text console, you have to type Ctrl-LAlt-Backspace first and can then use LAlt-F<x> to switch to another virtual console. The X display is on the first free console - so, if you have 8 virtual consoles and gettys running on the first 4, the X display will be on virtual console number 5. Typing LAlt-F5 will take you back to the X display.

To shut down X11, close all xterm programs and choose Exit from the first menu of twm (left mouse button with mouse pointer on root window).

8.5 In case of problems

Problems that could appear:

8.6 Fine-tuning

If you have a basic X11 system running, you will want to tailor it to your needs. This might include:


Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter