Power Macintosh G4 - FreeBSD

ongoing tests

For machine info, see main page.

Work log:
2011-01-21: I built the agp.ko module like this:
cd /usr/src/sys/modules/agp
make
make install
kldload agp doesn't give any output in /var/log/messages or on console. I then do:
root@kg-g4# sysctl hw.ofwfb.relax_mmap=1
hw.ofwfb.relax_mmap: 0 -> 1
Now, let's see if we can get Xorg to work. Here goes:
Xorg -configure -retro
Nope - the machine still hangs.
2011-01-21: I upgraded to FreeBSD 8.2-prerelease, using csup and make world (which takes a long time on this machine). dmesg output: normal, verbose. Use set boot_verbose=yes in the boot loader to get a verbose boot. For some reason it doesn't want to load the snd_ai2s module, it just reports "KLD file snd_ai2s.ko is missing dependencies". But kldload snd_ai2s works fine. Strange. Ok, it seems that I need to load the sound module also. So, in /boot/loader.conf:
sound_load="YES"
snd_ai2s_load="YES"
and that fixed it.

2010-06-16: I finished installing Xorg and Xfce ports on the machine. Takes some time (done in spare time). But X -configure just hung the machine, I had to use the power-button to turn it off. After the reboot (and fsck) I tried sysctl hw.ofwfb.relax_mmap=1, followed by X -configure -retro, still the machine hung.

2010-06-12: I added snd_ai2s_load="YES" to /boot/loader.conf. dmesg output:
Jun 12 23:04:45 kg-g4 kernel: tumbler0: <Texas Instruments TAS3001 Audio Codec> at addr 0x68 on iicbus0
Jun 12 23:04:45 kg-g4 kernel: pcm0: <Apple I2S Audio Controller> mem 0x10000-0x10fff,0x8000-0x80ff,0x8100-0x81ff irq 30,1,2 on macio0
Jun 12 23:04:45 kg-g4 kernel: pcm0: [ITHREAD]
root@kg-g4# cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 32bit 2009061500/powerpc)
Installed devices:
pcm0: <Apple I2S Audio Controller> (play) default

2010-06-12: I used instructions from the powerpc page on the wiki, and installed FreeBSD 8.1-beta1 on my G4. dmesg output: normal, verbose. First I manually deleted all partitions with gpart delete ... (for some reason 'gpart destroy ad1' just said busy), then I created new ones as follows:
gpart add -s 800K -t '!Apple_Bootstrap' ad1 (ad1s2, the bootstrap partition)
gpart add -s 1G -t freebsd-ufs ad1 (ad1s3, root partition)
gpart add -s 4G -t freebsd-swap ad1 (ad1s4, swap)
gpart add -s 9G -t freebsd-ufs ad1 (ad1s5, /var)
gpart add -s 512M -t freebsd-ufs ad1 (ad1s6, /tmp)
gpart add -t freebsd-ufs ad1 (ad1s7, used the rest (113G) for /usr)
After that I had to reboot and start over, as the new partition wasn't showing in "Label" in sysinstall. After a reboot, back into sysinstall, using label and "C"reate to mount partitions, then install as usual.
A final step, go back to the menu, start another shell, and then copy the "bootcode" over: dd if=/boot/boot1.hfs of=/dev/ad1s2. When rebooting, just hold down the Alt key (or "Option" in Apple-speak) and you can select the drive to boot from with the mouse. Cool!
root@kg-g4# gpart show ad1
=>       14  268435441  ad1  APM  (153G)
         14       1600    1  apple-boot  (800K)
       1614    2097152    2  freebsd-ufs  (1.0G)
    2098766    8388608    3  freebsd-swap  (4.0G)
   10487374   18874368    4  freebsd-ufs  (9.0G)
   29361742    1048576    5  freebsd-ufs  (512M)
   30410318  238025137    6  freebsd-ufs  (113G)
root@kg-g4# df -h
Filesystem    Size    Used   Avail Capacity  Mounted on
/dev/ad1s3    989M    157M    753M    17%    /
devfs         1.0K    1.0K      0B   100%    /dev
/dev/ad1s6    496M     26K    456M     0%    /tmp
/dev/ad1s7    110G    159M    101G     0%    /usr
/dev/ad1s5    8.7G    328K    8.0G     0%    /var
root@kg-g4# swapinfo -h
Device          1K-blocks     Used    Avail Capacity
/dev/ad1s4        4194304       0B     4.0G     0%
pciconf -lv output:
root@kg-g4# pciconf -lv
hostb0@pci0:0:11:0:    class=0x060000 card=0x00000000 chip=0x002d106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'AGP Bridge (UniNorth 1.5)'
    class      = bridge
    subclass   = HOST-PCI
vgapci0@pci0:0:16:0:    class=0x030000 card=0xa5b80208 chip=0x011010de rev=0xa1 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'NVIDIA GeForce2 MX/MX 400 (NV11)'
    class      = display
    subclass   = VGA
macio0@pci1:0:23:0:    class=0xff0000 card=0x00000000 chip=0x0022106b rev=0x03 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'Keylargo Mac I/O Controller'
none0@pci1:0:19:0:    class=0x040100 card=0x10001073 chip=0x10001073 rev=0x00 hdr=0x00
    vendor     = 'Yamaha Corporation'
    device     = 'Sound system (SW1000XG)'
    class      = multimedia
    subclass   = audio
ohci0@pci1:0:24:0:    class=0x0c0310 card=0x00000000 chip=0x0019106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'KeyLargo USB'
    class      = serial bus
    subclass   = USB
ohci1@pci1:0:25:0:    class=0x0c0310 card=0x00000000 chip=0x0019106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'KeyLargo USB'
    class      = serial bus
    subclass   = USB
hostb1@pci1:0:11:0:    class=0x060000 card=0x00000000 chip=0x002e106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'PCI Bridge (UniNorth 1.5)'
    class      = bridge
    subclass   = HOST-PCI
fwohci0@pci2:0:14:0:    class=0x0c0010 card=0x581111c1 chip=0x581111c1 rev=0x00 hdr=0x00
    vendor     = 'Lucent/Agere Systems (Was: AT&T MicroElectronics)'
    device     = '1394A PCI PHY/Link Open Host Ctrlr I/F (FW322)'
    class      = serial bus
    subclass   = FireWire
gem0@pci2:0:15:0:    class=0x020000 card=0x00000000 chip=0x0021106b rev=0x01 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'UniNorth GMAC'
    class      = network
    subclass   = ethernet
hostb2@pci2:0:11:0:    class=0x060000 card=0x00000000 chip=0x002f106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'Internal PCI (UniNorth 1.5)'
    class      = bridge
    subclass   = HOST-PCI

Old work log follows..
2007-11-03: tried to install the xorg 7.3_1 port. But xorg-server 1.4_2 fails (see output). The files it complains about are there. Strange.

2007-10-30: upgraded to 7.0-BETA1 (RELENG_7) - dmesg.

2007-07-15: Since smartctl in FreeBSD reports that drive ad0 (the OS X drive) is a DeskStar 60GXP Series, I tried running Apple's Hard Drive Update 1 in OSX, unfortunately, it just says that it can't find any drives to update.
2007-07-15: Ok, booting FreeBSD now works again. The machine now runs the latest current (dmesg), and uname -a reports: tingo@kg-g4$ uname -a
FreeBSD kg-g4.kg4.no 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Sat Jul 14 23:57:02 CEST 2007 root@kg-g4.kg4.no:/usr/obj/usr/src/sys/GENERIC powerpc

2007-07-15: tried to boot my newly built and installed world. Unfortunately, my G4 suddenly decided that the OSX disk was "bad" somehow and refused to boot from it. I tried with apple Hardware Test, but it just said "data storage: no errors" - bah. finally, I opened up the machine and re-seated all the connectors on the disks. After that, the machine booted OSX again. I took the oppurtunity to install some security fixes in OSX as well.

2007-07-14: cvsup'ed -CURRENT and started to make world.

2007-01-29: X (Xorg) now works, using this xorg.conf. Here is the Xorg.0.log log file. I use a cheap 17 inch monitor which can do 1280x1024. Autodetectetion of monitor modes fail, so I specify modes explicitly in /etc/X11/xorg.conf.
2007-01-29: A few days back, the OSX hard drive in the G4 nearly died. As OSX is needed to boot FreeBSD, I better save the boot script I use to boot FreeBSD. freebsd.tbxi came from the freebsd-ppc mailinglist sometime ago. It works like this: if the space key is pressed during boot, FreeBSD is booted. If no keys are pressed, OSX boots.

2007-01-20: I was getting a bit tired of the quite noisy fans of my G4. I disassembled the machine and found out that it has two fans: a case fan (Delta Electronics Sensflow, model WFC1212B, 120 mm x 120mm x 25 mm, 12V DC, 0.44A) and a PSU fan (Delta Electronics, model ASB0812HH, 80mm x 80 mm x 25 mm, 12V DC, 0.30A). Both fans were securely fastened with four screws directly to metal. So I found some soft material and put between the four corners of each fan and the metal. after assembling the machine it has now become a lot quieter.

2007-01-14: the January 2007 snapshot (7.0-CURRENT-200701-powerpc-disc1.iso) boots, even with the 'C' key. A binary upgrade worked well (note: you will have to use the 'Create' option in the fdisk editor, and then turn off the newfs flag afterwards), and the machine now runs the 200701 snapshot: dmesg.
2007-01-14: tried the 6.2-RC2 image (6.2-RC2-powerpc-disc1.iso) - it would hang when booting with 'C', but booting from OF with boot cd:,\boot\loader cd:0 works fine.

2006-10-22: tried the October 2006 snapshot of 7.0, butit just hangs after booting with these lines:
KDB: debugger backends: ddb
KDB: current backend: ddb
It doesn't matter if I boot with the 'C' key on the keyboard, or break into OF and use
0 > boot cd:,\boot\loader cd:0

2006-08-30: tried installing the August 2006 snapshot of 7.0. The -disk1 CD will not boot, but the -bootonly (7.0-CURRENT-200608-powerpc-bootonly) image boots. unfortunately, the kernel panics on my machine after booting.

2006-08-29: installed the bsdstats (sysutils/bsdstats) port on my machine, and discovered that sysctl hw.model is empty.

2006-03-28: after installing about 65 ports, both large and small, I found that installing the a2ps-a4 port (using 'portinstall -R a2ps-a4') results in a kernel panic. This panic is reproducible. I ran Apple Hardware Test (both quick and extended) on the machine to be sure that the hardware is ok - it checked out fine.

2006-03-26: dmesg from the 7.0-20051105 snapshot installed on the machine. DMA for the ATAT controler in the Mac is not implemented, so all disks and CD-RW runs in PIO mode.

Disks:
ad0 OS X
ad1 FreeBSD
ad1s10 /
ad1s12 swap

2006-03-24: I got the machine.

Early in 2006, I bought a used PowerMac G4 for the purpose of testing FreeBSD/ppc on it. From the information I have found, it looks like it is a Power Macintosh G4 (Digtal Audio) model.

Specifications are as follows:
cpu: G4 @ 533 Mhz
ram: 512 MB (all 3 slots filled)
disk drives: OSX on a 60 GB, FreeBSD on a 160 GB
an (unsupported) sound card