Apple PowerMac G5 - FreeBSD

Hardware info on main page.

This machine is tested with (runs) FreeBSD / ppc on a internal hard drive (ad1).

Hints: use cdcontrol eject or burncd eject, boot with set hw.ata.atapi_dma=0, boot -v,

Work log

2011-01-24: I did an ofwdump -ap, here is the output. And ofwdump -pr / here is the output. Some interesting bits:

root@kg-g5# ofwdump -S -P model /
PowerMac7,3
root@kg-g5# ofwdump -S -P bootpath /chosen
/ht@0,f2000000/pci@5/k2-sata-root@c/k2-sata@1/disk@0:2,\ppc\boot1.elf
root@kg-g5# ofwdump -S -P bootargs /chosen
/ht@0,f2000000/pci@5/k2-sata-root@c/k2-sata@1/disk@0:3
root@kg-g5# ofwdump -S -P dimm-types /memory
DDR SDRAM
root@kg-g5# ofwdump -S -P dimm-speeds /memory
PC3200U-30330

info about openprom

root@kg-g5# ofwdump -pr /openprom
Node 0xff891fa8: openprom
  name:
    6f 70 65 6e 70 72 6f 6d 00
    'openprom'
  device_type:
    42 6f 6f 74 52 4f 4d 00
    'BootROM'
  model:
    4f 70 65 6e 46 69 72 6d 77 61 72 65 20 34 00
    'OpenFirmware 4'
  relative-addressing:
  supports-bootinfo:
  boot-syntax:
    00 00 00 01
  Node 0xff892108: client-services
    name:
      63 6c 69 65 6e 74 2d 73 65 72 76 69 63 65 73 00
      'client-services'

info about the ROM:

root@kg-g5# ofwdump -S -P model /rom/boot-rom
Apple PowerMac7,3 5.1.8f7 BootROM built on 10/26/04 at 16:30:32
root@kg-g5# ofwdump -S -P BootROM-version /rom/boot-rom
$0005.18f7
root@kg-g5# ofwdump -S -P BootROM-build-date /rom/boot-rom
10/26/04 at 16:30:32

info about options:

root@kg-g5# ofwdump -S -P little-endian? /options
false
root@kg-g5# ofwdump -S -P real-mode? /options
false
root@kg-g5# ofwdump -S -P auto-boot? /options
true
root@kg-g5# ofwdump -S -P diag-switch? /options
false
root@kg-g5# ofwdump -S -P fcode-debug? /options
false
root@kg-g5# ofwdump -S -P oem-banner? /options
false
root@kg-g5# ofwdump -S -P oem-logo? /options
false
root@kg-g5# ofwdump -S -P use-nvramrc? /options
false
root@kg-g5# ofwdump -S -P use-generic? /options
false
root@kg-g5# ofwdump -S -P default-mac-address? /options
false
root@kg-g5# ofwdump -S -P scroll-lock /options
true
root@kg-g5# ofwdump -S -P skip-netboot? /options
false
root@kg-g5# ofwdump -S -P real-base /options
-1
root@kg-g5# ofwdump -S -P real-size /options
-1
root@kg-g5# ofwdump -S -P load-base /options
0x800000
root@kg-g5# ofwdump -S -P virt-base /options
-1
root@kg-g5# ofwdump -S -P virt-size /options
-1
root@kg-g5# ofwdump -S -P logger-base /options
-1
root@kg-g5# ofwdump -S -P logger-size /options
-1
root@kg-g5# ofwdump -S -P pci-probe-mask /options
-1
root@kg-g5# ofwdump -S -P screen-#columns /options
100
root@kg-g5# ofwdump -S -P screen-#rows /options
40
root@kg-g5# ofwdump -S -P selftest-#megs /options
0
root@kg-g5# ofwdump -S -P boot-volume /options
3
root@kg-g5# ofwdump -S -P boot-device /options
first-boot/@0:3,\\:tbxi
root@kg-g5# ofwdump -S -P boot-file /options

root@kg-g5# ofwdump -S -P boot-screen /options
screen
root@kg-g5# ofwdump -S -P console-screen /options
screen

More options (not all of them interesting):

root@kg-g5# ofwdump -S -P diag-device /options
enet
root@kg-g5# ofwdump -S -P diag-file /options
,diags
root@kg-g5# ofwdump -S -P input-device /options
keyboard
root@kg-g5# ofwdump -S -P output-device /options
screen
root@kg-g5# ofwdump -S -P input-device-1 /options
scca
root@kg-g5# ofwdump -S -P output-device-1 /options
scca
root@kg-g5# ofwdump -S -P mouse-device /options
mouse
root@kg-g5# ofwdump -S -P oem-banner /options

root@kg-g5# ofwdump -S -P oem-logo /options

root@kg-g5# ofwdump -S -P nvramrc /options

root@kg-g5# ofwdump -S -P boot-command /options
mac-boot
root@kg-g5# ofwdump -S -P ram-size /options
0x2000000

even more info:

root@kg-g5# ofwdump -r /packages
Node 0xff8938d8: packages
  Node 0xff893cc8: deblocker
  Node 0xff894618: disk-label
  Node 0xff895098: obp-tftp
  Node 0xff89fc68: telnet
  Node 0xff8a0520: mac-parts
  Node 0xff8a1e48: mac-files
  Node 0xff8a4fc0: hfs-plus-files
  Node 0xff8aa268: fat-files
  Node 0xff8ad008: iso-9660-files
  Node 0xff8ade20: bootinfo-loader
  Node 0xff8afa88: xcoff-loader
  Node 0xff8b0560: macho-loader
  Node 0xff8b33d0: pe-loader
  Node 0xff8b3dd8: elf-loader
  Node 0xff8b5d20: usb-hid-class
  Node 0xff8b8870: usb-ms-class
  Node 0xff8bb540: usb-audio-class
  Node 0xff929048: ata-disk
  Node 0xff92b610: atapi-disk
  Node 0xff92daf0: sbp2-disk
  Node 0xff931508: bootpath-search
  Node 0xff9380f8: terminal-emulator

something about the nvram:

root@kg-g5# ofwdump -S -P compatible /nvram
sharp-B0ED

There is still more, but I'm tired of this.

2011-01-24: info about usb devices and stuff:

root@kg-g5# usbconfig
ugen0.1: <OHCI root HUB Apple> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen1.1: <OHCI root HUB Apple> 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: <OHCI root HUB NEC> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen4.1: <EHCI root HUB NEC> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE
ugen3.2: <Hub in Apple Extended USB Keyboard Mitsumi Electric> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen3.3: <product 0x310b vendor 0x04b3> at usbus3, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
ugen3.4: <Apple Extended USB Keyboard Mitsumi Electric> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON

That device at ugen3.3 is ? Devices on PATA and SATA bus:

root@kg-g5# atacontrol list
ATA channel 0:
    Master: acd0 <PIONEER DVD-RW DVR-117D/B705> ATA/ATAPI revision 5
    Slave:       no device present
ATA channel 2:
    Master:  ad0 <Maxtor 6Y160M0/YAR51HW0> Unknown SATA revision
    Slave:       no device present
ATA channel 3:
    Master:  ad1 <SAMSUNG HD322HJ/1AG01113> SATA revision 2.x
    Slave:       no device present
ATA channel 4:
    Master:      no device present
    Slave:       no device present
ATA channel 5:
    Master:      no device present
    Slave:       no device present

ad0 is for OS X, ad1 for FreeBSD.

2011-01-23: It doesn't look like both CPUs are working. This is from dmesg:

root@kg-g5# dmesg | grep -i cpu
cpu0: IBM PowerPC 970FX revision 3.0, 1413.86 MHz
cpu0: Features dc000000<PPC32,PPC64,ALTIVEC,FPU,MMU>
cpu0: HID0 511081<NAP,DPM,NHR,TBEN,ENATTN>
ULE: setup cpu 0
cpulist0: <Open Firmware CPU Group> on nexus0
cpu0: <Open Firmware CPU> on cpulist0
pcr0: <PPC 970 Power Control Register> on cpu0
cpu1: <Open Firmware CPU> on cpulist0
pcr1: <PPC 970 Power Control Register> on cpu1
htpic0: Version 1.2, supports 4 CPUs and 120 irqs
openpic0: Version 1.2, supports 4 CPUs and 120 irqs
fcu0: Location: CPU A INTAKE type: 0 ID: 3 RPM: 1440
fcu0: Location: CPU A EXHAUST type: 0 ID: 4 RPM: 1472
fcu0: Location: CPU B INTAKE type: 0 ID: 5 RPM: 1440
fcu0: Location: CPU B EXHAUST type: 0 ID: 6 RPM: 1472

I don't see a "setup cpu 1" in there. And top -P doesn't report more than one cpu. Silly me, SMP isn't in GENERIC on PowerPC.

2011-01-23: I installed FreeBSD 9.0-current from the bsdinstall-powerpc-20110116 snapshot) on a second hard drive (ad1) in the machine. boot -v is still needed, or else FreeBSD doesn't see the hard drive after booting the kernel, and root mount fails. dmesg output: verbose. Some details:

root@kg-g5# uname -a
FreeBSD kg-g5.kg4.no 9.0-CURRENT FreeBSD 9.0-CURRENT #119 r217462M: Sat Jan 15 16:05:38 CST 2011     root@comporellon.tachypleus.net:/usr/obj/powerpc.powerpc/usr/src/sys/GENERIC  powerpc

pci info:

root@kg-g5# pciconf -lv
vgapci0@pci0:0:16:0:    class=0x030000 card=0x001010de chip=0x032110de rev=0xa1 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'NVIDIA GeForce FX 5200 Ultra (NV34)'
    class      = display
    subclass   = VGA
hostb0@pci0:0:11:0:    class=0x060000 card=0x00000000 chip=0x004b106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'U3 AGP'
    class      = bridge
    subclass   = HOST-PCI
pcib2@pci1:0:1:0:    class=0x060400 card=0x00000000 chip=0x0045106b rev=0x00 hdr=0x01
    vendor     = 'Apple Computer Inc'
    device     = 'K2 HT-PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI
pcib3@pci1:0:2:0:    class=0x060400 card=0x00000000 chip=0x0046106b rev=0x00 hdr=0x01
    vendor     = 'Apple Computer Inc'
    device     = 'K2 HT-PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI
pcib4@pci1:0:3:0:    class=0x060400 card=0x00000000 chip=0x0047106b rev=0x00 hdr=0x01
    vendor     = 'Apple Computer Inc'
    device     = 'K2 HT-PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI
pcib5@pci1:0:4:0:    class=0x060400 card=0x00000000 chip=0x0048106b rev=0x00 hdr=0x01
    vendor     = 'Apple Computer Inc'
    device     = 'K2 HT-PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI
pcib6@pci1:0:5:0:    class=0x060400 card=0x00000000 chip=0x0049106b rev=0x00 hdr=0x01
    vendor     = 'Apple Computer Inc'
    device     = 'K2 HT-PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI
macio0@pci1:1:7:0:    class=0xff0000 card=0x00000000 chip=0x0041106b rev=0x60 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'K2 KeyLargo Mac/IO'
ohci0@pci1:1:8:0:    class=0x0c0310 card=0x00000000 chip=0x0040106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'K2 KeyLargo USB'
    class      = serial bus
    subclass   = USB
ohci1@pci1:1:9:0:    class=0x0c0310 card=0x00000000 chip=0x0040106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'K2 KeyLargo USB'
    class      = serial bus
    subclass   = USB
ohci2@pci1:5:11:0:    class=0x0c0310 card=0x00351033 chip=0x00351033 rev=0x43 hdr=0x00
    vendor     = 'NEC Electronics Hong Kong'
    device     = 'Dual OHCI controllers plus Single EHCI controller (udp9210)'
    class      = serial bus
    subclass   = USB
ohci3@pci1:5:11:1:    class=0x0c0310 card=0x00351033 chip=0x00351033 rev=0x43 hdr=0x00
    vendor     = 'NEC Electronics Hong Kong'
    device     = 'Dual OHCI controllers plus Single EHCI controller (udp9210)'
    class      = serial bus
    subclass   = USB
ehci0@pci1:5:11:2:    class=0x0c0320 card=0x00e01033 chip=0x00e01033 rev=0x04 hdr=0x00
    vendor     = 'NEC Electronics Hong Kong'
    device     = 'uPD720100A/101 USB 2.0 Enhanced Host Controller'
    class      = serial bus
    subclass   = USB
ata0@pci1:2:13:0:    class=0xff0000 card=0x00000000 chip=0x0043106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'K2 ATA/100'
fwohci0@pci1:2:14:0:    class=0x0c0010 card=0x5811106b chip=0x0042106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'K2 FireWire'
    class      = serial bus
    subclass   = FireWire
gem0@pci1:3:15:0:    class=0x020000 card=0x00000000 chip=0x004c106b rev=0x00 hdr=0x00
    vendor     = 'Apple Computer Inc'
    device     = 'K2 GMAC (Sun GEM)'
    class      = network
    subclass   = ethernet
atapci0@pci1:4:12:0:    class=0x01018f card=0x02401166 chip=0x02401166 rev=0x00 hdr=0x00
    vendor     = 'ServerWorks (Was: Reliance Computer Corp)'
    device     = 'K2 SATA'
    class      = mass storage
    subclass   = ATA
atapci1@pci1:4:12:1:    class=0x010185 card=0x02401166 chip=0x02401166 rev=0x00 hdr=0x00
    vendor     = 'ServerWorks (Was: Reliance Computer Corp)'
    device     = 'K2 SATA'
    class      = mass storage
    subclass   = ATA

and what else

2011-01-23: booting from CD drive. I just learned about set hw.ata.atapi_dma=0 that you can set from the boot loader prompt, and decided to re-test all my images on CD. Sure enough, all of them now works. The images tested were: FreeBSD 8.1-release (disc1), FreeBSD 8.2-RC1 (disc1), FreeBSD 9.0-2010118-SNAP (disc1), bsdinstall-powerpc-20110116.

2011-01-21: I tested the new bsdinstaller (using the snapshot bsdinstall-powerpc-20110116) on this machine. Use Command-Option-O-F to get into OpenFirmware, then do

boot cd:,\BOOT\LOADER.;1 cd:0

the kernel boots, but gets error messages from the cd drive (after detecting the keyboard, probably when trying to mount root) and thats it. Let's try with the same image on a usb memory stick. From Open Firmware:

devalias ud /ht/pci@2/usb@b/disk@2
boot ud:,\BOOT\LOADER.;1 ud:0

As expected, it fails when trying to mount root from cd9660:/dev/acd0. But the keyboard works, and I can tell it to mount from cd9660:/dev/da0 instead (I can see that the usb memory stick is listed as da0). And now it boots! I told it do give med the LiveCD, and got a login prompt, I set up the network with

ifconfig gem0 up
dhclient gem0

Unfortunately, no dns, since /etc/ is read only, so I can't put /etc/resolv.conf there. Then I did dmesg > /tmp/some-file.txt, and used scp to copy it to another machine, like this: scp /tmp/some-file.txt user@ip-address:/directory, which gave me is useful. dmesg output: normal, verbose. Oh, and you can use sysctl dev.fcu to reset the fan watchdog, so they will quiet down.

2011-01-15: I put the FreeBSD 9.0-20101118-SNAP image on another usb stick, and booted from that. It successfully booted to the main screen, and I selected Fixit, then "from usb", and it said "no usb devices found". Bugger. I re-tried with the FreeBSD 8.2-RC1 image, also using a usb memory stick, this also booted to the main screen, I selected Fixit, then live filesystem "from usb" and it said "no usb devices found"". Bugger.

2011-01-14: I tested a CD made from the FreeBSD 9.0-20101118-SNAP image found here, but the effect was the same: no working keyboard. It was actually "worse" than the 8.2-RC1 image, because it stopped / hung before the Country Selection dialog, with output like this:

uhub_reattach_port: port 1 reset failed, error=USB_ERROR_TIMEOUT
uhub_reattach_port: device problem (USB_ERR_TIMEOUT), disabling port 4

it looks like all usb devices fails to attach (including keyboard and mouse). Other interesting output is this:

iichb0: I2C error
fcu0: iicbus read failed
fcu0: FCU initialized, RPM shift: 3
fcu0: 7 fans detected!
iichb0: I2C error
fcu0: iicbus read efailed
fcu0: RPM Fan not available ID: 3

Alas, no success with that image either.

2011-01-13: I tried booting the FreeBSD 8.2-RC1 image (disc1) from a CD. Ok, it works, but when it gets to the Country Selection dialog, the keyboard doesn't work.

2011-01-13: Today, I tried the FreeBSD 8.1-release disc1 install CD again, with load sbp (press space after the kernel has loaded, then 'load sbp' then 'boot) when booting. Which gave me this:

fatal kernel trap:

  exception = 0x03 (data storage interrupt)
  virtual address = 0xd53000
  srr0            = 0x5c3130
  srr1            = 0x3032
  lr              = 0x5be960
  curthread       = 0x83fb50
         pid = 0,  comm =

panic: data storage interrupt trap
Uptime 1s

Ouch. So I tried a straight boot from the CD again (by holding down the Option (alt) key and selecting the CD from the boot menu. Use the eject key on the keyboard to open the optical drive). This time I noticed the following output from the boot messages:

atapci0: 0x10 bytes of rid 0x20 res 4 failed (0, 0xffffffff).
atapci: <ServerWorks K2 SATA150 controller> at device 12.1 on pci6
pcib1: failed to reserver resource for atapci1
atapci1: 0x10 bytes of rid 0x20 res 4 failed (0, 0xffffffff).
atapci1: unable to map interrupt
device_attach: atapci1 attach returned 6

and the machine hangs. Next, I try to boot the machine from a usb memory stick. I generated the image like this:

root@kg-v2# dd if=/home/tingo/dl/bsd/fbsd/8.1/FreeBSD-8.1-RELEASE-powerpc-disc1.iso of=/dev/da4 bs=10240 conv=sync
34562+1 records in
34563+0 records out
353925120 bytes transferred in 190.081106 secs (1861969 bytes/sec)

It did not show up on the boot menu, so I used Command-Option-O-F to get into Open firmware. It then fiddled at lot with dev / ls and devalias in open firmware, to figure out an alias for the usb memory stick. Here it is (with the memory stick in the usb port on the front):

devalias ud /ht/pci@2/usb@b/disk@2

then i booted the machine with

boot ud:,\boot\loader ud:0

which worked. Unfortunately, at the Country Selection dialog, I found out that the keyboard wasn't working.

2011-01-10: booting a FreeBSD 8.1-release disc1 install CD by holding down "C" when (re)starting the machine works. But the cd drive (acd0) give timeouts, the machine hangs there and then the fans starts to spin up.