TuxPPC
TuxPPC
home   |   submit: news, guide,   |   volunteer   |     |  


Sponsored by
Sponsored by PowerMax.com

Buy iMac


News Editions

About iMac

About Linux

Getting Started

Getting Help

User Resources

Advertisement

Distributions

Software Picks






Search

 

Links
  iMacLinux Edition Thursday, 03 July 2003  



Posted by on Friday October 27th, 2000 10:11:29 PM
XFree86 4.01 is the newest version of the X11 Windowing System for Linux. As the XF4 binaries are infrequently updated, this guide explains how to compile and set up XFree86 4.01 on the PowerPC.


Notes

XFree86 4.x is still experimental on the PowerPC, so you should use with care. This is one reason why few binaries exist of this X Server.

For the sake of this Guide, we will do everything inside of the /home/imactest directory, as user imactest. Obviously, replace imactest with your own username.

Getting the Source

First you need to download the full XFree86 source code tree. This will take around 150 MB of disk space, and is a 21 MB download.

You can download it either of these locations:

  • ftp://ftp.xfree86.org/pub/XFree86/4.0.1/source
  • Suggestion: Modem users might want to set this to download overnight (by using cron and wget).

    Once this tarball had downloaded, you need to expand it.

    tar -zxvf X401src-1.tgz

    You will notice that this tarball expands into /home/imactest/xc.

    Updating the Drivers

    The plain XFree86 4.0.1 source tree does not include support for many Macintosh models, and contains slower, more out of date drivers then what is avalible from rsync on penguinppc.org.

    If you don't already have rsync installed, install it. It should be on the CD that came with your distro. Debian users can do apt-get install rsync, Yellow Dog users can do yup install rsync to install over the Internet.

    Once rsync is installed, rsync the latest PowerPC drivers by:

    rsync -avz --delete penguinppc.org::xfree86-pmac /home/imactest/xc/programs/Xserver/hw/xfree86

    This will take a few minutes over a slower connection (it has to update/download a couple 100k of source code).

    When it is done, you need to change a config file, to let XFree86 know about the new drivers you have installed.

    Open up /home/imactest/xfree86/config/cf/xfree86.cf in your favorite text editor.

    Scroll down (or use the search function) to line 493. This line should look like:

                  trident chips fbdev 

    To let XFree86 know about the new drivers, add them to the line:

                  trident chips fbdev ati imstt tdfx r128 

    Building XFree86 4.0.1

    Now you are ready to do the actual building/compiling of the XFree86 4.0.

    This will take an extended period of time (on a fast machine maybe 6 hours), so plan on doing this before you go to bed or before you go out to work or on vacation.

    To build the source code, you need to:

    cd /home/imactest/xfree86
    make World
    # Note the uppercase "W"

    As I said above, it's now a good time to leave XFree86 4.0 alone and let it compile. Check back, the next morning (or this Afternoon if you started it before work).

    Installing XFree86 4.0.1

    In case something doesn't work right in XFree86 4.0, we want to back up XFree86 3.3. Luckly, XFree86 3.3 is an older revision of the X Windowing System called X11R6.3, so it can coexist peacefully.

    Move XFree86 3.3.x to X11R6.3. This will break X for now, but this is okay, as we are upgrading.

    You can do this by:

    su -
    cd /usr
    mv X11R6 X11R6.3
    logout

    Now, XFree86 3.3.x is safe and sound.

    Next, go back to your xfree86 compile directory, and run make install:

    cd /home/imactest/xfree86
    su -
    make install
    logout

    Congratulations. XFree86 4.0.1 is now installed.

    Configuring XFree86 4.0.1

    Chances are, XFree86 won't work out of the box. This is due to differences the XF86Config file, between versions 3.3 and 4.0. This section will help you configure that.

    Many good sample XF86Config files can be found at .

    Find the one that is the closest match to your machine. Download it.

    Backup your old XF86Config file by:

    su
    cd /etc/X11
    mv XF86Config XF86Config.3.3.old

    Copy your new one there:

    cp ~/XF86Config.ati /etc/X11
    mv XF86Config.ati XF86Config
    logout

    There are several items that probably need to be changed.

    Section "Monitor"

    Most important is the "Monitor" section, having wrong values here could damage your monitor or your video card. That said, if your machine is reasonably close to do model in the filename, then you should not have to worry.

    Section "Monitor"
            Identifier   "Monitor0"
            VendorName   "Apple Computer"
            ModelName    "Studio 17"
            HorizSync    30-85
            VertRefresh  48-160
    EndSection

    Dig out your monitor's manual. Check what it recommends for Horizonal Sync Rate and Vertical Refresh Rate. For most monitors, the above values are safe to use.

    The Identifier should be "Monitor0" in most cases, the VendorName and ModelName are not really important, but they should try to reflect your screen type and monitor brand.

    Section "Device"

    The next thing you will probably have to change is the "Device" section, namely the BusID. Having the wrong BusID made lead to a crash, or the error, No Video Card Found.

    To find the BusID, you need to type in:

    cat /proc/pci

    This will produce a message like below, giving info on all PCI devices. You are only interested in the video card, it will most likely be called a "VGA compatible controller: ATI Unknown Device. Below is a sample:

    Bus  0, device  16, function  0:
      VGA compatible controller: ATI Unknown device (rev 0).
      Vendor id=1002. Device id=5245.
      Medium devsel.  Fast back-to-back capable.  IRQ 22.
      Master Capable.  Latency=16.  Min Gnt=8.
      Prefetchable 32 bit memory at 0x84000000 [0x84000008].
      I/O at 0x2000 [0x2001].
      Non-prefetchable 32 bit memory at 0x80a00000 [0x80a00000].
    
    

    The BusID for this card would look like: BusID "PCI:0:16:0"

    You also made need to change the Driver type. You should change it to either "ati" (for ATI Mach64/Rage I,II, etc.) or "r128" (for Rage128 cards). Other drivers exist for other models, for details.

    When you are done, the "Device" section should look like:

    Section "Device"
            ### Available Driver options are:-
            #Option     "NoAccel"
            #Option     "SWcursor"
            Option     "HWcursor"
            #Option     "Dac6Bit"
            #Option     "Dac8Bit"
            Option     "UseFBDev"
            Identifier  "ati"
            Driver      "ati"
            BusID       "PCI:0:16:0"
    EndSection

    Section "InputDevice"

    This section controls the input device.

    If you are using the new input layer or a USB mouse, then Option "Protocol" should be "IMPS/2". If you are using the obsolete, old ADB mouse driver, the Option "Protocol" should be "busmouse".

    The Option "Device" should be your mouse device. If you are using the new input layer, it is "/dev/input/mice". If you are using the obsolote, old USB or ADB mouse driver, the Option "Device" should be either /dev/usbmouse or /dev/adbmouse.

    It should look like:

    Section "InputDevice"
            Identifier  "Mouse0"
            Driver      "mouse"
            Option      "Protocol" "IMPS/2"
            Option      "Device" "/dev/input/mice"
    EndSection

    Section "Screen"

    The screen section controls resolutions that your screen can display, and colors it can use.

    Things to remeber is that the DefaultDepth sets the default depth, the first valid mode listed is the default one, and you can switch between them using command-control-+ or -.

    Also, don't forget Depth is in bits per pixel, and it can be either 1, 4, 8, 16 or 24.

    Section "Screen"
            Identifier "Screen0"
            Device     "ati"
            Monitor    "Monitor0"
            DefaultDepth      24
              SubSection "Display"
                    Depth     24
                    Modes "800x600"
            EndSubSection
            SubSection "Display"
                    Depth     1
                    Modes "1024x768"
            EndSubSection
            SubSection "Display"
                    Depth     4
                    Modes "1024x768"
            EndSubSection
            SubSection "Display"
                    Depth     8
                    Modes "1024x768"
            EndSubSection
            SubSection "Display"
                    Depth     16
                    Modes "1024x768"
            EndSubSection
            SubSection "Display"
                    Depth     24
                    Modes "1024x768"
            EndSubSection
    EndSection

    Starting XFree86 4.0.1

    Once XF86Config is all setup, it's time to startx and test out XFree86 4.0.1.

    If all goes well, a bunch of messages will zoom across the screen, and X will start. The most noticable change about XFree86 4.0 is the speed, you will notice that almost instantly.

    Problem Shooting

    Most problems are caused by messed up XF86Configs. Here are common problems.

    No Valid Modes Found - Go to the "Screen" section, and enter in a resolution and depth that your video card supports.

    Video Card Not Found - Go to the "Device" section, and check to make sure the BusID is correct (see the instructions above). Finally, XFree86 4.0 is incompatible with NoVideo driver option (aka offb video driver). You must use a real framebuffer video driver (such as atyfb).

    Default Font 'Fixed' Not Found - Try commenting out (putting a hash in front of) some of the FontPath in XF86Config, such as "unix/:-1". At minimum you need to have these lines uncommented:

        FontPath    "/usr/X11R6/lib/X11/fonts/local/"
        FontPath    "/usr/X11R6/lib/X11/fonts/misc/"
        FontPath    "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"

    References:

  • Thanks to Ani Joshi for his great work on XFree86 4 on the PowerPC, and all of the other XFree86 hackers.

    Send suggestions and comments to .

Search for imaclinux

The Fine Print: The following comments are owned by whoever posted them.
(Reply)

by on Wednesday December 27th, 2000 08:09:20 PM
I just spent some time trying to get this to work before I realised there's an error in the rsync line to get the updated drivers. It should read: rsync -avz --delete penguinppc.org::xfree86-pmac /home/imactest/xc/programs/Xserver/hw/xfree86 By the way, does anyone know what the monitor settings should be in XF86Config for a standard iMac (1999 vintage) R
by on Sunday January 07th, 2001 10:31:44 PM
I've fixed that, as of today.

  Legal and Privacy Notices Copyright © 2001