Installing Linux on an Apple G4 iBook
Leading up to my wife going to Japan, we hacked linux onto her Apple G4 iBook. It was sweet. First I'll show you a bunch of useful stuff to see if your system is like hers, then I'll talk about specific devices. Here are the devices. The last (Sun GEM) one shows up as unknown device until the module is loaded - see details below under "wired ethernet"
$ lspci 00:0b.0 Host bridge: Apple Computer Inc. UniNorth 2 AGP 00:10.0 VGA compatible controller: ATI Technologies Inc M9+ 5C63 [Radeon Mobility 9200 (AGP)] (rev 01) 0001:10:0b.0 Host bridge: Apple Computer Inc. UniNorth 2 PCI 0001:10:12.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03) 0001:10:17.0 Class ff00: Apple Computer Inc. KeyLargo/Intrepid Mac I/O 0001:10:18.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB 0001:10:19.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB 0001:10:1a.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB 0001:10:1b.0 USB Controller: NEC Corporation USB (rev 43) 0001:10:1b.1 USB Controller: NEC Corporation USB (rev 43) 0001:10:1b.2 USB Controller: NEC Corporation USB 2.0 (rev 04) 0002:20:0b.0 Host bridge: Apple Computer Inc. UniNorth 2 Internal PCI 0002:20:0d.0 Class ff00: Apple Computer Inc. UniNorth/Intrepid ATA/100 0002:20:0e.0 FireWire (IEEE 1394): Apple Computer Inc. UniNorth 2 FireWire (rev 81) 0002:20:0f.0 Ethernet controller: Apple Computer Inc. UniNorth 2 GMAC (Sun GEM) (rev 80)
Once the system was running, here's what lsmod has to say; some stuff is in the kernel permanently, but I think I tried to make a lot of modules just for the purposes of you being able to see what I did
$ lsmod Module Size Used by snd_pcm_oss 65024 0 snd_mixer_oss 21984 1 snd_pcm_oss snd_powermac 51612 0 snd_pcm 104324 2 snd_pcm_oss,snd_powermac snd_timer 28164 1 snd_pcm snd 69748 5 snd_pcm_oss,snd_mixer_oss,snd_powermac,snd_pcm,snd_timer soundcore 11396 1 snd snd_page_alloc 11880 1 snd_pcm i2c_powermac 6080 0 i2c_dev 10948 0 radeon 123976 2 drm 84120 3 radeon uninorth_agp 11048 1 agpgart 38428 2 drm,uninorth_agp bcm43xx 117104 0 ieee80211softmac 30944 1 bcm43xx ieee80211 36488 2 bcm43xx,ieee80211softmac ieee80211_crypt 7072 1 ieee80211 sungem 36772 0 sungem_phy 10048 1 sungem therm_adt746x 14028 0 hfs 56804 0
And here are some key files on the system; you'll have to do some of your own digging, or read a bit below, to have a clue what they all mean.
Wired Ethernet - The wired ethernet card return device class ffff on the PCI bus, blatantly violating spec, so you can't inspect what it is. Well, I'll tell you: it is a Sun Gem card, and uses the sungem.ko module. Once the module is inserted, then lspci can identify it properly, so the module knows about the spec violation or something
Wireless Ethernet - The broadcom Airport Extreme has drivers now, which is a huge victory for open source I'd say. The project is at http://bcm43xx.berlios.de/. It works perfectly, as far as I can tell.
Keyboard - The keyboard uses the ADB bus so you need to go into the mac driver section and be sure to have that included or you'll have a hell of a time, like I did, since a lot of sites claim it is a USB keyboard or some such. I didn't remap any of the crazy apple keys, but xmodmap can almost certain do a bang-up job of that. SCIM with scim-anthy works beautifully for Japanese input, by the way.
Touchpad - I didn't really do anything to get it to work… I think I enabled some mac touchpad driver, which is pretty obvious. There is a kernel module to map keys to second and third mouse buttons, and you then configure it in /etc/sysctl.conf
Sound - The ALSA driver snd-powermac.ko depends on i2c stuff (I forget which submodule) but that dependency is not known to modprobe. Be sure to insert all your i2c drivers before snd-powermac. When I failed to do this, I got a kernel panic.
Video - The Radeon works perfectly, with acceleration. I used the radeon.ko kernel module and, if I recall correctly, the radeon X.org driver (as opposed to the ati driver)
Booting - Booting is not too bad, and if you haven't done much reading, you won't know that you want to use a tool called yaboot. Other useful things are that you hold option key combo to get the mac boot selector, or shift-C to boot from CDROM. You may need to get into the Open Firmware, for which you hold option-apple-O-F.
Microphone - As far as I know, the snd-powermac driver doesn't support the built-in mic. So I got a Logitch USB mic, and used the snd-usb or something to that effect. The problem is that the mic device won't open unless you specify single channel recording, which most apps don't do. So what I did was use the great /etc/asound.conf to create a pseudo-device that just drives the mic single channel as a slave:
pcm.mic {
type plug
slave {
pcm "hw:1,0"
channels 1
rate 44100
}
}
It is possible I did this file wrong, but I think it is correct. BUT most GUI apps (linphone in particular) don't seem to see the virtual mic even though any commandline ALSA app can use it. Probably the GUI apps are using some less-than-ideal way to get a listing of the devices which doesn't go through the ALSA configuration layer.
Power Management - A lot of people said this "just works" including whatever "suspend" it uses, but I didn't have time to test it. My wife says it is fine each night as she closes the lid.
Goofy Stuff - There is a kernel module to turn the breathing light into an HDD activity indicator. I think that is sweet so other mac users will think your computer is hyperventilating. Also, I believe you can control the backlight on the screen and thus make your apple logo flicker or something.
Filed under: Linux by Kenn
Leave a Reply
You must be logged in to post a comment.