Getting X to work on a iBook G4 1.2Ghz

Stephen Harker yellowdog-general@lists.terrasoftsolutions.com
Thu, 09 Sep 2004 08:40:29 +1000


On Wed, Sep 08, 2004 at 09:30:09AM -0500, Andrew Zschetzsche wrote:
> I just got done building from source XFree86 4.4.0.  When I run that, the
> screen appears, but it is all cracked and streaked from left to right.  A
> red X appears as the mouse cursor.  I can't ctrl-opt-F2 to get back to
> another terminal.

We did try XFree86 4.4.0 and it worked okay also.  What kernel version
do you have?  We put 2.6.7 on Stewart's machine.

As an attempt to summarise the steps that worked for Stewart's iBook
G4 (Radeon 92000 M9+ 5c63) see the following:

1) We downloaded the source for the kernel 2.6.7, made and installed
it on Stewart's machine.  Doing a `strings /boot/vmlinux-2.6.7 | grep
-i radeon' showed, amongst others, a string something like `5c63
Radeon Mobility M9+.  After booting into this kernel `cat /proc/pci'
showed the video card correctly identified, though `lspci' still
showed it as unidentified.  See sites such as
http://www.linux-sxs.org/upgrading/migration.html for information on
changing the initialisation scripts to work correctly with 2.6 series
kernels.  This site has some good links.  We followed the suggestions
in this site and links.

2) I downloaded xorg-x11-6.7.0-5.src.rpm from Fedora 2.  To make it we
also needed freetype-2.1.4-5.src.rpm since it needs a later version of
freetype than that which accompanies YDL 3.0/3.0.1 (strictly it
requires 2.1.7 or later, but I did not find that on the local (Monash)
mirror and 2.1.4 seems to be used by the maintainer, so I just
modified the spec file).  As xterm no longer seems to come in the
archive I also downloaded xterm-179-5.src.rpm from fedora 2.

These all made quite happily, creating a raft of ppc.rpm files.  To
install them required doing a `rpm -qa | grep xfree' to find which
rpm's were installed, then doing a `rpm -Uvh -nodeps ' followed by an  
appropriate list of new ppc.rpm's.  The -nodeps was because a range of
items have XFree86 hard coded for the Xserver.  There are some things
that then need doing if the new Xserver worked.

3) I edited the yaboot.conf to include a stanza:

image=/boot/vmlinux-2.6.7
	label=2.6.7
	root=/dev/hda12
	read-only
	initrd=/boot/initrd-2.6.7.img
        append="video=radeonfb"

The accelerated X11 worked with either XFree86 4.4 and with Xorg's X11
(6.7.0-5).  I had to hand edit both the XF86Config and/or xorg.conf
file to get it to work fully.  I append the xorg.conf used to this
email.  Using DRI glxgears in the default small window gave around
1400 fps for 16 bit and around 750 fps for 24bit.

Here is the xorg.conf from /etc/X11

# File generated by Xautoconfig.
Section "ServerLayout"
	Identifier	"XFree86 Configured"
	Screen		0  "Screen0" 0 0
	InputDevice	"Mouse0" "CorePointer"
	InputDevice	"Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
# RgbPath is the location of the RGB database.  Note, this is the name of the
# file minus the extension (like ".txt" or ".db").  There is normally
# no need to change the default.

# Multiple FontPath entries are allowed (they are concatenated together)
# By default, Red Hat 6.0 and later now use a font server independent of
# the X server to render fonts.

       RgbPath      "/usr/X11R6/lib/X11/rgb"
       FontPath     "unix/:7100"
       FontPath	    "/usr/X11R6/lib/X11/fonts/misc:unscaled"
       FontPath     "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
       FontPath     "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
       FontPath     "/usr/X11R6/lib/X11/fonts/misc"
       #FontPath     "/usr/X11R6/lib/X11/fonts/cyrillic"
       FontPath     "/usr/X11R6/lib/X11/fonts/Type1"
       FontPath     "/usr/X11R6/lib/X11/fonts/Speedo"
       FontPath     "/usr/X11R6/lib/X11/fonts/75dpi"
       FontPath     "/usr/X11R6/lib/X11/fonts/100dpi"
       FontPath     "/usr/X11R6/lib/X11/fonts/truetype"
       #FontPath     "/usr/share/fonts/default/Truetype"
       FontPath     "/usr/share/fonts/default/Type1"
EndSection

Section "Module"
	Load    "GLcore"
	Load	"dbe"
	Load	"extmod"
	Load	"fbdevhw"
	Load	"glx"
	Load	"record"
	Load    "bitmap"
	Load	"freetype"
	Load	"type1"
	Load    "speedo"
	#Load    "vbe"
	Load	"dri"
EndSection

Section "InputDevice"
	Identifier	"Keyboard0"
	Driver		"keyboard"
# Change "XkbModel" to "macintosh_old" if you are using
# the deprecated adb keycodes.

	Option		"XkbModel"	"macintosh"
	Option		"XkbLayout"	"us"
EndSection

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

Section "Monitor"
	Identifier	"Monitor0"
	UseModes	"Modes0"
	ModelName	"Monitor Model"
	Option		"DPMS"
	HorizSync	40-70
	VertRefresh	60

EndSection

Section "Modes"
	Identifier "Modes0"

	# Generated
	# D: 65.003 MHz, H:  48.365 kHz, V: 60.006 Hz
	Modeline "1024x768" 65.003 1024 1048 1184 1344   768 771 777 806  -HSync -VSync
EndSection

Section "Device"
	Identifier	"Card0"
	#Option	"ShadowFB"	"true"
	Option	"fbdev"	"/dev/fb0"
	#Driver	"fbdev"
	Driver  "radeon"
	Option  "UseFBDev"  "on"
	Option  "fbdev" "/dev/fb0"
	#BusID	"0:0:0"
EndSection

Section "Screen"
	Identifier	"Screen0"
	Device		"Card0"
	Monitor		"Monitor0"
	DefaultDepth	16
	SubSection "Display"
		Depth		8
		Modes 		"1024x768"
		ViewPort 0 0
		Virtual 1024 768
	EndSubSection
	SubSection "Display"
		Depth		16
		Modes 		"1024x768"
		ViewPort 0 0
		Virtual 1024 768
	EndSubSection
	SubSection "Display"
		Depth		24
		Modes 		"1024x768"
		ViewPort 0 0
		Virtual 1024 768
	EndSubSection
EndSection

Section "DRI"
	Group 0
	Mode 0666
EndSection

-- 
Stephen Harker                           Stephen.Harker@spme.monash.edu.au
School of Physics & Materials Engineering
Monash University