Monday, September 12, 2011

Installing NetBSD 5.1 on PowerMAC G4

I've tried to install NetBSD 5.1 on PowerMAC G4 (grey) following these instructions: but I had problems booting.

Here are some tips.
It seems that netbsd-INSTALL.gz image which comes from 5.1 installation CD is ok but netbsd-GENERIC.gz and others were not tested so they crashed when I rebooted after installation. So here what I've done to solve this after installation is done but can not boot to netbsd:

Hold Alt+Win+o+f when starting PowerMAC to enter in OpenFirmware cmd line menu.
Boot with install netbsd image. Something like that:

0> boot cd:,\ofwboot.xcf \macppc\binary\kernel\netbsd-INSTALL.gz

When it boots you will be prompted for (I)nstall (S)hell ... choose 'S;.
Now from shell mount your root partition and chroot to it and set up your internet connection:

# mount /dev/wd0a /mnt2
# chroot /mnt2
# ifconfig gem0 up
# route add default
# echo "nameserver" > /etc/resolv.conf

Now you can download and compile your own kernel. Get syssrc.tgz from untar it and go to sys/arch/macppc/conf. Use GENERIC config as if you try to compile POWERMAC_G5 or some of the others result will be the same - kernel crash on next reboot.

# vi G4
# config G4
# cd ../compile/G4
# make depend
# make
# cp /netbsd /netbsd.old
# cp netbsd /netbsd

If you want your Xorg server to work you need to add these lines to kernel config file and recompile it:

options WSDISPLAY_COMPAT_PCVT # emulate some ioctls
options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls
options WSDISPLAY_COMPAT_USL # VT handling
options WSDISPLAY_COMPAT_RAWKBD # can get raw scancodes

Now you just use: X -configure and then test your config with: X -config

No comments: