In 2015, Debian Jessie was released, and PowerPC users, specially those using the third-generation devices, were left with very broken systems. One of the numerous bugs of the new Debian release was particularly serious: Those with G3 machines rocking ATI Radeon GPUs found that running a graphical environment on their computers was now impossible. After a Xorg installation, they found their screens freezing, flickering or simply unable to display anything other than a black screen. In order to have a usable desktop, they had to stick with the fbdev driver, which used the framebuffer to draw windows, and didn't even have 2D acceleration. This made scrolling or dragging windows laggy, and watching videos impossible.
As 32-bit PowerPC turned into a de facto dead architecture, Debian dropped support for any release newer than Jessie, and the owners of the then 13-year-old machines were left with what turned out to be a very beautiful paperweight.
Today, 18 years after the release of the iBook Dual USB, multiple hardware vulnerabilities like the much-commented Spectre and Meltdown have made a return to these old and trusty machines a necessity for some. This short guide will describe a simple fix to make this hardware operational with modern software again. It is not a particularly elegant fix, but, as of 2019, it is the only existing solution.
What happened
Some years ago, Linux developers agreed on a new way to make machines set display resolution and depth. In the old days, a userland process was used for the task. This was what is known as Userspace Mode Setting, or UMS. For various technical reasons, this task was handed over to the kernel, in what is known as Kernel Mode Setting, or KMS. But what was supposed to be an improvement turned into a liability for PowerPC users. Since the new way of handling graphics was never properly tested in our old PowerPC machines, it turned out to be so buggy that it made running a graphical environment painful, or plainly impossible. KMS broke suspension, and made most G3 users unable to get anything more than a black screen with the Radeon driver. Unfortunately, UMS support was dropped from both Xorg and the Radeon driver shortly afterwards. This was the kiss of death for these machines, since a small community of developers didn't have the time or the resources to fix it, and it was also the reason why using anything newer than Wheezy was a painful experience. Newer releases of OpenBSD also ditched UMS for KMS, with the same bugs creeping into them.
How to fix it
Determined to make my beloved iBook work again, I spent a couple of months looking for a solution. It turned out to be pretty simple. What needs to be done is simply a "reverse backport" of the Wheezy Xorg packages into a Debian Sid installation, coupled with an installation of the 4.4 version of the Linux kernel, the last Linux version with UMS support as a compile-time option. This kernel will be supported until 2022, so it will give an additional two years of life to our hardware.
As said before, this is not an elegant solution. It is also not a very secure one. Since the Wheezy end of life in 2016, multiple vulnerabilities have been patched in the various Xorg packages. In our computers, those vulnerabilities will remain unpatched forever. But a good dose of common sense and the avoidance of untrusted applications might make this irrelevant. So let's fix our machines.
For the sake of simplicity, let's suppose that you have just finished a vanilla installation of Sid with the base system utilities as specified in the MacRumors installation tutorial. If you have already installed xorg, and other graphical applications, window managers or desktop environments, you should uninstall them, and all their dependencies, before starting.
First of all, we will install the non-free firmware required by our Radeon cards:
Code:
$ sudo apt install firmware-linux-nonfree
After the firmware has been installed, we will install the Wheezy version of Xorg. For that, we need to edit our sources.list file:
Code:
$ sudo apt edit-sources
And, after choosing an editor, add this line to the bottom of the file to enable the Wheezy repository:
Code:
deb http://archive.debian.org/debian/ wheezy main
Then, we will update our system:
Code:
$ sudo apt update
Now, it's time to install Xorg. In order to avoid breakage, we need to modify the libaudit-common package so that it doesn't conflict with libaudit0, which will be needed later. We can do this by downloading and unpacking it:
Code:
$ mkdir tmp
$ apt download libaudit-common
$ dpkg-deb -R libaudit-common* tmp
$ nano tmp/DEBIAN/control
On the file you have just opened, remove all references to libaudit0 and replace the version number for a higher one in "Version". Then save by hitting Ctrl + X and Ctrl + Y.
An identical /etc/libaudit.conf file is also provided by libaudit0. We will remove it from libaudit-common to avoid an error during installation:
Code:
$ rm -rf tmp/etc
$ rm tmp/DEBIAN/conffiles
Now, we just need to repack libaudit-common and install it in our system:
Code:
$ dpkg-deb -b tmp libaudit-common_custom.deb
$ sudo dpkg -i libaudit-common_custom.deb
Now we will install Xorg from the Wheezy repos:
Code:
$ sudo apt -t wheezy install xorg xserver-xorg xserver-xorg-core xserver-xorg-video-all xserver-xorg-input-all xserver-xorg-input-evdev libaudit0
And, to stop apt from upgrading the packages, pin their priorities down to -1:
Code:
$ sudo nano /etc/apt/preferences.d/pin.pref
You are creating a new file whose content should be the following:
Code:
package: *xorg*
pin: version *
pin-priority: -1
package: libaudit*
pin: version *
pin-priority: -1
package: libfs6
pin: version *
pin-priority: -1
package: libglu1-mesa
pin: version *
pin-priority: -1
package: libmtdev1
pin: version *
pin-priority: -1
package: libpciaccess0
pin: version *
pin-priority: -1
package: libxkbfile1
pin: version *
pin-priority: -1
package: multiarch-support
pin: version *
pin-priority: -1
package: x11*
pin: version *
pin-priority: -1
package: xfonts*
pin: version *
pin-priority: -1
package: xinit
pin: version *
pin-priority: -1
package: xserver*
pin: version *
pin-priority: -1
Verify that the packages are now pinned:
Code:
$ apt policy
Our graphical interface is now installed. But if you start X, you will notice psychedelic colors, and the same freezes and lockups as before. This is because UMS support has also been dropped from the most recent Linux kernels. In order to end our thankless job, we will need to install an older kernel.
Installing the kernel
Shortly after userspace code stopped supporting UMS, the Linux kernel developers decided to follow suit, and made the KMS interface the default in the Radeon kernel driver. Fortunately, for those using an older version of the xf86-video-ati driver (like us) they introduced a new compile-time kernel option to reenable UMS. This option stayed in the kernel from version 3.9 to version 4.4, the last version with UMS support. Since 4.4 will be supported until February 2022, it is the kernel we will install in our machines.
In order to make this easier, I have uploaded a precompiled version of the kernel. Building the kernel from source is a very straightforward process, but it takes time (roughly twelve hours on an 800 MHz G3). In any case, you will find some tips on how to achieve a successful build below.
To get your system up and running, download the tarball found in this link and place it in your root directory. Then, extract it with the following command:
Code:
$ sudo tar xvfk linux-4.4.182custom.tar
This will place the kernel and its modules under /boot and /lib/modules. Now, you will need to create an initramfs:
Code:
$ sudo update-initramfs -c -k 4.4.182custom
In order to be able to boot from this kernel, you will need to update your bootloader configuration. If using yaboot, this can be done by editing the /etc/yaboot.conf file. If using grub, a simple "sudo update-grub" should suffice.
Reboot and choose the 4.4 kernel in the bootloader menu. Congratulations! Your system is up and running. After years of agony, your G3 can be used comfortably again.
Building the kernel
If you prefer to avoid running a binary from a stranger, or want to be able to tweak the system to your liking, you might want to manually compile the kernel. For unknown reasons, the current Sid version of binutils does not pair well with this process and, after hours and hours of compilation on a Debian Sid system, you will be greeted by a misterious and infuriating linking error. An Adélie Linux live USB or a Jessie installation is recommended. You could also download a Gentoo stage 3 tarball, extract it, and chroot into it. It comes with everything necessary to build a kernel installed by default.
The current 4.4 kernel source can be grabbed from The Linux Kernel Archives. After downloading and extracting the source, you will need to install the required dependencies. On Adélie Linux:
Code:
# apk add build-tools ncurses-dev bison flex libssl-dev libelf-dev bc
On Debian Jessie:
Code:
# apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev
You will need a config file. If you installed the precompiled kernel, it can be found under /boot. Copy it to your kernel source directory, renamed as .config:
Code:
$ cp /boot/config-4.4.182custom [your source folder location]/.config
You are now ready to compile the kernel. Place yourself in the source folder. In order to add or remove options before compilation, run "make menuconfig", and a nice graphical menu will pop up. Otherwise, just run:
Code:
$ make
Wait until the compilation ends. Depending on your processor speed, it can take up to a full day. If everything goes well, and no errors appear, install the kernel and its modules:
Code:
$ sudo make modules_install
$ sudo make install
Create an initramfs, update your bootloader configuration and reboot.
Optimizing Xorg
After successfully following this guide, you might still find the performance of your machine to be poor. In that case, it might be useful to tweak your Xorg configuration.
In the good old days, the X server configuration was stored in a single file, /etc/X11/xorg.conf. Today, the configuration of Xorg is modular and more convenient, with different configuration files stored in /usr/share/X11/xorg.conf.d. But first we need to know which settings are currently being used by the system. Before starting X, switch to the root account and type:
Code:
# Xorg -configure
A new xorg.conf.new file will be created in the current directory. Open it and feel free to take a look. These are the default settings on your machine. After that, it will be useful to create a new file with your Radeon configuration. Look for a section similar to this:
Code:
...
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option "NoAccel" # [<bool>]
#Option "SWcursor" # [<bool>]
#Option "Dac6Bit" # [<bool>]
#Option "Dac8Bit" # [<bool>]
#Option "BusType" # [<str>]
#Option "CPPIOMode" # [<bool>]
#Option "CPusecTimeout" # <i>
#Option "AGPMode" # <i>
#Option "AGPFastWrite" # [<bool>]
#Option "AGPSize" # <i>
#Option "GARTSize" # <i>
#Option "RingSize" # <i>
#Option "BufferSize" # <i>
#Option "EnableDepthMoves" # [<bool>]
#Option "EnablePageFlip" # [<bool>]
#Option "NoBackBuffer" # [<bool>]
#Option "DMAForXv" # [<bool>]
#Option "FBTexPercent" # <i>
#Option "DepthBits" # <i>
#Option "PCIAPERSize" # <i>
#Option "AccelDFS" # [<bool>]
#Option "IgnoreEDID" # [<bool>]
#Option "CustomEDID" # [<str>]
#Option "DisplayPriority" # [<str>]
#Option "PanelSize" # [<str>]
#Option "ForceMinDotClock" # <freq>
#Option "ColorTiling" # [<bool>]
#Option "VideoKey" # <i>
#Option "RageTheatreCrystal" # <i>
#Option "RageTheatreTunerPort" # <i>
#Option "RageTheatreCompositePort" # <i>
#Option "RageTheatreSVideoPort" # <i>
#Option "TunerType" # <i>
#Option "RageTheatreMicrocPath" # <str>
#Option "RageTheatreMicrocType" # <str>
#Option "ScalerWidth" # <i>
#Option "RenderAccel" # [<bool>]
#Option "SubPixelOrder" # [<str>]
#Option "ClockGating" # [<bool>]
#Option "VGAAccess" # [<bool>]
#Option "ReverseDDC" # [<bool>]
#Option "LVDSProbePLL" # [<bool>]
#Option "AccelMethod" # <str>
#Option "DRI" # [<bool>]
#Option "ConnectorTable" # <str>
#Option "DefaultConnectorTable" # [<bool>]
#Option "DefaultTMDSPLL" # [<bool>]
#Option "MacModel" # <str>
#Option "TVDACLoadDetect" # [<bool>]
#Option "ForceTVOut" # [<bool>]
#Option "TVStandard" # <str>
#Option "IgnoreLidStatus" # [<bool>]
#Option "DefaultTVDACAdj" # [<bool>]
#Option "Int10" # [<bool>]
#Option "EXAVSync" # [<bool>]
#Option "ATOMTVOut" # [<bool>]
#Option "R4xxATOM" # [<bool>]
#Option "ForceLowPowerMode" # [<bool>]
#Option "DynamicPM" # [<bool>]
#Option "NewPLL" # [<bool>]
#Option "ZaphodHeads" # <str>
Identifier "Card0"
Driver "radeon"
BusID "PCI:0:16:0"
EndSection
...
This is the section that controls your Radeon configuration. Create a new file under /usr/share/X11/xorg.conf.d:
Code:
# nano /usr/share/X11/xorg.conf.d/00-radeon.conf
And then copy your Radeon configuration into it. As you can see, all the available options for your video card are listed there. You might want to tinker with them until you find the options that work best for you. The radeon(4) man page:
Code:
$ man radeon
Will tell you everything you need to know about each option. This is what I have found to work best on an ATI Mobility Radeon 7500, and you may want to use it on any similar GPUs:
Code:
Section "Device"
Identifier "Card0"
Driver "radeon"
Option "AGPFastWrite" "true"
Option "EnablePageFlip" "True"
Option "UseInternalAGPGART" "no"
Option "backingstore" "true"
Option "AllowGLXWithComposite" "true"
EndSection
Changing your card's AGP-speed might also make your machine run a bit faster. This can be done at boot time, with the "radeon.agpmode" kernel parameter. Different cards have a different maximum speed. In my case, the maximum speed is 4. In order to change the AGPmode to 4, you only need to specify it at the yaboot boot prompt:
Code:
Linux radeon.agpmode=4
But, in my case, this has no noticeable effect. Please note that trying to specifiy the AGP-speed with the "AGPMode" option in your Radeon configuration file can make Xorg hang for unknown reasons. So the only safe way to do this right now is via a kernel parameter.
A noticeable speed improvement can be achieved by reducing the color depth from 24 to 16-bit. This will reduce the number of colors displayed on your screen, and, although it will not be a very visible change, it might make some graphics (specially gradients) look a bit uglier. In return, you will get faster scrolling on apps like Arctic Fox, and the graphical interface will feel less sluggish.
To change your color depth, create another configuration file:
Code:
# nano /usr/share/X11/xorg.conf.d/00-screens.conf
And copy all the "Screen" sections from xorg.conf.new (usually only one, but possibly two or more), adding "DefaultDepth 16" below the start:
Code:
...
Section "Screen"
DefaultDepth 16 # (Add this)
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection
...
Suspend issues
Suspension should work out of the box. If it doesn't, it might be useful to add "HandleLidSwitch=suspend" to /etc/systemd/logind.conf and reboot:
Code:
# cat "HandleLidSwitch=suspend" >> /etc/systemd/logind.conf
# reboot
After waking up from suspend, it might be the case that sound has stopped working. If that is happening, it can be easily fixed by reloading the sound driver.
First, we need to know which sound driver is currently loaded:
Code:
$ lsmod | grep '^snd' | column -t
The output of this command will be something similar to this:
Code:
snd_powermac 73874 0
snd_pcm 115223 1 snd_powermac
snd_timer 26912 1 snd_pcm
In this case, the module we need to reload is "snd_powermac". In order to automatically reload it everytime the computer wakes up, we can create a systemd script for it:
Code:
$ sudo nano /usr/lib/systemd/system-sleep/00restart_sound
The contents of the script are very simple:
Code:
#!/bin/sh
# unload sound module
rmmod -f snd_powermac &&
# reload sound module
modprobe snd_powermac
If using pulseaudio, it could be necessary to kill the pulseaudio daemon, reload the module and restart pulseaudio:
Code:
#!/bin/sh
pulseaudio --kill &&
rmmod -f snd_powermac &&
modprobe snd_powermac &&
pulseaudio --start
Mark the script as executable:
Code:
$ sudo chmod +x /usr/lib/systemd/system-sleep/00restart_sound
Sound should be working the next time you suspend your machine.
Some notes
According to the internet, non-KMS Radeon systems are unable to get 3D acceleration working. This is currently true and, after following this guide, the graphics will be usable, but slow. In order to verify that you don't have 3D acceleration, install mesa-utils:
Code:
$ sudo apt install mesa-utils
Then, take a look at the output of this command:
Code:
$ LIBGL_DEBUG=verbose glxinfo | grep render
If you see "OpenGL renderer string: Software Rasterizer" or "libGL error: failed to load driver: ...", you're not getting 3D acceleration, only 2D acceleration. For 3D, you'd see something like, "OpenGL renderer string: Gallium 0.4 on ATI RV350". But that will not happen. This guide is a work in progress, and we are currently struggling to find a way to get 3D accelerated graphics. If you are interested in what we are doing, you can follow our conversation in this thread. If 3D acceleration is vital to you, you can install Debian Wheezy with the userland DRI packages following these instructions.
If you want to start your Xorg session via a login manager, avoid Lightdm at all costs. It is buggy and can cause graphical glitches.
The Debian system built following this guide's steps is, effectively, a FrankenDebian combining elements from Wheezy and Sid. This means that things might eventually break. An installed package might require a newer version of the packages we pinned. That would make it impossible to install that application without further tweaking. It is up to you, as the system mantainer, to ensure that everything is working after any new update or installation. If something really breaks, it is highly probable that more than one of us will be experiencing the same problem, so this thread can be useful as a first resource.
Last edited: