Subject: Success: iBook G4
To: None <>
From: Magnus Henoch <>
List: port-macppc
Date: 01/28/2005 09:42:29
This is how I installed NetBSD 2.0 to dual-boot with Mac OS 10.3 on my
iBook G4 of 1GHz; posting this for whomever it may be useful.

I didn't want to lose my Mac OS partition, so I wanted nondestructive
partition resize.  There is a patch floating around for GNU parted
which allows resizing of HFS+ partitions; it's also in the Debian
parted package.  parted only works on GNU/Linux and GNU/Hurd, so I
grabbed the Debian sarge netinstall CD.

parted doesn't want to resize journalled HFS+ partitions, so I turned
journalling off in Disk Utility.

I booted the Debian CD in expert mode (i.e. typed "expert" at the
yaboot prompt), loaded extra packages from the CD (among them parted),
and went to the shell.  Resizing my 40 GB partition to 30 GB (about 23
GB used) took 25 hours (sic).

After that, I booted the Mac OS install disk and checked the partition
with Disk Utility.  Some inconsistencies were reported, but all in all
nothing was lost.  (I had backups, of course)

Then I booted the NetBSD macppc CD.  With pdisk I set up an Apple UFS
partition for sharing files, an FFS root partition, and a swap
partition.  (I later initialized the UFS partition in Mac OS.)
Installation went as expected.

I copied ofwboot.xcf to the root directory of the HFS+ partition in
Mac OS.

In Open Firmware, I made the following settings:

setenv auto-boot? false
setenv boot-device hd:3,\ofwboot.xcf
setenv boot-file hd:5,/netbsd

With that, I can boot NetBSD by just typing boot.  I tried setting
boot-command to "boot" and auto-boot? to true, but it just gave me a
grey screen.

I can boot Mac OS with "boot hd:,\\:tbxi".

To get X running, I ran xf86config, and then needed to add 'Option
"iBookHacks" "On"' to the Device section, and 'Option "Protocol" "wskbd"
Option "Device" "/dev/wskbd0"' to the keyboard section.

I found that backspace and some of the arrow keys were not properly
bound by default.  This is my xmodmap file:

keycode 190 = BackSpace

keycode 126 = Left
keycode 183 = Right
keycode 170 = Up
! keycode 104 = Down
! already present

! these are Fn+arrow keys
keycode 157 = Home
keycode 184 = End
keycode 181 = Prior
! keycode 105 = Next
! already present

Now I have a system much smaller and faster than Mac OS.  This is my

* Mozilla shouldn't leave black lines when scrolling.
* I want Control on Caps Lock.  man akbd says that I just need to
  recompile my kernel with CAPS_IS_CONTROL.  I'll do that later...
* I want audio.  Apparently I just need to compile a kernel with awacs
* In X, keys don't repeat when held down.  They do in the console.
  xset q says:
Keyboard Control:
  auto repeat:  on    key click percent:  0    LED mask:  00000000
  auto repeat delay:  660    repeat rate:  25
  auto repeating keys:  00ffffffdffffbbf
which looks correct to me.
* I want mouse clicks when I just tap the trackpad.  The trackpad
  seems to have four buttons:
ams0 at adb0 addr 3: EMP trackpad <tpad> 4-button, 400 dpi
wsmouse0 at ams0 mux 0
  but I haven't found any way to make xev report clicks from buttons
  2-4, and I don't know if that's related.