Online Book Reader

Home Category

Running Linux, 5th Edition - Matthias Kalle Dalheimer [329]

By Root 1377 0
did not work, it would say direct rendering: No instead.

Altering xorg.conf . To get started using DRI, a couple of lines need to be added to the xorg.conf file shown earlier in this chapter:

Section "Module"

...

# This loads the GLX module

Load "glx"

# This loads the DRI module

Load "dri"

EndSection

...

Section "DRI"

Mode 0666

EndSection

The Load statements take care of loading the modules required for OpenGL into the X server, and the Mode statement in the DRI section sets the file permission of the character special file that applications use to communicate with the DRM kernel driver. The special file is /dev/dri/cardN. Setting the permissions to 0666 allows all users with access to the X display to use hardware-accelerated OpenGL.

Mesa

Mesa is a 3D graphics library with an API very similar to that of OpenGL. The core Mesa library is licensed according to the terms of the X.org copyright (an MIT-style license). Mesa is included with X.org together with the DRI framework, but if you want to use OpenGL on a platform not supported by DRI or want to get started with OpenGL programming, installing your own copy of Mesa can be a good idea—if not for anything else, then for getting the source code for the example programs.

Installing Mesa. If, for some reason, you want to compile Mesa yourself, it is a simple matter of downloading the latest MesaLib (along with MesaDemos) from http://www.mesa3d.org/, unpacking it, and compiling it. The current version of Mesa does not use GNU autoconf; instead it comes with a Makefile that contains targets for a large number of operating systems and hardware combinations:

$ tar xfj MesaLib-6.2.1.tar.bz2

$ tar xfj MesaDemos-6.2.1.tar.bz2

$ cd Mesa-6.2.1

$ make Will write a list of supported build targets

$ make linux-x86We choose Linux/x86

When the build is complete, run some of the demos to check that everything works:

$ cd lib

$ export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH

$ cd ../progs/demos

$./gears

If the demo application worked, install Mesa like this:

$ cd ../../

$ cp -r include/GL /usr/local/mesa/include Install header files

$ cp -d lib/* /usr/local/mesa/libInstall libs

Hiding the headers and libraries away in /usr/local/mesa allows you to easily switch between the system-provided OpenGL and Mesa by setting LD_LIBRARY_PATH to include or exclude /usr/local/mesa/lib.

Chapter 17. System Start and Shutdown

Booting the System

There are several ways of booting Linux on your system. The most common methods involve booting from the hard drive or using a boot floppy . In many cases, the installation procedure will have configured one or both of these for you; in any case, it's important to understand how to configure booting for yourself.

Using a Boot Floppy

Traditionally, a Linux boot floppy simply contains a kernel image, which is loaded into memory when you insert the floppy and start the system.[*]

Many Linux distributions create a boot floppy for you in this way when installing the system. Using a boot floppy is an easy way to boot Linux if you don't want to bother booting from the hard drive. (For example, Windows NT/2000/XP's boot manager is somewhat difficult to configure for booting Linux. We talk about this in the next section.) Once the kernel has booted from the floppy, you are free to use the floppy drive for other purposes.

We include some technical information here in order to explain the boot process, but rest assured that in most cases, you can just insert the floppy disk, and booting works. Reading the following paragraphs will help you understand your system, though.

The kernel image is usually compressed, using the same algorithm as the gzip or the bzip2 compression programs (more on this in "Compiling the kernel" in Chapter 18). Compression allows the kernel, which may be several megabytes or more in size, to require only a few hundred kilobytes of disk space. Part of the kernel code is not compressed: this part contains the routines necessary to uncompress the kernel from the disk image and load it

Return Main Page Previous Page Next Page

®Online Book Reader