Matthias Schmidt
|
 |
|
|
Linux on an Apple Powerbook 12"
Last Update
Tue Apr 25 12:26:11 CEST 2006
Contact and GPG key
GnuPG public key
matthias.asc
Hardware
|
0. General
0.1 Battery
The battery is not as powerfull as Apple stated (~ 5 hours). Under OS X the
laptop suspends after 2.5 hours. Under Linux and heavy load (I compiled the
kernel four times, rebooted four times and also compiled a lot of source code)
the laptop works for 3.5 hours. Under normal circumstances the battery was
empty after 4 hours.
0.2 Heat
You won't get cold fingers if you hack in the winter :) The PB has an active
fan, but the aluminium chassis acts as an passive cooler. During compiling
Xfree 4.3.0 the PB chassis was _really_ hot.
Chassis temperatures
|
|
Normal: ca. 25 degree Celsius
make bzImage: ca. 27-30 degree Celcius
|
0.3 Important keys
Important keys
|
- Reboot the Powerbook: [apple] + [ctrl] + [power switch]
- Command key: [apple]"
- Option key: [alt]
|
1. Mac OS X
1.1 Install Mac OS X
My PB (and the PB 12" of others too) isn't able too boot of the OS X install
DVD. You'll see the gray apple but nothing will happen. I tried it with OS X
CDs from an old iBook, but they failed too. I found a solution for this problem
in the Apple support forum:
Solution
|
- Insert Software restore DVD
- Restart
- Press [c] shortly after the boot sound
- Press [apple] + [v] and hold after the grey apple appears
- Release key after entering the debug mode (text on screen)
- Wait for the installer
|
During the installation I partitioned the harddrive into two partitions. One
for OS X and another one for Linux.
2.1 Preparation
Download the following files and copy them into the OS X root directory:
Download and install these files
|
- images/root.bin
- yaboot
- yaboot.conf
- linux.bin
|
The first three file derived from
http://http.us.debian.org/debian/dists/woody/main/disks-powerpc/current/new-powermac/,
the fourth is the kernel
from Orion Buckminster Montoya, which I renamed to linux.bin. You have to take
his kernel, because the debian default kernel doesn't support ATA 100. The ATA
chipset is the "intrepid chipset, which is UniNorth bridge and KeyLargo
IS ASIC merged in one chip. It's CONFIG_BLK_DEV_IDE_PMAC in kernel
config".
If copying failes, activate the OS X root account with sudo passwd root.
Reboot and press immediately [apple] + [alt] + [o] + [f] to enter
the Open Firmware BIOS. Boot the Debian installer with
|
Boot debian installer (This is the Open Firmware prompt)
|
> boot hd:X,yaboot
|
Replace the X with the location of your OS X partition. I filled 9 in.
If 9 isn't your OS X partition, look at the mount output in the OS X
Terminal. I won't write anything about the Debian install process, have a look
at the tutorials in the appendix.
2.2 Boot youe System
Anyone who installed Debian testing or unstable can skip this
section. These boot-floppies have the correct yaboot version installed. You
only need to run yabootconfig.
You won't be able to boot your system with the Debian yaboot (1.3.6). You'll
receive an error-message during the installation, but don't panic. Reboot, enter the
Open Firmware and boot, as described above, yaboot again. Now at the yaboot
prompt type in the following
|
Boot installed system (This is the Yaboot prompt)
|
boot: hd:X,/linux.bin root=/dev/hdYY ro
|
and boot your installed system (the Y char) with the kernel on the OS X (the X
char) partition. Now linux should start and you can finish the Debian
installation. (Thanks to Jonathan Love who pointed me at a mistake in my
description).
After this, download the newest yaboot (1.3.10) from
http://penguinppc.org/projects/yaboot/ and install it. Note: If the
old yaboot version from debian is still installed, be sure to use the new
version. ybin -V or apt-get remove yaboot will help you in
any way :-P. If you step into problems send an email and have a look into the
yaboot HOWTO. Here is my yaboot.conf.
2.3 Problems during disk partitioning
If your Apple crashes during disk partition (eg Battery empty) and isn't able
to boot thereafter, you can use the DiskUtility from the Mac OS X boot cd to
write a new partition table and restart installation. According to my
information it's not possible to format a hard disk with Open Firmware.
3. Configuration
3.1 Kernel
If cat /proc/cpuinfo reports 53MHz as clock frequency
cpu : 7455, altivec supported
clock : 53MHz
revision : 3.3 (pvr 8001 0303)
bogomips : 51.90
machine : PowerBook6,1
motherboard : PowerBook6,1 MacRISC3 Power Macintosh
detected as : 271 (Unknown Pangea-based)
pmac flags : 00000008
L2 cache : 256K unified
memory : 384MB
pmac-generation : NewWorld
install the newest benh Kernel (look below). If you're looking for further
information please search the
debian-powerpc archives. You only have one choice with Linux and PPC: the
kernel from
Benjamin Herrenschmidt. You'll get
it via rsync:
|
Kernel update via rsync
|
# mkdir /usr/src/benh_kernel
# rsync -avz rsync.penguinppc.org::linux-2.4-benh /usr/src/benh_kernel
|
Here is my kernel .config
3.1.1 Network
If you activate CONFIG_SUNGEM=y in your kernel config, the ethernet
device is working flawlessly.
sungem.c:v0.97 3/20/02 David S. Miller (davem@redhat.com)
eth0: Sun GEM (PCI) 10/100/1000BaseT Ethernet 00:03:93:cc:b2:a2
eth0: Found BCM5221 PHY
3.1.2 Sound
Works fine. Active the following options during kernel configuration:
|
Kernel sound options
|
CONFIG_SOUND=m
CONFIG_DMASOUND_PMAC=m
CONFIG_DMASOUND=m
|
and create a file named sound in /etc/modutils/ with the
following content:
|
/etc/modutils/sound
|
alias char-major-14 soundcore
alias sound-slot-0 dmasound_pmac
alias char-major-14-3 dmasound_pmac
alias /dev/dsp dmasound_pmac
alias sound-service-0-0 i2c-keywest
alias char-major-14-0 i2c-keywest
alias /dev/mixer i2c-keywest
|
3.1.3 Bluetooth
I've tested the bluetooth support with the T68i mobile phone from Sony Ericsson
and it worked.
3.1.3.1 Kernel options
You'll need the following kernel options to communicate with the mobile:
|
Bluetooth kernel options
|
CONFIG_BLUEZ=m
CONFIG_BLUEZ_L2CAP=m
CONFIG_BLUEZ_RFCOMM=m
CONFIG_BLUEZ_RFCOMM_TTY=y
CONFIG_BLUEZ_HCIUSB=m
CONFIG_BLUEZ_HCIUART=m
CONFIG_BLUEZ_HCIUART_H4=y
CONFIG_BLUEZ_HCIVHCI=m
|
You have to load the modules below to get a working connection:
hci_usb 7680 1
rfcomm 34696 1
l2cap 18612 2
bluez 36008 3 [hci_usb rfcomm l2cap]
3.1.3.2 Installation
I don't use the blue userland programs from Debian, instead I compiled them
myself. Download the tarballs below from
bluez.sf.net
Required tarballs
|
|
bluez-libs-2.4.tar.gz
bluez-sdp-1.1.tar.gz
bluez-utils-2.3.tar.gz
|
After installing I searched my mobile via hcitool:
littlejohn!ms:~ $ hcitool scan
Scanning ...
00:0A:D9:37:49:9F Superphone
If hcitool successfully detects your phone, use rfcomm and a PPP tool
(pppd, wvdial) to connect to the internet via bluetooth :)
3.1.4 Internal modem
I was able to install and use successfully the modem driver. I downloaded the
driver from Linux drivers
for Conexant modems and installed them. During configuration the
hcfusbconfig-script wanted insistently a awk version > 3.1.0. I
loaded gawk version 3.1.2 from
gnu.org and installed it.
Now I was able to finish the modem configuration. I had to modify the
init-string of the modem to make it work:
|
Changed modem Init-String
|
ATX3
|
Have a look at my wvdial.conf.
3.1.5 USB 1.1
My Logitech USB mouse work as well as my USB Memory Stick (with usb-storage)
worked.
3.1.6 Firewire 400
Firewire Cameras seemed not to work. A Firewire HDD worked without problems.
3.1.7 Power management
NEW: Suspend to disk is now working properly with kernel 2.6.9. You can
find the required kernel patch
here.
Please unload firewire and usb modules before suspending and don't forget the
resume=partition kernel entry.
Blacklight control also works fine. The needed kernel patch is available at the
same location as the suspend patch.
Nope, APM won't work. APM says: Sleep mode (suspend to ram) not supported
on this machine and Benjamin Herrenschmidt
wrote on debian-powerpc:
> sleep support
No, may take a while before it's supported
Anyway you can do a cat /proc/apm to get the correct information about
your battery status.
3.1.8 CPU
The CPU is fully supported. To get full speed (867 MHz) have a look at the
following:
|
Change clock frequency
|
littlejohn!ms:~ $ cat /proc/cpuinfo | grep clock
clock : 533MHz
littlejohn!ms:~ $ echo -n "0%100%100%performance" > /proc/cpufreq
littlejohn!ms:~ $ cat /proc/cpuinfo | grep clock
clock : 867MHz
|
And don't forget to activate cpufreq support during kernel
configuration. Kernel 2.6.7-bk16 is requiered for cpufreq on the 1.33 GHz
model.
The following packages exist for controlling CPU frequency:
- cpudyn - CPU dynamic frequency control for processors with scaling
- powernowd - control cpu speed and voltage using 2.6 kernel
interface
3.2 DVD/CD-RW drive
SVCD and DVD playback works. With mplayer I wasn't able to play all
DVDs (eg LOTR failed). Somebody reported that DVDV playback with xine
is fine. The CD burner works without problems. Activate SCSI emulation during
kernel configuration and add an entry to your yaboot.conf. With
Kernel 2.6 you can burn CDs without SCSI emulation.
The output of cdrecord -scanbus:
Cdrecord 1.10 (powerpc-unknown-linux-gnu) Copyright (C) 1995-2001 Jörg Schilling
Using libscg version 'schily-0.5'
scsibus0:
0,0,0 0) 'MATSHITA' 'CD-RW CW-8122 ' 'BA1D' Removable CD-ROM
0,1,0 1) *
0,2,0 2) *
0,3,0 3) *
0,4,0 4) *
0,5,0 5) *
0,6,0 6) *
0,7,0 7) *
3.3 Keyboard
I choose mac-usb-de-latin1 (german) as keyboard layout. Furthermore I
installed
pbbuttonsd. You'll now be able to use the PB special keys (eject, mute,
volume, ...) with this daemon. I wrote a little
init script to activate pbbuttonsd at
startup. If you want to eject CDs from the build-in CD-ROM drive you have to
install eject additionaly.
3.4 Trackpad
With the following /etc/gpm.conf the trackpad works fine under
console.
|
/etc/gpm.conf
|
device=/dev/input/mice
responsiveness=
repeat_type=
type=ps2
append=""
sample_rate=
|
I mapped the second and third mouse button to F11 and F12. If you enter
showkey and press any key, you'll see the keycode. My
/etc/sysctl.conf:
|
/etc/sysctl.conf
|
dev/mac_hid/mouse_button_emulation = 1
dev/mac_hid/mouse_button2_keycode = 87
dev/mac_hid/mouse_button3_keycode = 88
|
Hierzu muss im Kernel CONFIG_MAC_EMUMOUSEBTN aktiviert sein.
3.5 TV adapter
I wasn't yet successfull getting the TV adapter working.
3.6 Analog VGA monitor
Same for the VGA adapter. It worked fine under OS X (surprise).
3.7 Airport Extreme
UPDATE: I got a successfull report about a working Airport Card
with a kernel > 2.6.15 and the
http://bcm43xx.berlios.de driver.
It seems that the chipset on the Airport Extreme Card is a Broadcom chip.
Broadcom don't tend to release the Linux driver or any information how to write
a new driver. There is an ongoing
petition,
just sign it :)
Mmh, no :) I was able to successfully load the hermes module, but
that's all. kern.log displays the following:
Mar 26 21:45:50 kernel: hermes.c: 5 Apr 2002 David Gibson
Mar 26 21:47:52 kernel: orinoco.c 0.11b (David Gibson and others)
Mar 26 21:47:52 kernel: airport.c 0.11b (Benjamin Herrenschmidt )
Mar 26 21:47:52 kernel: orinoco.c 0.11b (David Gibson and others)
Mar 26 21:47:52 kernel: airport.c 0.11b (Benjamin Herrenschmidt )
The aiport modul failed with the following message:
/lib/modules/2.4.20-ben9/kernel/drivers/net/wireless/airport.o: init_module: No such device
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters
I created an alias (eth1) for the card and ifconfig eth1 reported the
following (surprise ;):
eth1: error fetching interface information: Device not found
4.0 Xfree 4.3.0 with a Nvidia GeForce4 420 Go
Update: Xfree from Testing/Unstable works fine with the GeForce FX
Go5200 (GeForce4 420 Go), you don't need to compile your own version.
Julian Scheel has started an online petition for nvidia linux driver for ppc.
You can sign it
here.
Note: A lot of readers reported problems with the CVS version of
Xfree86. If you run into trouble during compiling, try the stable version of
Xfree 4.3.x. It'll work :)
4.1 Installation
It works! To get X working, try the following steps. If you use unstable/sid
you can skip the first three steps.
Step-by-Step instruction
|
- get Xfree 4.3.0 from
ftp://ftp.xfree86.org
- read the Install-HOWTO and compile the sources
- look if the nv driver compiles successfully
- install the binaries
- configure X or use my XF86Config
- login from another box via ssh
- startx and look at /var/log/XFree86.0.log
- if X starts, ok. If not, look at the error messages
- If you get an error like Could not load default font fixed, install
xfonts-base via apt.
|
If you use sid, you don't need to compile X from source. You can use the debian
packages from Daniel Stone.
To get the packages type apt-get install x-window-system.
Update:
With a recent (ben10) benh kernel you'll be able to quit and restart your
Xsession without problems. Disadvantage: Your console will be limited to 80x30
characters after boot. Orion Buckminster was the first person who reported
this issue on debian-powerpc.
My XF86Config and the output of
XFree86.0.log.Note: My color depth
is 16Bit per default, but you can use 24Bit (according to Pander) without
problems.
4.2 Configuration
4.2.1 Keyboard
Note: Christophe Cattlegrid wrote very usefull information about X and
keyboard mapping in his HOWTO, so I'll skip this. Have a look at his HOWTO (see
Appendix) instead. I modified my .Xmodmap to get a
usable german keyboard layout. I mapped for example [AltGr]
on the [apple] key.
Appendix
A. Credits
Credits
|
- Thanks to Jonathan Love who pointed me at a mistake and gave me helpfull tips
relating testing/unstable.
- Pander successfully tested X11 with 24Bit color depth and reported the list with the
cpu frequency control programs.
- Johannes Becker reported a broken link and gave me a tip relating the boot prompts.
- Sven Herzing provided the link to the software suspend patch.
- Djoumé SALVETTI maintains the french translation and submitted tons of information
about various topics.
- Javier Carranza maintains the spanish translation.
- Pascal Suter reported a crash during disk partition and how to fix/format the hard
drive.
|
B. Information
C. Links
Interessting threads/postings on debian-powerpc:
Interessting websites:
D. Disclaimer
This document is licensed under the GNU GPL. I'm not responsible for the
content of the hyperlinks here. If you follow a link, it's your own fault not
mine.
Read this: I'm not responsible for any damage (software, hardware or anything else)
this document could cause. Use this document at your own risk!
E. Copyright
All trademarks are the property of their respective owners!
Copyleft (l) 2002-05 by Matthias Schmidt.
|