A note on different versions of the PowerBook G3
This page concentrates first and foremost on the PowerBook G3 Series computers. If you're not quite sure which version you have, follow this link for more information on how to identify your PowerBook. Currently, there are 4 different versions of the PowerBook G3 from Apple. The first (original) PowerBook G3 is significantly different, both in appearance and in hardware, from the PowerBook G3 Series first released in May 1998.
The different models of the PowerBook G3 Series computers use the following video controllers:
A little more information can be found at Apple's Tech Info Library.
*The family number is printed under the PB G3, on the plate opposite the serial number.
**See this page for information on how to get USB and Ethernet working on the Lombard.
What's the difference between LinuxPPC R4 and R5?
The main difference is that R4 is based on the glibc-1.99 libraries, while R5 is based on glibc-2.1. Since glibc-1.99 and 2.1 are incompatible, it means that all system binaries and libraries must be replaced, and that all software must be recompiled and linked against the new libraries. Thus, upgrading from R4 to R5 actually means doing a complete reinstall of LinuxPPC.
Another difference between is of course that R5 comes with a lot more software than R4.
Although it can be a lot of work doing the R4->R5 upgrade, it will probably pay in the long run, as more and more software will depend on glibc-2.1.
Note: Before you insert your LinuxPPC R5 CD into your CDROM drive, you should make sure that the autostart feature of QuickTime is switched off, as the original batch of LinuxPPC R5 CDROMs are infected by the Autostart worm. However, there have been no reports on this worm actually spreading to harddisks from the R5 CDROMs. Read also this announcement from LinuxPPC Inc. for further information.
Although I will primarily refer you to The LinuxPPC Installation and User Guide for instructions on how to install LinuxPPC, I will outline the procedure below, and give some (hopefully) useful hints and comments. Before you start the installation process, you should also check if there have been released any updates that applies to you.
If you have an expansion bay harddisk, it's possible to install LinuxPPC on it. Doug Williams explains how.
In addition to the partitions recommended in the LinuxPPC installation guide, I will recommend that you create a small HFS partition (32 megs, for example) in addition to your primary HFS partition. This partition might come in handy when you're transferring files from Linux to Mac OS. Using this as the only HFS partition writeable from Linux is a good safety measure against file system corruption on your primary Mac OS partition. Personally, I have been burnt by this a couple of times, forcing me to do complete reinstalls of Mac OS. Nowadays, the Linux HFS support seems pretty much reliable, so chances are you will not be affected by this. However, it's better to be on the safe side.
Here's how I have partitioned my 4.8G hard drive, in case you wonder:
Note that the size of my primary Mac OS partition is only 600M. The reason is that I hardly ever use Mac OS, and thus prefer allocating precious disk space to Linux. Also note the strange positioning of the small 32M HFS partition (/dev/hda11); it's squeezed in between the swap space and the home partition. Originally, I had a 128M swap partition, but after experiencing file system corruption on my Mac OS partition due to bugs in the Linux HFS driver, I reduced my swap space to 96M, and squeezed in a 32M HFS partition. I now use this small partition for writing data I need in Mac OS (like new kernels, etc).
[ The following is only valid for LinuxPPC R4: The LinuxPPC R4 installer annoyingly (IMHO, YMMV) sets /usr/local to be a symbolic link to /opt, unless you have created a separate /usr/local partition. If your root and/or /opt partition is small, you might fill up the partition very soon if you compile and install a lot of software in /usr/local yourself. Therefore, it might be a good idea to remove the symbolic link, and put /usr/local on the /usr-partition. If you do this, please be careful in determining exactly what files and directories belong in /opt, and what belongs in /usr/local. This has been fixed in R5; egcs and KDE (and Gnome) are now installed under /usr instead of /opt. ]
Q: I have R4 installed. Do I have to repartition my hard drive to install R5?
A: No. It is perfectly possible to upgrade from R4 to R5 without repartitioning or reformatting your entire hard drive.
If you have enough disk space, it might be a good idea to a trial installation of R5 on a partition where it won't interfere with R4. As for me, I first did a trial installation of R5 on my /home partition, which had enough free disk space. I made sure to not reformat any of the partitions, and let / be mounted on /dev/hda12, which is where my /home lives. I left all my other partitions alone (except the swap space, of course), so R4 would not be affected. Of course, installing R5 on the /home partition makes a lot of mess there, but it's very easy to remove afterwards (just "rm -rf" the R5 directories, taking care not to remove your user directories. Just make sure you back up all your important data first!). Doing it this way, it is a trivial matter to go back to R4 in case things went wrong.
Before installing R5 "for real", it may be a good idea to make a backup copy of your /etc directory on a safe place, as it will be much easier to bring your R5 installation up to where you left your old R4 if you still have access to your old /etc. If you have lots of source code and SRPMs in /usr/local and /usr/src, it might be a good idea to back up these to a safe place as well. I did, and this helped me get back to where I "left" R4 in a relatively short time.
What I ended up doing when replacing R4 with R5, was to reformat only my / and /usr partitions (after having made backup copies of /etc and source code, of course). My /home partition was left as it was under R4, as there was no point in reformatting it.
Which installer to use?
The default installer is X-based, and simplifies the installation process, making it less tedious, compared to the RedHat installer. However, the RedHat installer gives you a much more fine-grained control over the installation, and lets you select or reject individual packages. If you prefer to use the RedHat installer, add redhat to the kernel arguments in BootX.
Problems with the installation of the X server
Unfortunately, Xconfigurator does not seem to work properly on the PowerBook G3 Series, so the generated configure file for XF68_FBDev will not work. Thus, when you reboot, you will get a lot of error messages about gdm "respawning too fast". This is because XF68_FBDev cannot start due to the bogus parameters in /etc/X11/XF86Config, generated by Xconfigurator. To solve this problem, you can for example do the following: When you reboot into Linux, add single to the kernel arguments in BootX. This will drop you into single user mode. Edit the file /etc/inittab, changing the default runlevel from 5 to 3 (change the line that reads "id:5:initdefault:" to "id:3:initdefault:"). Now you can reboot, or just exit the shell to continue the boot process.
Open Firmware is somewhat broken on the PowerBook G3 Series, and this prevents you from booting Linux directly from the internal IDE hard drive. Instead, you have to boot via Mac OS, using BootX. BootX comes in two flavours, an application you start from Mac OS, and a system extension, which is loaded early in the Mac OS boot process.
You can find the latest version of BootX at Benjamin Herrenschmidt's web page.
The kernel arguments
When booting LinuxPPC, you can pass information to the kernel via its command line, giving it information about your hardware, thus tuning it better to your computer, or to modify its default behaviour. Here are some kernel arguments you might want to use:
There are many more kernel parameters one can play with, but the above gets the job done for me.
*I have seen many claims as to which values will work, but mclk:71 works for my PowerBook. It may or may not work on your computer. If you need to use the mclk option, try a few different values (this requires alot of rebooting), but take care not to set it too high, as it might potentially damage your hardware. Also try without the mclk option.
The PowerBook G3 trackpad
Trackpad tappingThe PowerBook G3 trackpad can be used in much the same way under LinuxPPC as under Mac OS, where you can tap the pad with your finger instead of using the mouse button. Some people (including me) love this feature, while others hate it. Under current kernels (2.2.x), tapping is enabled by default, and this annoys the ones who don't want this feature. To disable the trackpad tapping permanently, download this trackpad utility, compile and install the executable, and put the following line in /etc/rc.d/rc.local:
trackpad notapThis will disable tapping when you boot Linux. There are other options to the trackpad tool you can experiment with (notap|tap|drag|lock) if you don't want to disable all tapping, but just the drag and draglock features.
Gpm is a mouse server and cut and paste utility for the virtual consoles. In other words, it lets you use your trackpad when X is not running.
For R5: Gpm should be included by the R5 installer, but if it didn't, you only have to install the package gpm-1.17.5-3.ppc.rpm (or later). You will find it on the R5 CD or at one of the LinuxPPC ftp mirrors.
For R4: To activate GPM during boot, simply insert
gpm -t bmin the file /etc/rc.d/rc.local.
Emulating mouse buttonsSince many X applications require at least 2 mouse buttons, one is presented with a problem when using the PowerBook (or any Mac). How do one represent the other two mouse buttons? The solution here is to let two keys on the keyboard emulate the rest of the mouse buttons. Since I am left-handed, I chose F11 and F12, so I can use the trackpad with my left hand, and press the "mouse buttons" with my right hand. However, you might choose to use other keys for this. You do it like this: Pick two keys that you feel comfortable with using as mouse keys, and make sure that these keys won't remove any important functionality from your keyboard. Then, in a virtual console (do not use X), issue the command "showkey -k", and write down the keycodes you get from the keys you selected. Then reboot, and add the following to the kernel arguments in BootX:
adb_buttons=M,Rwhere M and R are the keycodes for mouse button 2 (middle) and 3 (right), respectively. Now boot Linux. You can now use the two specified keys as mouse buttons, instead of the cumbersome option-2 and option-3, which is the default.
Playing audio CDs
If you don't get any sound when playing audio CDs on your media-bay CDROM player, try the following procedure, which works every time for me.
First check your volume using kmix or xmixer. If it's low, try cranking up the volume. If you don't get any sound, it's probably because you need to change some settings under Mac OS that LinuxPPC use. Try rebooting into Mac OS, and use the control strip to select the media-bay as sound source. Next, turn up the system volume, also using the control strip. 75% or so works fine on my PBG3. Boot LinuxPPC, play a CD, and adjust the volume using kmix or xmixer. You should now get sound throughput from your CD.
Note: Since an audio CD does not contain a file system, you do not "mount" it like you would do with a CDROM. The software CD players, like kscd and its relatives, just tells the CDROM drive to read the audio CD directly. The audio D/A conversion is being done in hardware, on the CDROM drive, and the resulting analog signals are then being routed to the internal loudspeakers or to the line out connector.
Configuring the X serverOn the PowerBook G3 Series, there are two X servers that you might want to use; Xpmac and XF68_FBDev. Xpmac is a PowerMac-specific server running on both LinuxPPC and MkLinux, while XF68_FBDev is a generic X server for the Linux frame buffer device, which will work only for LinuxPPC.
Common for both X servers is that you have to do the following: Let /usr/X11R6/bin/X be a symlink to Xwrapper, and /etc/X11/X be a symlink to /usr/X11R6/your_x_server, like this:
# cd /usr/X11R6/bin # ln -s Xwrapper X # ls -l X lrwxrwxrwx 1 root root 8 Jun 17 15:16 X -> Xwrapper # cd /etc/X11 # ln -s /usr/X11R6/bin/your_x_server # ls -l X lrwxrwxrwx 1 root root 20 Jun 19 20:31 X -> /usr/X11R6/bin/your_x_serverwhere your_x_server is either XF68_FBDev or Xpmac.
If Xpmac is not already installed, you will find the XFree86-Xpmac rpm on the LinuxPPC install CD and on the ftp.linuxppc.org ftp mirrors. Below is a little more information about these two X servers.
XF68_FBDev and the XF86Config fileThe file /etc/X11/XF86Config tells your XFree86 server (in this case, XF68_FBDev; Xpmac does not need this file) details about your video hardware, monitor, keyboard, mouse, fontpath, etc. The Xconfigurator utility is responsible for generating an XF86Config file for you, based on information you feed it, and data it gets from probing the hardware. Unfortunately, as per writing, Xconfigurator just doesn't work very well on the PowerBook G3 Series, and generates an XF86Config file that does not work. Xautoconfig is a utility that is supposed to do a much better job, but not even this is able to generate a working configuration file for my PowerBook G3.
For the above reasons, I made a new XF86Config, based on my old (working) R4 file, where I put the relevant parameters into an otherwise non-working file generated by Xautoconfig. Here is the result - an XF86Config file that works very nicely on my PowerBook G3. Of course, YMMV... :-) To accompany this file, I feed the following kernel arguments to BootX (remember to uncheck the "No video drivers" box):
video=atyfb:vmode:14,cmode:32,mclk:71Read more about the kernel arguments under the "Booting LinuxPPC" part above.
Getting Xpmac up and runningSome people may ask why one should run Xpmac instead of XF68_FBDev. In my case, the reason is simply that Scilab have problems with the 32 bitplane mode offered by XF68_FBDev, while it handles the Xpmac's 24 bitplane mode without problems. Since using 16 bitplanes is not an option, and since the 24 and 32 bitplane modes really are the same, I prefer using Xpmac.
On the PowerBook G3 Series, the atyfb video driver has a tendency to throw "snow" up on the screen, as well as to present a console that is "jumpy" when scrolling. Therefore, I prefer to use the Open Firmware video driver (which is selected when checking the "No video driver" box in BootX), even if this makes the console noticeably slower. The XF68_FBDev X server is not accelerated when using this frame buffer device, so one can use the accelerated Xpmac instead, with options that force acceleration for the ATI RAGE PRO (Mach64) display controller that's in the PowerBook G3 Series. Although this works beautifully under R4, Xpmac strangely enough refuses to cooperate with the OF frame buffer under R5. The problem is that under R5, Xpmac cannot seem to find the RGB database file /usr/X11R6/lib/X11/rgb.txt when one asks it to do accelerated graphics on the OF frame buffer device. Go figure. If you know what causes this problem, or know how to solve or work around it, I will appreciate it greatly if you send me an email.
To get Xpmac up and running, set up the symlinks as described above, and put the following in the .xserverrc file in your home directory:
/usr/X11R6/bin/X -fp "unix/:-1" -mode 14 -depth 24There are many other options you can play with; type "Xpmac -help" in a shell to get a listing, or read the Xpmac manual page. I feed a few extra arguments to Xpmac, in order to set the keyboard repeat rate I want, as well as a mouse button 2/3 emulation that is more according to my own taste. The actual .xserverrc file I use looks like this:
/usr/X11R6/bin/X -fp "unix/:-1" -mode 14 -depth 24 -ar1 400 -ar2 20 \ -middlekey 111 -rightkey 119 -nooptionmouseThis means the following: -ar1 400 -ar2 20 sets the delay before keys start autorepeat to 400 milliseconds, and then they will autorepeat with a rate of 20 characters per second (this is the highest rate available, I think). -middlekey 111 -rightkey 119 sets F11 to be mouse button 2 (middle), and F12 to be mouse button 3 (right). The keycodes for the keys you want to use as mouse keys also has to be specified in the kernel command line. More about this below. -nooptionmouse forces F11 and F12 to act as mouse buttons without me having to press the Option key. To get accelerated graphics using Xpmac when using the OF video driver, one would theoretically just add the option "-mach64 to the other arguments. But as stated above, Xpmac refuses to cooperate as nicely under R5 as it did under R4, so it won't work :-(
If you have really been paying attention, you will see that I specify keycodes 103 and 111 as mouse buttons 2 and 3 in the kernel commandline, while I tell Xpmac to use keycodes 111 and 119. The rule here seems to be that you must add 8 to the keycodes you specify to the kernel before you feed them to Xpmac. I'm not quite sure why this is so. If you can enlighten me, please send me an email explaining the reason.
[ Under R4, the following .xserverrc should work fine when using the OF video driver:
/usr/X11R6/bin/X -mach64 -mode 14 -depth 24 [other command-line arguments]If you use the atyfb driver under R4, just remove -mach64. ]
For more information, read the manual pages for XFree86, XF68_FBDev, Xpmac, XF86Config.
PCMCIA supportIf you want to use PCMCIA-cards on your PowerBook, you need to install some kernel modules and a kernel patch.
The easy way to do it is to download and install the following:
On the other hand, if you want to compile everything by yourself, you have to
PowerBook G3 kernel patchesThe following patches (written by me) are relative to the 2.2.8 kernel from ftp.kernel.org, and make life a little easier when using LinuxPPC on the PowerBook G3:
If you intend to use a PCMCIA modem, you will need this patch from Paul Mackerras. It basically stops the serial driver from probing for serial ports.
The other side of the coin...Of course, Linux isn't perfect. Claiming anything else, and at the same time bashing Microsoft Windows and Mac OS would be a very dishonest thing to do. But then, I've never said that Linux doesn't have any flaws. Limiting myself to LinuxPPC on the PowerBook G3, here are a few things that annoy me: