There is a lot of confusion around the ability to boot Windows 7 using UEFI on a Macintosh. The confusion is based on the interaction with Bootcamp, MDR, GPT, BIOS Compatability Support Modules (CSM), rEFIt, 32-bit, install DVD formats, and bugs, combined with the inherent difficulty in understanding and debugging boot processes.
- Windows 7 x64 (64-bit) will NOT boot natively using UEFI on a Macintosh!
- Windows 7 x64 (64-bit) only supports installation on a UEFI 2.0 firmware using a GPT partitioned disk.
- The Windows 7 x64 installation DVD is built with support for both BIOS (default) and EFI installation. During setup it is not obvious which version was used.
- Windows 7 will only install on an MBR disk if booted using BIOS firmware.
- Windows 7 will only install on a GPT disk if booted using EFI firmware.
- Apple Macintoshes implement the EFI 1.1 standard, either 32-bit for early (pre-2008) Intel processors or 64-bit for more recent processors.
- The Mac UEFI firmware contains a legacy CSM that presents a BIOS interface to allow non-UEFI aware OSes to boot and install.
- Windows 7 x86 and x64 can be installed natively on a Mac in BIOS mode without MacOS or Bootcamp, but MacOS will not boot in BIOS mode.
- Bootcamp is:
- Set of Windows device drivers
- Partitioning tool and MBR hacker
- BIOS Compatability Support Modules in firmware
I purchased a Mac Mini (2.26 Ghz Intel Core 2 Duo, 4 GB DRAM, 320 GB disk) as a small compact desktop to primarily run Windows, but also support a few applications that had been previously running on an old PPC iMac. Primary purchasing decision factors included size, performance, and cost. I don’t have a lot of space in my home office so having a single large screen monitor that I can share is ideal. This ruled out the all-in-one systems like the iMac. I don’t need expandability beyond USB and Firewire, so space for extra PCI cards is wasted. I don’t play serious PC games (XBox if anything) so I only need a adequate 3D graphics. But I need more performance than what a Nettop (aka Atom based) system provides. Thus I ended up considering a number of systems (including a Dell Studio Hybrid), but when all things were balanced out, the Mac Mini had more features for less than a $100 price difference (sorry Steve).
Why Use UEFI?
I am an operating systems geek (Windows and Solaris) who has written more than my share of low level boot code. So with knowledge of Windows 7 support of UEFI, Macintosh support of UEFI, the idea of using Bootcamp tools to provide legacy BIOS support was just distasteful to me. I understand how useful it is for people wanting to run ancient Windows XP, but in the modern world of Windows 7 and Snow Leopard why bother with BIOS firmware? Not to mention 2 TB disks are rapidly approaching $100 and are too big for MBR partitioning. So all this modern technology should allow Windows and MacOS to live happily together in the UEFI world…
Keep It Simple
Of course the first thing anyone should do is to try the obvious, given that Windows 7 isn’t even available for retail systems yet I figured there hasn’t been much experimentation. So I inserted the Windows 7 x64 RTM DVD and booted holding the Alt/Option key, then I selected “EFI Boot” only to discover that just boots MacOS. Try again, this time I selected “Windows”. Success! The Windows 7 installation screens!
Not so fast…
Going through the Custom install menus to the disk screen, all of the partitions are unavailable with the error “The selected partition is of the GPT partition style.” Of course it is GPT, that is what I want. Something is wrong.
A little detective work later I discover that Windows will only install on a GPT partitioned disk if it has been booted using EFI, conversely MBR only if booted using BIOS. The Windows 7 DVD is built using the El Torito multiboot image format, the first (and default) boot catalog image is the BIOS (platform id 0) based etfsboot.com boot code and the secondary (platform id EF) is efisys.bin, the EFI boot application. Mac firmware when it detects a BIOS boot image adds the CSM driver and boots in legacy BIOS mode. I don’t know of any way to force the Mac firmware to pick the second boot catalog image.
EFI Only DVD
If the Mac firmware insists on using the BIOS boot code when present, the obvious solution is to remove it so only the EFI image is present. Microsoft has a nice set of tools (AIK/OPK) that allows you to create custom installation images, in particular the oscdimg.exe command is used to create bootable ISO images. All I need to do is copy the DVD contents to our local disk, create a new ISO image, and burn a new DVD.
robocopy /e /copyall e: win7x64
oscdimg -w4 -os -lWin7x64_UEFI_Only -m -o -n -pEF -e -bc:win7x64efimicrosoftbootefisys.bin c:win7x64 c:Win7x64_UEFI_Only.iso
Again, boot using Alt/Option and it fails…
WinPE is the Windows Preinstallation Environment that is the stripped down version of Windows used for installation and recovery operations. Since I failed to create a EFI only installation DVD, it was logical to see if I could create a simple WinPE image. Again using the AIK and following the directions for Walkthrough: Create a Bootable Windows PE RAM Disk on CD-ROM I created a new CD.
Again, boot using Alt/Option and this time there is an “Efi Boot” but with a new icon. Selecting it and the CD starts spinning but the screen doesn’t change. Remembering that Windows prompts you to “hit return to boot” from CD, I do so causing more CD activity but ultimately it fails. Sounds like progress, but I can’t really tell.
Maybe some interesting activity or error is being hidden by the Mac graphics image? A bit of searching and there are some posts that indicate any EFI text messages will not be displayed due to the Mac being in graphics mode.
rEFIt is an open source EFI shell which is used by many Mac enthusiasts. It solves the big problem that Apple does not ship a real EFI shell in its firmware. By downloading and installing rEFIt I can intercept the boot process and actually see what is happening.
Although Apple creates the required EFI System Partition (ESP), it does not populate it or use it for anything because its firmware already has all the required drivers (e.g. HFS+) built in (and why would you want to boot anything else?). For my experiments, I don’t want to mount or use the MacOS partitions, so I need to install rEFIt on the hidden EFI system partition using Felipe Alfaro’s “expert” directions.
Now I can boot into rEFIt and get a real EFI shell to play with. (Hint: add “-b” to commands to page output) Running the “ver” command shows that Apple has only implemented the 1.1 specification.
With the original Windows 7 installation DVD inserted, I can select fs2 and execute the BOOTx64.EFI command from the DVD:
Now I can see it going through the expected boot messages including the progress bar that indicates that it is loading the Windows files. The DVD disk sounds are similar to what I heard with the WinPE image so I suspect that previous image was correct.
But it does not boot and appears to just hang.
Rebooting into the EFI shell again, I run BOOTX64.EFI again, but this time I hit F8 which brings up the boot menu asking if I want Safe Mode. I select Safe Mode with Command Shell and watch all the boot drivers being loaded, but again it fails to boot.
All of this leads me to the conclusion that I am loading Windows using EFI and getting through the early winload execution, but failing to start the NT kernel. The early winload execution and kernel image is identical between the installation image and a fully installed image, so even if I was able to install Windows in a GPT partition it will not boot using UEFI due to missing firmware features.
Reading the “UEFI Support and Requirements for Windows Operating Systems” document makes it clear that only UEFI 2.0 is supported.
Until Apple upgrades its UEFI firmware to version 2.0 or higher, Windows 7 will not natively boot on a Macintosh. Bootcamp is the only solution and Apple has little motivation to upgrade their firmware.
It appears that with the more recent Mac systems Apple is moving to UEFI 2.0. Notably the MacBook (Mid 2010), MacBook Pro (13-inch, Mid 2010), and MacBook Air (Late 2010). Logically the 2011 versions as well?
If correct, these systems should be able to native UEFI boot Windows 7 (or Windows Server 2008 R2). Anyone have an extra machine they want to send me to test?
Eventually they may catch up with the UEFI community that has already released 2.3.1.
Useful link: http://support.apple.com/kb/HT1237