As part of GSoC I need to get an easy tool to create boot able usb sticks from Intel Macs. This past week I've been investigating how Macs do boot. In the process I've wiped my partition table, recovered using testdisk, plaid around with rEFIt, mac boot options, NVRAM, efi shell read tons of apple source code, and UEFI specs. Overall it's quite complex and fun =). I'll try to document as much as possible of everything I have found out in the rest of this post.
On power-on, BootROM is doing Power-on-Sefl-test and hands over to OpenFirmware on PowerPC machines, or to the EFI bootmanager (as far as I understand) on Intel Macs. The BootROM "knows" about the fancy startup keys, e.g. options key which can passes hints to OpenFirmware & EFI bootmanager on what user wants to do (e.g. clean NVRAM & PRAM, force pop-out cd, perform target-disk mode boot, netboot or present available boot drives).
OpenFirmware later on passes onto BootX and that boots OS 9 or OS X kernels & brings up init-rc / launchd. This is PowerPC. I'll stop talking about PowerPC from now on =)
The EFI bootmanager is the gray screen screen which also produces the WALL-E sound (aka mac jiggle). This EFI bootmanager brings up to live some hardware and it can read NVRAM, FAT r/w and HFS+ read-only as well as get onto network. It reads NVRAM to figure out default boot partition, picks that, reads HFS+ headers of that partition to find EFI loader (aka "blessed" loader) and passes onto that to do the rest of initialisation, brings up launchd and gets to the desktop.
This EFI bootmanager after the Boot Camp upgrade (or all recent macs) can also find mbr bootable internal "legacy" systems, emulate BIOS and boot those / make them selectable. And it is a bit stubborn =) it doesn't like identifying my LiveUSB sticks, even though when I jump through the hoops it loads. The Hoops being:
On power-on, BootROM is doing Power-on-Sefl-test and hands over to OpenFirmware on PowerPC machines, or to the EFI bootmanager (as far as I understand) on Intel Macs. The BootROM "knows" about the fancy startup keys, e.g. options key which can passes hints to OpenFirmware & EFI bootmanager on what user wants to do (e.g. clean NVRAM & PRAM, force pop-out cd, perform target-disk mode boot, netboot or present available boot drives).
OpenFirmware later on passes onto BootX and that boots OS 9 or OS X kernels & brings up init-rc / launchd. This is PowerPC. I'll stop talking about PowerPC from now on =)
The EFI bootmanager is the gray screen screen which also produces the WALL-E sound (aka mac jiggle). This EFI bootmanager brings up to live some hardware and it can read NVRAM, FAT r/w and HFS+ read-only as well as get onto network. It reads NVRAM to figure out default boot partition, picks that, reads HFS+ headers of that partition to find EFI loader (aka "blessed" loader) and passes onto that to do the rest of initialisation, brings up launchd and gets to the desktop.
This EFI bootmanager after the Boot Camp upgrade (or all recent macs) can also find mbr bootable internal "legacy" systems, emulate BIOS and boot those / make them selectable. And it is a bit stubborn =) it doesn't like identifying my LiveUSB sticks, even though when I jump through the hoops it loads. The Hoops being:
- EFI bootmanager ->
- rEFIt ->
- grub-efi -> in grub-efi "appleloader usb" ->
- ? EFI bootmanager ? ->
- syslinux/grub-pc from USB stick loads.
Also the EFI bootmanager doesn't "see" regular simple file system efi bootloaders e.g. (/efi/boot/bootia32.efi) and doesn't let me boot those =( although some people reported this to work as well as regular legacy usb-sticks (various random posts on grub-devel & ubuntuforums)
What about regular booting of the installed system?
Ideally we should be able to put grub-efi on EFI system parition as /Ubuntu/bootia32.efi & /Ubuntu/bootx64.efi and set NVRAM to boot those. That grub probably should just chainload into another grub-pc or grub-efi installed on the root ubuntu partition.
Or we can modify rEFIt to read ext4 partitions and stick that into system /efi partition.
What does "bless" tool do on Macs? It can do many things but in general it does this:
- Sets the HFS+ partition headers with a pointer to a directory/file which should be used to finish efi boot
- Stores in NVRAM default boot device / default efi to load
I haven't looked into hfsplus yet but hopefully it can be used to mimic bless tool to set hfs+ headers to point to custom efi's.
Ideally we should be able to access NVRAM from linux to load Ubuntu, the efibootmgr package should be able to do this, but I can't get it to work on my machine yet. The kernel efivars module is not loaded =( and modprobe can't find it either.
Good luck! Being able to boot and instal from USB on a Intel Mac would be awesome!
ReplyDeleteWild Casinois the most effective 바카라사이트 on-line on line casino with actual money slots for US players. Plus, new accounts can take advantage of|benefit from|reap the benefits of} theirwelcome bonus of up to as} $14,000and tons of ongoing promos and progressive jackpots. Free spins are precisely as the name implies, spins that are be} freed from cost. These bonuses can encompass a mix of free spins and free money.
ReplyDelete