Sunday, April 30, 2006

OpenBSD on Intel Mac Mini

Mac MiniToday I started trying to load OpenBSD on my Intel Mac Mini.

A couple weeks ago, I loaded Apple's Boot Camp to dual boot with Windows XP. It was neat. But I don't really care to run Windows on my Mac.

Now that Boot Camp is on my computer, though, I figured I could probably get OpenBSD installed. I tried installing from my OpenBSD 3.9 CD first. But it wouldn't boot past USB device scanning. I downloaded a a 3.9 snapshot from April 29, 2006, and OpenBSD installed. But...



OpenBSD did not recognize my network card or any USB thumb drives (1.1 & 2.0) that I attached to my computer. Interestingly, though, it DID recognize my Bluetooth keyboard. I was very happy with that. I'm not sure when it recognized it because assuming it wouldn't be able to use it, I attached a USB keyboard.

I was able to get packages (like cdrtools to burn CDs) on my machine by burning them to a CD-RW. Then, I got my dmesg from OpenBSD by burning it to a CD-RW.

Below is my dmesg:
OpenBSD 3.9-current (GENERIC.MP) #678: Sun Apr 23 19:08:27 MDT 2006
deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Genuine Intel(R) CPU T2300 @ 1.66GHz ("GenuineIntel" 686-class) 1.67 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,
CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,VMX,EST,TM2
real mem = 1040588800 (1016200K)
avail mem = 942641152 (920548K)
using 4278 buffers containing 52133888 bytes (50912K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(00) BIOS, date 07/29/05
pcibios at bios0 function 0x1a not configured
bios0: ROM list: 0xc0000/0xe600!
cpu0 at mainbus0: (uniprocessor)
cpu0: Genuine Intel(R) CPU T2300 @ 1.66GHz ("GenuineIntel" 686-class) 1.67 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,
CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,VMX,EST,TM2
cpu0: Enhanced SpeedStep 1000 MHz (1404 mV): unknown EST cpu, no changes possible
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "Intel 82945GM MCH" rev 0x03
vga1 at pci0 dev 2 function 0 "Intel 82945GM Video" rev 0x03: aperture at 0x90380000, size 0x8000000
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
vendor "Intel", unknown product 0x27a3 (class DASP subclass Time and Frequency, rev 0x03) at pci0 dev 7 function 0 not configured
"Intel 82801GB HD Audio" rev 0x02 at pci0 dev 27 function 0 not configured
ppb0 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x02
pci1 at ppb0 bus 1
skc0 at pci1 dev 0 function 0 "Marvell Yukon 88E8053" rev 0x22, Marvell Yukon-2 EC rev. A3 (0x2): irq 11
sk port A at skc0 not configured
ppb1 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x02
pci2 at ppb1 bus 2
"Atheros AR5424" rev 0x01 at pci2 dev 0 function 0 not configured
uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x02: irq 11
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x02: irq 11
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x02: irq 11
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x02: irq 10
usb3 at uhci3: USB revision 1.0
uhub3 at usb3
uhub3: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub3: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x02: irq 11
usb4 at ehci0: USB revision 2.0
uhub4 at usb4
uhub4: Intel EHCI root hub, rev 2.00/1.00, addr 1
uhub4: 8 ports with 8 removable, self powered
ppb2 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xe2
pci3 at ppb2 bus 3
"AT&T/Lucent FW322 1394" rev 0x61 at pci3 dev 3 function 0 not configured
ichpcib0 at pci0 dev 31 function 0 "Intel 82801GBM LPC" rev 0x02: PM disabled
pciide0 at pci0 dev 31 function 1 "Intel 82801GB IDE" rev 0x02: DMA, channel 0 configured to compatibility, channel 1 configured to compatibility
atapiscsi0 at pciide0 channel 0 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <matshita , DVD-R UJ-846, FM3J> SCSI0 5/cdrom removable
cd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 4
pciide0: channel 1 disabled (no drives)
pciide1 at pci0 dev 31 function 2 "Intel 82801GBM SATA" rev 0x02: DMA, channel 0 configured to native-PCI, channel 1 configured to native-PCI
pciide1: using irq 11 for native-PCI interrupt
wd0 at pciide1 channel 0 drive 1: <st9120821as>
wd0: 16-sector PIO, LBA48, 114473MB, 234441648 sectors
wd0(pciide1:0:1): using PIO mode 4, Ultra-DMA mode 5
ichiic0 at pci0 dev 31 function 3 "Intel 82801GB SMBus" rev 0x02: irq 11
iic0 at ichiic0
isa0 at ichpcib0
isadma0 at isa0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <pc speaker>
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: using exception 16
biomask ffff netmask ffff ttymask ffff
pctr: 686-class user-level performance counters enabled
mtrr: Pentium Pro MTRR support
ehci_sync_hc: tsleep() = 35
ehci_sync_hc: tsleep() = 35
ehci_sync_hc: tsleep() = 35
ehci_sync_hc: tsleep() = 35
ehci_sync_hc: tsleep() = 35
ehci_sync_hc: tsleep() = 35
uhub4: device problem, disabling port 3
ehci_sync_hc: tsleep() = 35
ehci_sync_hc: tsleep() = 35
ehci_sync_hc: tsleep() = 35
ehci_sync_hc: tsleep() = 35
ehci_sync_hc: tsleep() = 35
ehci_sync_hc: tsleep() = 35
uhub4: device problem, disabling port 5
uhidev0 at uhub2 port 2 configuration 1 interface 0uhidev1 at uhub3 port 1 configuration 1 interface 0
uhidev1: Apple Computer ADB device, rev 2.00/19.65, addr 2, iclass 3/1


uhidev0: Microsoft Microsoft Wheel Mouse Optical\M-., rev 1.10/1.21, addr 2, iclass 3/1
ukbd0 at uhidev1: 8 modifier keys, 6 key codes
ums0 at uhidev0: 3 buttons and Z dir.
wsmouse0 at ums0 mux 0
wskbd0 at ukbd0: console keyboard, using wsdisplay0
uhidev2 at uhub3 port 1 configuration 1 interface 1
uhidev2: Apple Computer ADB device, rev 2.00/19.65, addr 2, iclass 3/1
ums1 at uhidev2: 5 buttons
wsmouse1 at ums1 mux 0
uhidev3 at uhub3 port 2 configuration 1 interface 0
uhidev3: Apple Computer, Inc. IR Receiver, rev 2.00/1.10, addr 3, iclass 3/0
uhidev3: 38 report ids
uhid0 at uhidev3 reportid 36: input=4, output=0, feature=0
uhid1 at uhidev3 reportid 37: input=4, output=0, feature=0
uhid2 at uhidev3 reportid 38: input=4, output=0, feature=0
dkcsum: wd0 matches BIOS drive 0x80
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302

17 comments:

  1. A couple of additional notes:

    You'll notice that I used an MP kernel. The only difference in the dmesg from the non-MP kernel is what you would expect to see in the difference between bsd & bsd.mp dmesg on single processor machines.

    This means that even with bsd.mp, it does not recognize the dual core processor as two processors.

    I connected a Linksys USB100TX with MP and non-MP kernels. OpenBSD did not even recognize the new USB device with the MP kernel. With the non-MP kernel, I was able to get an IP address, but as soon as I started using the axe0 device, the whole system (running X) froze.

    I'm back in OS X for now.

    -ME

    ReplyDelete
  2. After _many_ hours of tinkering, I got the 4.0 beta to run on my mac mini core duo (note to openBSD team: what's against having a bootable installer ISO with all packages on it? now I had to swap CD's, which is kinda tricky with a mac mini not running OS X).

    Still both ethernet and wifi are unsupported, so there is not much of a point to running OpenBSD on a Mac mini yet. It'd probably be too insecure anyway: to easy to steal...

    Well, on to trying Solaris.

    ReplyDelete
  3. buis: swapping CDs is actually pretty easy. Running "eject cd0" does the trick.

    As for the Ethernet & Wifi: the vendors haven't made documentation available to the developers.

    I haven't tried in a while. Thanks for the update. I've been using Parallels anyway. OpenBSD works great and you don't have to reboot.

    ReplyDelete
  4. I'll try the same soon, OpenBSD on an Intel Mac mini, and it seems that your Marvell Yukon 88E8053 gigabit ethernet is supported by OpenBSD-current now, at least you can find the card's name on this man page now: http://www.openbsd.org/cgi-bin/man.cgi?query=sk&arch=i386&sektion=4

    Thank you for this interesting thread! :-)

    Tas.

    ReplyDelete
  5. I've been watching that progress and tested a couple snapshots around August 18th without success (even posted to misc@ about it: http://marc.theaimsgroup.com/?l=openbsd-misc&m=115586306206162&w=2)

    I'll see about trying a new snapshot again in the next few days and see how it goes. If I could get on the network, that would rock!

    ReplyDelete
  6. > If I could get on the network, that would rock!

    Indeed, that would be awesome! :-) I plan to send an OpenBSD-ified Mac mini to a colocation service in a few weeks, so network connectivity is essential for me. The CoreDuo problems (only one core detected) can be fixed later, but network problems can not. So if it doesn't work at all with the Intel, I'll have to use an old G4 for that...

    Tas.

    ReplyDelete
  7. Hello, it's me again. :-)

    I've my Intel Mac mini now, and of course I tried to install OpenBSD already. Worked fine from CD without network, though as soon as I try to bring the network up, I get the same hanging system as you described in your link above. :-/

    I tried it with both OpenBSD 4.0 release version and latest snapshot (from Oct. 31, 2006), and with both GENERIC kernel and GENERIC.MP kernal, without success. I asked Mark about the patches now, he posted about them in the reply to your post. Hopefully they'll help...

    Do you have any news regarding this? Or regarding support for the second CPU core?

    Tas.

    ReplyDelete
  8. I've tried with new snapshots with both kernels and have the same problem you're having.

    I never have seen generic.mp recognize the second CPU. I imagine it's related to the EFI/BIOS issues that kettenis@ mentioned.

    ReplyDelete
  9. Did you see this post (and the whole thread)? http://marc.theaimsgroup.com/?l=openbsd-misc&m=116328147221334&w=2

    No success with that so far, one of the new files created by the patch doesn't compile here (with -current source tree).

    Though it works already with NetBSD, even with both CPU Cores...: http://mail-index.netbsd.org/port-i386/2006/10/07/0000.html But that's not OpenBSD

    ReplyDelete
  10. > I never have seen generic.mp recognize the second CPU.

    That will change now: http://marc.theaimsgroup.com/?l=openbsd-misc&m=116347120704233&w=2

    Marvell Yukon NIC, *both* CPU cores, USB pen drives - everything I need (and even more) works now on my Mac mini! YAY! :-D

    I'll be online soon with my perfect Mac mini OpenBSD server. :-D

    A happy Tas.

    ReplyDelete
  11. Tas! Thanks for keeping us updated here. I haven't had time to play.

    Does this patch -current or 4_0_RELEASE?

    I'm going to hopefully try this out this weekend.

    ReplyDelete
  12. > In addition the patch creates two new files

    Um, not two but three files. Sorry! ;-)

    And maybe I should also link directly to Mark's patch here, I hope that's ok (probably there won't be that many downloads ;-) ): http://www.xs4all.nl/~sibelius/acpi-apic.diff

    Tas.

    ReplyDelete
  13. Just to keep you all updated (all? Are there more OpenBSD-on-Mac-mini fans? ;-) ): I've found a small problem:

    My Mac mini doesn't feel like booting without a monitor plugged in (headless server) with just OpenBSD on the harddisk. Works fine with OS X though. Boot Camp (this little 200MB EFI partition) doesn't help.

    The monitor doesn't have to be switched on to make the mini boot, it just needs to be plugged in. That fact leaded me to a hardware fix:

    A 75 ohm resistor (100 ohm works also) as load between pin 2 and pin 7 of a 15 pin highdensity D-SUB male connector (with DVI to VGA adapter) or between pin C2 and C5 of a 29 pin DVI male connector as a dongle for the DVI/VGA port (that's between analog green and analog ground, 75 ohm is the standard load for that output pin). Just plug in the dongle and the mini will boot happily also without a monitor. :-)

    A question : Does anybody know a software fix for that? Obviously the video card doesn't get initialized properly (or not at all) without OS X on the harddisk.

    Tas.

    ReplyDelete
  14. > A question : Does anybody know a software fix for that?

    Obviously there isn't a software fix: http://www.mythic-beasts.com/support/macminicolo_howto.html

    I've another tip for you (all? :p ) to make the mini boot after (remote) power cycling using OpenBSD's pcitweak (setpci as described in the link above doesn't work on OpenBSD): http://marc.theaimsgroup.com/?l=openbsd-misc&m=116443142317676&w=2

    Tas.

    ReplyDelete
  15. Hi Folks,

    Does anyone have an update on this? I've checked out -current from CVS (30/01/2007) however Marks DIFF no longer applies. Patch infers that the changes have already been committed? Is this correct?

    I've tried building a standard GENERIC.MP kernel from -current with ACPI enabled but this doesn't work on the Mini, i.e. single cpu only and no networking.

    Thanks in advance for any replies.

    Simon

    ReplyDelete
  16. Since this comes up in Google searching better post the current status. The Mac Mini is supported, but you need a ACPI kernel to get networking and MP support. What I did was install via CD, but do not enable networking in the install, burn the 4.1 stable source to CD copy that to the hard drive, build a kernel with ACPI and MP support, reboot, and presto chango, networking and MP support.

    Here's what I changed from the GENERIC kernel:


    # diff -u GENERIC MACMINI
    --- GENERIC Wed Feb 28 14:54:43 2007
    +++ MACMINI Wed May 23 16:08:45 2007
    @@ -57,20 +57,20 @@
    eisa0 at mainbus0
    pci* at mainbus0

    -#option ACPIVERBOSE
    -#option ACPI_ENABLE
    +option ACPIVERBOSE
    +option ACPI_ENABLE

    -acpi0 at mainbus? disable
    -#acpitimer* at acpi?
    -#acpihpet* at acpi?
    -#acpiac* at acpi?
    -#acpibat* at acpi?
    -#acpibtn* at acpi?
    -#acpicpu* at acpi?
    -#acpidock* at acpi?
    +acpi0 at mainbus?
    +acpitimer* at acpi?
    +acpihpet* at acpi?
    +acpiac* at acpi?
    +acpibat* at acpi?
    +acpibtn* at acpi?
    +acpicpu* at acpi?
    +acpidock* at acpi?
    acpiec* at acpi? disable
    acpiprt* at acpi?
    -#acpitz* at acpi?
    +acpitz* at acpi?

    option PCIVERBOSE
    option EISAVERBOSE
    @@ -716,3 +716,11 @@
    # mouse & keyboard multiplexor pseudo-devices
    pseudo-device wsmux 2
    pseudo-device crypto 1
    +
    +# Turn on SMP support
    +option MULTIPROCESSOR # Multiple processor support
    +
    +cpu* at mainbus?
    +ioapic* at mainbus?
    +acpimadt0 at acpi?

    ReplyDelete
  17. [...] 14 by TasDevil on this blog post summarizes the problem and the solution — put a resistor in the range of 75Ω across the [...]

    ReplyDelete