Linux on PowerMac G4 350
Introduction
In this small document I will try to describe how I installed and configured Linux on my brand new G4.
Please note that I'm not a MacOS expert and I had never used this system before (oh yes, ok... once but I got sooo
frustrated when I had to drag my floppy to the bin to eject it that I had never tried again...).
As strange as it sounds, I bought this machine only to run Linux on it (because it reallyshines and a computer is a
terrible thing to waste). So maybe my config will seem strange to most Mac users (especially the keyboard mapping).
If you have any suggestion, any comment, I'll be really happy to hear from you.
Used configuration
| System | PowerMac G4 (7400)/350MHz, 1Mb L2 cache, 128Mb RAM |
| Video | ATI Rage128 PCI video card |
| Disk | IDE QUANTUM FIREBALL CX10.2A, 9787MB w/418kB Cache |
| CD-ROM | ATAPI (IDE) MATSHITA CR-589 |
| Keyboard | french(!) integrated kbd (will try a QWERTY Macally soon) |
| Mouse | Logitech wheel mouse M-BB48 |
| Modem | integrated ATI="56000" ATI1="APPLE VERSION 0013-2,11/24/1998" ATI3="V2.200-V90_2M_DLS" ATI4="Apple Internal Modem" ATI6="RCV56DPF-PLL L8571A Rev 29.00/29.00" |
How to install (in fact, how I did the install...)
The install process
Generic install process is very clearly documented by
LinuxPPC
Follow the directions concerning the Blue G3.
I did the install through the network from my laptop because my CD-ROM was a standard ISO one (ie not HFS).
I only tried LinuxPPC (no YDL,...) as I were fully satisfied.
After the install, the system is VERY unstable (mine managed to boot once on every 3 tries...). Pray hard
and use the 2.2.6 install kernel to change the console keymap BEFORE switching to 2.2.15.
Of course, DO NOT try to get a graphical login yet, we'll see later (you should do the install in text mode,
too).
The MacOS 9 disk annoyance
When upgrading to MacOS 9, the install program will automatically update the driver on your disk, making it
unusable under Linux :(
The solution is to manually re-install the MacOS 8.6 driver after the MacOS 9 install: boot on the MacOS 8.6 CD
(by hitting the 'C' key while rebooting) and then launch the 'Disk tools' ('Outils disque dur' in French) from
the 'Utilities' ('Utilitaires') folder on the 8.6 CD-ROM; then use the 'Update' ('Mise à jour') command
in the 'Functions' ('Fonctions') menu to update your disk with the 8.6 drivers.
See http://www.linuxppc.com/news/macos9/ for more information.
How to boot
MacOS with BootX
I currently use BootX extension 1.1.3 with the following settings:

Booting using the BootX app does not seem to work very well...
Open Firmware and yaboot
To boot using the Open Firmware (OF), you will need
- an HFS boot partition; in my case, this partition is hda5
This partition can contain only the boot loader (yaboot), its config file (yaboot.conf) and the kernel you want to use (vmlinux). No need for MacOS here
- a boot loader; I use yaboot with the following config
- a kernel; I use this one (2.2.15pre6) with the corresponding modules and System.map
You then have two options
- let OF/MacOS handle your display configuration
Just add the novideo option in your yaboot.conf file
Please note that X11 will then probably be stuck to a 8-bit (256 colours) mode, vmode being completely useless
- use vmode under Linux to set it correctly
Just let the yaboot.conf file as it is (i.e., without the novideo option). This will give you the default graphical resolution, i.e. 1024x768x256@60Hz
You can use vmode to switch to the correct resolution before launching X11; in my case, I have a
/sbin/vmode 20 16
line in my /etc/rc.d/rc.sysinit which set my G4 to 1280x1024x65536@75Hz
Configuration
Keyboard
The keyboard is a big issue because the keymap has been changed beetween the 2.2.6 kernel (the kernel we used
for the install) and the 2.2.15pre3 kernel (the most stable one at the time of this writing).
These keymaps are far from complete, for example they lack many chars one would find on a US keyboard (like
brackets, curly brackets, bar, tilda, etc...). As I don't know how to produce these characters on a Mac
running MacOS, I haven't mapped them. I you have any information, please feel free to
e-mail me.
Console
My /etc/sysconfig/keyboard file and the corresponding
/usr/lib/kbd/keymaps/mac/imac-fr.kmap. Be aware that these are
French mappings.
You can use showkey -k as an help to do you own mapping.
X11
You can use Xmodmap to change your keyboard mapping. I do it in
/etc/X11/gdm/Init/Default. This script expects the
Xmodmap file to be in /etc/X11/xinit/.Xmodmap
Graphics (X11)
Here you have to choice to use either the XFree FBDev X-server (not accelerated) or the Xpmac X-server
(2D-accelerated) with USB support hacked by Kevin Hendricks.
I would strongly suggest you go for the
Xpmac accelerated server. Follow the directions in the
readme file, it's very easy to install and to configure (no config file is needed, forget
about the /etc/X11/XF86Config mess).
Mouse
The 3 buttons of my Logitech mouse work fine. I'm currently working on the Xpmac server to add the wheel
support...
Sound
Kernel
The dmasound.o module bundled with kernel 2.2.15pre3 works fine.
You can add a /sbin/modprobe dmasound in your /etc/rc.d/rc.local for example to have it
loaded automatically.
E-Sound
Unfortunately the version I had (0.2.15) has a problem with byte-ordering; it transforms every sound into a
terrible noise ;-(
I recompiled the 0.2.17 version and it fixed the problem
(esound-0.2.17-1.ppc.rpm,
esound-devel-0.2.17-1.ppc.rpm).
Modem
The internal modem is basicaly a 56K Rockwell modem.
The init string I use is AT&F&C1&D2&Q6W2 (please tell me if yours works better...)
I haven't found a way to enable the sound for the modem so you won't hear it dialing...
Tips
Kernel parameters
My G4 hangs on boot if I don't set the hda=noautotune parameter.
The 'no graphic driver' checkbox allows you to use the same video resolution in MacOS and Linux (w/ the Xpmac server)
Mac-On-Linux (MoL)
MoL is a terrific application which allows you to completely "virtualise" your computer to run a guest operating
system with nearly native performance (perfect if you have MacOS apps you don't want to 'scrap' when switching to
Linux). A similar tool exists for PCs running Linux or NT (even if I wouldn't recommend this solution):
VMWare (please note that it is a commercial product).
I've currently successfuly tested MacOS 9 and Linux.
- My config file (copy it in /etc/molrc)
- The MacOS ROM
To use MoL, you will have to copy your MacOS ROM to /usr/lib/mol/rom/rom.nw
Provided your MacOS 9 CD-ROM is mounted (as HFS) on /disk/cdrom, this can be done by
strip_nwrom "/disk/cdrom/System Folder/Mac OS ROM" /usr/lib/mol/rom/rom.nw
- The loopback device
Instead of using a real disk to run MacOS, you can use a very nice feature of Linux called loopback
devices. It allows you to simulate a block device (i.e, a disk) using a (big) file on your Linux
filesystem. Doing this way, MacOS running as a guest OS in MoL will never even touch your real disk
The big problem here is to make MacOS beleive it's an IDE disk and to install it on this disk. The only
solution I've found is to use a real IDE disk, to mount it in the machine and to use MacOS 9 CD to
initialise it and to create the partition map, install MacOS 9, then to boot on MacOS 8.6 CD-ROM to
reinstall the 8.6 drivers onto this disk. Once this initialisation done, you can boot Linux and do a
cat /dev/hdb > /var/mol/MacOS9 to dump the whole disk to the /var/mol/MacOS9 file.
My MoL config files use this image as the simulated disk.
- A small script to patch your kernel
- You can use it in your init scripts to patch the kernel and setup the loopback device (copy this file in /etc/rc.d/init.d and do a /sbin/chkconfig --level 5 mol on to install it)
Resources
You can e-mail me at vincentl@ec-lyon.fr