Booting FreeBSD 8.2 on a MacBookPro7,1
The problem
Apple's EFI firmware will not boot a BIOS-compatibility partition
that is located on a USB device.
For the BIOS-compatibility code to boot a partition, it must be
on a "hard disk" or be on a bootable ISO 9660 CD/DVD.
This means that the FreeBSD "memstick" image isn't directly bootable.
If you're reading this page it's probably because the other installers
won't work for you either.
There is a disagreement between many FreeBSD releases and the way the
Apple firmware sets up (or doesn't) the NVIDIA MCP89 AHCI controller chip,
so the firmware will boot the CD/DVD, and the BTX loader can use the
BIOS to pull in the kernel, but then the kernel won't see any disks,
which makes it hard to do an install.
The workaround
A FreeBSD committer, jkim, is working on patches for the FreeBSD
disk device drivers. I have built a kernel with one of these patches
(apple_mcp89.diff)
and updated the standard 8.2-RC2 "memstick" image by replacing the
kernel with a patched one.
In theory you can use
this image
to install FreeBSD on your machine.
But that's only after you can get it booted, i.e., get past the
"too bad it's USB" hurdle.
Booting instructions
- Blast the image onto a USB "disk" (I have used both a "thumb drive" and an SD card in an adaptor)
- Insert FreeBSD CD/DVD, restart, hold down "c" while the screen is black
- Hit 6 for command prompt (ok to do this while it's still loading the default kernel)
- At the ok prompt, type unload
- Then type lsdev and find your "memstick" (probably "disk1")
- set currdev=disk1s0
- load /boot/kernel/kernel
- load -t mfs_root /boot/mfsroot (the actual filename is /boot/mfsroot.gz, but you must not type the ".gz"!)
- lsmod and make sure you see "/boot/mfsroot (mfs_root, 0x400000)".
- boot -a
- At the mountroot> prompt, type ufs:/dev/md0 to run the installer;
you can also type ufs:/dev/da1a to boot the distribution image,
which is more featureful than the installer's "Emergency Holographic Shell" but maybe more confusing.
If this works for you, please chime in on
the
relevant FreeBSD Forums thread. Thanks!
8.2-RELEASE "playground" memstick image
This image can be used as a "playground":
it is the official 8.2 "memstick" image edited so it occupies 2G and has a "b" slice which
can be used for /usr/src plus a FAT-32 "d" partition which can be used for swapping
files back and forth with OS X.
8.2-RELEASE installer memstick image
I tried applying
jkim's
a second patch
against 8.2-RELEASE, but it didn't work.
So
this image is the standard 8.2-RELEASE "memstick" installer with /boot/kernel replaced. After you complete your install, you will want to replace the stock GENERIC /boot/kernel with the one in /dist.
Open issues (2011-02-16)
- On my machine, the bge0 wired Ethernet driver doesn't really work:
transmit interrupts aren't delivered.
The next thing to try is finding a loader.conf incantation to
tell that driver not to use MSI's, but I haven't tracked that
down yet (I have a USB wired Ethernet interface that works fine).
- You don't want to hit "caps lock",
because it takes the keyboard driver several seconds to turn the LED
on or off.
- Once in a while it crashes instead of booting (an infinite stream of
fault messages scrolls by on the console).
- For some reason, shutdown -r causes the system to complain
bitterly on the way back up that the root file system wasn't cleanly
unmounted. Workaround: shutdown, then mount -r /,
then reboot/halt/lean on the power button.
- Amusingly enough, sometimes when you try to halt the system,
after everything is
quiet some ACPI event kicks off a round of USB device enumeration and
everything gets weird.
- ACPI suspend doesn't work. Well, it's actually resume that
doesn't work, but you know what I mean. I'll try disabling the second
core to see if that helps.
Good luck!
[Back]