Apple iBook G4 - FreeBSD

Machine info on main page.

This machine runs the powerpc (32 bit) version of FreeBSD.

The first internal hard drive (ada0) is partitioned like this:

slice 1 - 800 K - apple-boot
slice 2 -  25 G - apple-hfs -  OS X
slice 3 -  14 G - freebsd-ufs - FreeBSD (currently 9.0-RC2)
slice 4 -    2 G - freebsd-swap

hints: holding down option (alt) key while booting allows you to select hard drive partitions to boot from, Open Firmware: cmd-Option-O-F,

Work log

2021-04-23: booted FreeBSD 13.0-release powerpc from a usb memstick. dmesg output: normal. Learned a couple of things:

- the FreeBSD usb memstick does NOT show up on the Option (alt) boot menu, you have to boot into Open Firmware and boot from 
  ud (boot ud:,\\:tbxi)
- the usb memstick installer image expects to mount root from da0, so the FreeBSD usb memstick needs to be in the backmost 
  usb port
- another usb memstick (in the frontmost port) is detected
- labeling the filesystems: put a filesystem label on the root partition (tunefs -L name partition, shows up as /dev/ufs/name), 
  a geom partition label on the swap (glabel label name partition, shows up as /dev/label/name)

2021-04-22: with a FreeBSD 13.0-release memstick in the frontmost usb port, I booted into Open Firmware (hold down Command-Option-O-F), and entered

boot ud:,\\:tbxi

and it booted from the usb stick. Unfortunately, it loops printing "Root mount waiting for: CAM" doesn't look like it progresses. Powered off, tried again - this time it worked. still complains: "WARNING: Current temperature (GPU BOTTOMSIDE: 103.0 C) exceeds critical temperature (80.0 C); count=1" this message repeats every few minutes.

2021-04-21: ada0s4 - I booted this old machine. Still runs FreeBSD 9.1-prerelease

tingo@kg-ibook$ uname -a
FreeBSD kg-ibook.kg4.no 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0: Thu Jul 19 11:26:56 CEST 2012     root@kg-ibook.kg4.no:/usr/obj/usr/src/sys/GENERIC  powerpc

status

root@kg-ibook# date;swapinfo -h;df -h;uptime
Wed Apr 21 23:16:42 CEST 2021
Device          1K-blocks     Used    Avail Capacity
/dev/ada0s5       2097152       0B     2.0G     0%
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ada0s4     13G    4.6G    8.1G    36%    /
devfs          1.0k    1.0k      0B   100%    /dev
11:16PM  up 15 mins, 2 users, load averages: 0.02, 0.03, 0.06

gpart info

root@kg-ibook# gpart show -p ada0
=>       18  117210222    ada0  APM  (55G)
         18     262190          - free -  (128M)
     262208   52626616  ada0s3  apple-hfs  (25G)
   52888824       1600  ada0s2  apple-boot  (800k)
   52890424   29358528  ada0s4  freebsd-ufs  (14G)
   82248952    4194304  ada0s5  freebsd-swap  (2.0G)
   86443256   30766984          - free -  (14G)

battery info - don't know how to get that. rc.conf

root@kg-ibook# more /etc/rc.conf
hostname="kg-ibook.kg4.no"
keymap="norwegian.iso.kbd"
ifconfig_gem0="DHCP"
sshd_enable="YES"
moused_enable="YES"
moused_port="/dev/atp0"
ntpd_enable="YES"
#wlans_bwn0="wlan0"
wlans_bwi0="wlan0"
#ifconfig_wlan0="WPA DHCP"
# enable SMART monitoring
smartd_enable="YES"
sysctl.conf
root@kg-ibook# more /etc/sysctl.conf
# cpu boots at half speed on iBook. Change to full speed.
dev.cpu.0.freq=1420

ok

2012-07-19: ada0s3 - cpu speed: based on information from the freebsd-ppc mailing list, iBooks boot up with cpu at half speed. Relevant info:

root@kg-ibook# sysctl dev.cpu.0.freq_levels
dev.cpu.0.freq_levels: 1420/-1 710/-1
root@kg-ibook# sysctl dev.cpu.0.freq
dev.cpu.0.freq: 710

So, simply change the frequency should do the trick:

root@kg-ibook# sysctl dev.cpu.0.freq=1420
dev.cpu.0.freq: 710 -> 1420

Let's see if that one works in /etc/sysctl.conf. Yes it does. After a reboot, I have:

root@kg-ibook# sysctl dev.cpu.0.freq
dev.cpu.0.freq: 1420

That's it.

2012-07-19: ada0s3 - after the memory upgrade (see main page), dmesg now reports:

real memory  = 1594781696 (1520 MB)
avail memory = 1537441792 (1466 MB)

cool.

2012-07-19: ada0s3 - network - wireless (bwi0) doesn't work, for some reason. Output from dmesg:

root@kg-ibook# dmesg | grep bwi
bwi0: <Broadcom BCM4318 802.11b/g Wireless Lan> mem 0x80084000-0x80085fff irq 52 at device 18.0 on pci1
bwi0: BBP: id 0x4318, rev 0x2, pkg 2
bwi0: MAC: rev 9
bwi0: PHY: type 2, rev 7, ver 3
bwi0: RF: manu 0x17f, type 0x2050, rev 8
bwi0: invalid antenna gain in sprom
bwi0: firmware rev 0x0127, patch level 0x000e
bwi0: need multicast update callback
bwi0: need multicast update callback
bwi0: need multicast update callback
bwi0: need multicast update callback

That's it.

2012-07-19: ada0s3 - the upgrade to FreeBSD 9.1-prerelease finished, dmesg output: normal, verbose.

root@kg-ibook# uname -a
FreeBSD kg-ibook.kg4.no 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0: Thu Jul 19 11:26:56 CEST 2012     root@kg-ibook.kg4.no:/usr/obj/usr/src/sys/GENERIC  powerpc

It still says that the CPU have wrong speed, though. From dmesg:

root@kg-ibook# dmesg | grep cpu
cpu0: Motorola PowerPC 7447A revision 1.5, 713.92 MHz
cpu0: Features 9c000000<PPC32,ALTIVEC,FPU,MMU>
cpu0: HID0 8450c0bc<EMCP,TBEN,NAP,DPM,ICE,DCE,SGE,BTIC,LRSTK,FOLD,BHT>
cpulist0: <Open Firmware CPU Group> on nexus0
cpu0: <Open Firmware CPU> on cpulist0
dfs0: <Dynamic Frequency Switching> on cpu0

I wonder why? pciconf output:

root@kg-ibook# pciconf -lv
hostb0@pci0:0:11:0:    class=0x060000 card=0x00000000 chip=0x0034106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc.'
    device     = 'UniNorth 2 AGP'
    class      = bridge
    subclass   = HOST-PCI
vgapci0@pci0:0:16:0:    class=0x030000 card=0x4e561002 chip=0x4e561002 rev=0x80 hdr=0x00
    vendor     = 'ATI Technologies Inc'
    device     = 'M11 NV [FireGL Mobility T2e]'
    class      = display
    subclass   = VGA
macio0@pci1:0:23:0:    class=0xff0000 card=0x00000000 chip=0x003e106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc.'
    device     = 'KeyLargo/Intrepid Mac I/O'
bwi0@pci1:0:18:0:    class=0x028000 card=0x4318106b chip=0x431814e4 rev=0x02 hdr=0x00
    vendor     = 'Broadcom Corporation'
    device     = 'BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller'
    class      = network
ohci0@pci1:0:26:0:    class=0x0c0310 card=0x00000000 chip=0x003f106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc.'
    device     = 'KeyLargo/Intrepid USB'
    class      = serial bus
    subclass   = USB
ohci1@pci1:0:27:0:    class=0x0c0310 card=0x00351033 chip=0x00351033 rev=0x43 hdr=0x00
    vendor     = 'NEC Corporation'
    device     = 'USB'
    class      = serial bus
    subclass   = USB
ohci2@pci1:0:27:1:    class=0x0c0310 card=0x00351033 chip=0x00351033 rev=0x43 hdr=0x00
    vendor     = 'NEC Corporation'
    device     = 'USB'
    class      = serial bus
    subclass   = USB
ehci0@pci1:0:27:2:    class=0x0c0320 card=0x00e01033 chip=0x00e01033 rev=0x04 hdr=0x00
    vendor     = 'NEC Corporation'
    device     = 'USB 2.0'
    class      = serial bus
    subclass   = USB
hostb1@pci1:0:11:0:    class=0x060000 card=0x00000000 chip=0x0035106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc.'
    device     = 'UniNorth 2 PCI'
    class      = bridge
    subclass   = HOST-PCI
none0@pci1:0:24:0:    class=0x0c0310 card=0x00000000 chip=0x003f106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc.'
    device     = 'KeyLargo/Intrepid USB'
    class      = serial bus
    subclass   = USB
none1@pci1:0:25:0:    class=0x0c0310 card=0x00000000 chip=0x003f106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc.'
    device     = 'KeyLargo/Intrepid USB'
    class      = serial bus
    subclass   = USB
ata1@pci2:0:13:0:    class=0xff0000 card=0x00000000 chip=0x003b106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc.'
    device     = 'UniNorth/Intrepid ATA/100'
fwohci0@pci2:0:14:0:    class=0x0c0010 card=0x5811106b chip=0x0031106b rev=0x81 hdr=0x00
    vendor     = 'Apple Computer Inc.'
    device     = 'UniNorth 2 FireWire'
    class      = serial bus
    subclass   = FireWire
gem0@pci2:0:15:0:    class=0x020000 card=0x00000000 chip=0x0032106b rev=0x80 hdr=0x00
    vendor     = 'Apple Computer Inc.'
    device     = 'UniNorth 2 GMAC (Sun GEM)'
    class      = network
    subclass   = ethernet
hostb2@pci2:0:11:0:    class=0x060000 card=0x00000000 chip=0x0036106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc.'
    device     = 'UniNorth 2 Internal PCI'
    class      = bridge
    subclass   = HOST-PCI

That is all for now.

2012-07-18: ada0s3 - booting up this machine for the first time in ages. It still has the same version of FreeBSD at last time:

tingo@kg-ibook$ uname -a
FreeBSD kg-ibook.kg4.no 9.0-RC2 FreeBSD 9.0-RC2 #0: Mon Nov 14 08:04:49 UTC 2011     marcel@xserve.lan.xcllnt.net:/usr/obj/usr/src/sys/GENERIC  powerpc

One odd thing from dmesg:

cpu0: Motorola PowerPC 7447A revision 1.5, 713.92 MHz
cpu0: Features 9c000000<PPC32,ALTIVEC,FPU,MMU>
cpu0: HID0 8450c0bc<EMCP,TBEN,NAP,DPM,ICE,DCE,SGE,BTIC,LRSTK,FOLD,BHT>

Why does it say thst the speed of the cpu is 800 Mhz, and not 1.42 GHz?

Time to update FreeBSD. Upgrading to latest FreeBSD 9-stable, by using csup, make world. This is FreeBSD 9.1-PRERELEASE:

root@kg-ibook# egrep "^BRANCH|^REVISION" /usr/src/sys/conf/newvers.sh
REVISION="9.1"
BRANCH="PRERELEASE"

We will see if the upgrade works.

2011-12-17: ada0s3 - getting the touchpad (mouse) to work. Add the following to /etc/rc.conf:

moused_enable="YES"
moused_port="/dev/atp0"

and now the touchpad works. I still don't know why there is a moused for usb:

root@kg-ibook# ps ax | grep moused
 1380  ??  Is    0:00.00 /usr/sbin/moused -p /dev/ums0 -t auto -I /var/run/moused.ums0.pid
 2109  ??  Is    0:00.01 /usr/sbin/moused -p /dev/atp0 -t auto
 2162   0  R+    0:00.00 grep moused
root@kg-ibook# dmesg | grep ums
ums0: <vendor 0x05ac product 0x1000, class 0/0, rev 2.00/19.65, addr 2> on usbus0
ums0: 5 buttons and [XY] coordinates ID=0
root@kg-ibook# usbconfig
ugen0.1: <OHCI root HUB Apple> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen1.1: <OHCI root HUB NEC> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen2.1: <OHCI root HUB NEC> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen3.1: <EHCI root HUB NEC> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE
ugen0.2: <product 0x1000 vendor 0x05ac> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen0.3: <Apple Internal Trackpad Apple Computer> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON

maybe I will find out one day.

2011-11-25: ada0s3 - testing wireless: I create /etc/wpa_supplicant.conf which contains:

network={
    ssid="my ssid"
    psk="my secret psk"
}

No, those are not the real values. :) Then I add the following to /etc/rc.conf:

wlans_bwn0="wlan0"
ifconfig_wlan0="WPA DHCP"

And now it is just a matter of testing it. I run /etc/netstart, but this is what /var/log/messages says:

Nov 25 21:46:56 kg-ibook kernel: wlan0: Ethernet address: 00:14:51:db:c8:73
Nov 25 21:46:57 kg-ibook root: /etc/rc.d/wpa_supplicant: WARNING: Unable to load kernel module wlan_tkip
Nov 25 21:46:57 kg-ibook root: /etc/rc.d/wpa_supplicant: WARNING: failed precmd routine for wpa_supplicant
Nov 25 21:46:57 kg-ibook kernel: bwn_v4_ucode5: could not load firmware image, error 2
Nov 25 21:46:57 kg-ibook kernel: bwn0: the fw file(bwn_v4_ucode5) not found
Nov 25 21:46:57 kg-ibook kernel: bwn-open_v4_ucode5: could not load firmware image, error 2
Nov 25 21:46:57 kg-ibook kernel: bwn0: the fw file(bwn-open_v4_ucode5) not found

Doesn't look to good. The files installed by the bwn-firmware-kmod port are these:

root@kg-ibook# ls -l /boot/modules/bwn*
-r-xr-xr-x  1 root  wheel  184082 Nov 25 21:29 /boot/modules/bwn_v4_lp_ucode.ko
-r-xr-xr-x  1 root  wheel  177057 Nov 25 21:29 /boot/modules/bwn_v4_ucode.ko

Hmm. Let's try bwi instead. First install the bwi-firmware-kmod port:

root@kg-ibook# portinstall -R bwi-firmware-kmod

which installs this file:

root@kg-ibook# pkg_info -L bwi-firmware-kmod-3.130.20
Information for bwi-firmware-kmod-3.130.20:

Files:
/boot/modules/bwi_v3_ucode.ko

and then I load the if_bwi kernel module (having unloaded if_bwn first). From /var/log/messages:

Nov 25 22:03:31 kg-ibook kernel: bwi0: <Broadcom BCM4318 802.11b/g Wireless Lan> mem 0x80084000-0x80085fff irq 52 at device 18.0 on pci1
Nov 25 22:03:31 kg-ibook kernel: bwi0: BBP: id 0x4318, rev 0x2, pkg 2
Nov 25 22:03:31 kg-ibook kernel: bwi0: MAC: rev 9
Nov 25 22:03:31 kg-ibook kernel: bwi0: PHY: type 2, rev 7, ver 3
Nov 25 22:03:31 kg-ibook kernel: bwi0: RF: manu 0x17f, type 0x2050, rev 8
Nov 25 22:03:31 kg-ibook kernel: bwi0: invalid antenna gain in sprom
Nov 25 22:05:06 kg-ibook kernel: bwi0: firmware rev 0x0127, patch level 0x000e
Nov 25 22:05:08 kg-ibook wpa_supplicant[2317]: Trying to associate with 00:0f:66:51:aa:41 (SSID='kg4' freq=2462 MHz)
Nov 25 22:05:18 kg-ibook wpa_supplicant[2317]: Authentication with 00:0f:66:51:aa:41 timed out.
Nov 25 22:05:21 kg-ibook wpa_supplicant[2317]: Trying to associate with 00:0f:66:51:aa:41 (SSID='kg4' freq=2462 MHz)
Nov 25 22:05:21 kg-ibook wpa_supplicant[2317]: Associated with 00:0f:66:51:aa:41
Nov 25 22:05:21 kg-ibook kernel: wlan0: link state changed to UP
Nov 25 22:05:21 kg-ibook wpa_supplicant[2317]: WPA: Key negotiation completed with 00:0f:66:51:aa:41 [PTK=TKIP GTK=TKIP]
Nov 25 22:05:21 kg-ibook wpa_supplicant[2317]: CTRL-EVENT-CONNECTED - Connection to 00:0f:66:51:aa:41 completed (auth) [id=0 id_str=]
Nov 25 22:05:21 kg-ibook kernel: bwi0: need multicast update callback
Nov 25 22:05:49 kg-ibook dhclient: New IP Address (wlan0): 10.1.150.25
Nov 25 22:05:49 kg-ibook kernel: bwi0: need multicast update callback
Nov 25 22:05:49 kg-ibook kernel: bwi0: need multicast update callback

It looks like it is working, but the interface doesn't pass any packets. Darn!

2011-11-25: ada0s3 - network interfaces. wired:

root@kg-ibook# pciconf -lv | grep -A 4 gem
gem0@pci2:0:15:0:    class=0x020000 card=0x00000000 chip=0x0032106b rev=0x80 hdr=0x00
    vendor     = 'Apple Computer Inc.'
    device     = 'UniNorth 2 GMAC (Sun GEM)'
    class      = network
    subclass   = ethernet

wireless:

root@kg-ibook# pciconf -lv | grep -A 3 none
none0@pci1:0:18:0:    class=0x028000 card=0x4318106b chip=0x431814e4 rev=0x02 hdr=0x00
    vendor     = 'Broadcom Corporation'
    device     = 'BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller'
    class      = network

is there a driver? First I need to configure the cdrom:

root@kg-ibook# mkdir /cdrom
root@kg-ibook# echo "/dev/cd0                /cdrom          cd9660  ro,noauto       0       0" >> /etc/fstab

I cheated and inserted the CD first, so now I can do:

root@kg-ibook# mount /cdrom

then I extract source:

root@kg-ibook# cd /
root@kg-ibook# tar xvf /cdrom/usr/freebsd-dist/src.txz

After a while, the extract is finished. Next I install the bwn firmware port:

root@kg-ibook# portinstall -R bwn-firmware-kmod

and try to load the if_bwn module:

root@kg-ibook# kldload if_bwn

lets check if that worked:

root@kg-ibook# dmesg | grep bwn
siba_bwn0: <Broadcom BCM4318 802.11b/g Wireless> mem 0x80084000-0x80085fff irq 52 at device 18.0 on pci1
bwn0 on siba_bwn0
bwn0: WLAN (chipid 0x4318 rev 9) PHY (analog 3 type 2 rev 7) RADIO (manuf 0x17f ver 0x2050 rev 8)
bwn0: DMA (32 bits)

dmesg seems to indicate yes. A couple of more checks:

root@kg-ibook# ifconfig bwn0
bwn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
    ether 00:14:51:db:c8:73
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
    status: no carrier
root@kg-ibook# pciconf -lv | grep -A 3 bwn
siba_bwn0@pci1:0:18:0:    class=0x028000 card=0x4318106b chip=0x431814e4 rev=0x02 hdr=0x00
    vendor     = 'Broadcom Corporation'
    device     = 'BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller'
    class      = network

Yes. Now I need to test it.

2011-11-25: ada0s3 - ofwdump -ap output, ofwdump -pr / output. Various more or less interesting bits:

root@kg-ibook# ofwdump -S -P model /
PowerBook6,7
root@kg-ibook# ofwdump -S -P bootpath /chosen
/pci@f4000000/ata-6@d/disk@0:2,\ppc\boot1.elf
root@kg-ibook# ofwdump -S -P bootargs /chosen
/pci@f4000000/ata-6@d/disk@0:4

ROM info:

root@kg-ibook# ofwdump -S -P model /rom/boot-rom
Apple PowerBook6,7 4.9.3f0 BootROM built on 07/05/05 at 11:14:11
root@kg-ibook# ofwdump -S -P BootROM-version /rom/boot-rom
$0004.93f0
root@kg-ibook# ofwdump -S -P BootROM-build-date /rom/boot-rom
07/05/05 at 11:14:11

More info:

root@kg-ibook# ofwdump -S -P ram-size /options
0x20000000

Packages:

root@kg-ibook# ofwdump -r /packages
Node 0xff89ee10: packages
  Node 0xff89eea8: deblocker
  Node 0xff89f7f8: disk-label
  Node 0xff8a0860: obp-tftp
  Node 0xff8ab450: telnet
  Node 0xff8abd00: mac-parts
  Node 0xff8af328: mac-files
  Node 0xff8b24c0: hfs-plus-files
  Node 0xff8b7bd0: fat-files
  Node 0xff8bb3a8: iso-9660-files
  Node 0xff8bc1b8: bootinfo-loader
  Node 0xff8bde28: xcoff-loader
  Node 0xff8be8f8: macho-loader
  Node 0xff8c1760: pe-loader
  Node 0xff8c2168: elf-loader
  Node 0xff8c40b8: usb-hid-class
  Node 0xff8c6c20: usb-ms-class
  Node 0xff8c9970: usb-audio-class
  Node 0xff937470: sbp2-disk
  Node 0xff93afe0: ata-disk
  Node 0xff93d5a8: atapi-disk
  Node 0xff93fbc8: bootpath-search
  Node 0xff946200: terminal-emulator
root@kg-ibook# ofwdump -S -P compatible /nvram
sharp-B0ED
root@kg-ibook# ofwdump -S -P serial-number /
SE9

Thats all I managed before getting tired of this.

2011-11-17: ada0s3 - create a swap partition:

root@kg-ibook# gpart add -s 2G -t freebsd-swap ada0
ada0s5 added

and test it:

root@kg-ibook# swapinfo
Device          1K-blocks     Used    Avail Capacity
root@kg-ibook# swapon /dev/ada0s5
root@kg-ibook# swapinfo
Device          1K-blocks     Used    Avail Capacity
/dev/ada0s5       2097152        0  2097152     0%

seems to work. Added it to the /etc/fstab file.

root@kg-ibook# more /etc/fstab
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/ada0s5     none            swap    sw      0       0
/dev/ada0s4     /               ufs     rw      1       1

All for now.

2011-11-17: ada0s3 - the partitioning problem was discussed on the freebsd-ppc mailing list. Basically, the number of partitions in APM is set when the disk is first created. Disk Utility (OS X) didn't want to change that, but a suggestion from the freebsd-ppc mailing list worked: boot from a live CD (I used the same CD that I have used to install FreeBSD on this machine) backup the partition table to a text file:

# gpart backup ada0 > /tmp/ada0.backup

edit the file, and change the line that reads "APM N" into "APM 16" (in my case it was "APM 3" before changing it), then save the file. restore the changed partition table, but don't commit yet:

# gpart restore -lF -f x ada0 < /tmp/ada0.backup

verify that the new partition table loks ok with:

# gpart show ada0

finally. commit it:

# gpart commit ada0

The output from gpart show changed a bit, here is the new one:

root@kg-ibook# gpart show ada0
=>       18  117210222  ada0  APM  (55G)
         18     262190        - free -  (128M)
     262208   52626616     2  apple-hfs  (25G)
   52888824       1600     1  apple-boot  (800k)
   52890424   29358528     3  freebsd-ufs  (14G)
   82248952   34961288        - free -  (16G)

and gpart list output for completeness:

root@kg-ibook# gpart list ada0
Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 117210239
first: 18
entries: 16
scheme: APM
Providers:
1. Name: ada0s2
   Mediasize: 819200 (800k)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 1309274112
   Mode: r0w0e0
   rawtype: Apple_Bootstrap
   label: (null)
   length: 819200
   offset: 27079077888
   type: apple-boot
   index: 1
   end: 52890423
   start: 52888824
2. Name: ada0s3
   Mediasize: 26944827392 (25G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 134250496
   Mode: r0w0e0
   rawtype: Apple_HFS
   label: Untitled
   length: 26944827392
   offset: 134250496
   type: apple-hfs
   index: 2
   end: 52888823
   start: 262208
3. Name: ada0s4
   Mediasize: 15031566336 (14G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 1310093312
   Mode: r1w1e1
   rawtype: FreeBSD-UFS
   label: (null)
   length: 15031566336
   offset: 27079897088
   type: freebsd-ufs
   index: 3
   end: 82248951
   start: 52890424
Consumers:
1. Name: ada0
   Mediasize: 60011642880 (55G)
   Sectorsize: 512
   Mode: r1w1e2

Problem solved! Now to create a swap partition.

2011-11-17: ada0s3 - here is gpart list output for ada0:

root@kg-ibook# gpart list ada0
Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 117210239
first: 5
entries: 3
scheme: APM
Providers:
1. Name: ada0s2
   Mediasize: 819200 (800k)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 1309274112
   Mode: r0w0e0
   rawtype: Apple_Bootstrap
   label: (null)
   length: 819200
   offset: 27079077888
   type: apple-boot
   index: 1
   end: 52890423
   start: 52888824
2. Name: ada0s3
   Mediasize: 26944827392 (25G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 134250496
   Mode: r0w0e0
   rawtype: Apple_HFS
   label: Untitled
   length: 26944827392
   offset: 134250496
   type: apple-hfs
   index: 2
   end: 52888823
   start: 262208
3. Name: ada0s4
   Mediasize: 15031566336 (14G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 1310093312
   Mode: r1w1e1
   rawtype: FreeBSD-UFS
   label: (null)
   length: 15031566336
   offset: 27079897088
   type: freebsd-ufs
   index: 3
   end: 82248951
   start: 52890424
Consumers:
1. Name: ada0
   Mediasize: 60011642880 (55G)
   Sectorsize: 512
   Mode: r1w1e2

That's all.

2011-11-16: ada0s3 - I installed FreeBSD 9.0-RC2 from the CD. dmesg output: normal, verbose. Guided partitioning didn't work (it complained about no space left on the device and referred to 's4'), so I chose manual partitioning. It allowed me to make ada0s3 (freebsd-ufs), created ada0s1 (apple-boot) on it's own, but when I tried to create a swap partition (ada0s4) it complained about no space left on the device again. I just continued without a swap partition, it seems ok so far. More info:

kg-ibook# uname -a
FreeBSD kg-ibook.kg4.no 9.0-RC2 FreeBSD 9.0-RC2 #0: Mon Nov 14 08:04:49 UTC 2011     marcel@xserve.lan.xcllnt.net:/usr/obj/usr/src/sys/GENERIC  powerpc

gpart info:

kg-ibook# gpart show ada0
=>        5  117210235  ada0  APM  (55G)
          5     262203        - free -  (128M)
     262208   52626616     2  apple-hfs  (25G)
   52888824       1600     1  apple-boot  (800k)
   52890424   29358528     3  freebsd-ufs  (14G)
   82248952   34961288        - free -  (16G)

Hmm, there is space here let's see if we can add a swap partition:

kg-ibook# gpart add -s 2G -t freebsd-swap ada0
gpart: index '4': No space left on device

That's odd. Another odd thing: when booting, the machine starts printing characters, aborts the boot and shows the "OK" prompt followed by more characters. Simply erasing them, typing "boot" and enter makes things continue.

2011-11-16: I booted FreeBSD 9.0-RC2 (FreeBSD-9.0-RC2-powerpc-release.iso) from a CD, by holding "C" while powering on the machine. It booted straight into the little "Welcome" menu. I selected "Live CD" for this first run. The wireless network adapter (Broadcom BCM4318 - AirForce One 54g) shows up as "none" in pciconf -lv output, but the wired network adapter shows up as gem0 - apple Computer Inc. - UniNorth 2 GMAC (Sun GEM).

# gpart show ada0

shows that the drive is APM partitioned, partition 2 is a 25G apple-hfs, and there is 30G free space. Good.