Jump to content

How to boot OS X Mountain Lion with UEFI and GPT HDD


  • Please log in to reply
76 replies to this topic

#21
dmazar

dmazar

    InsanelyMac Sage

  • Coders
  • 256 posts
  • Gender:Male
UEFI boot on Phoenix UEFI I've seen so far does not work properly. There is some problem with original UEFI runtime (RT) variable services when used with OSX. That's why you need that EmuVariableRuntimeDxe.efi for OSX UEFI boot.

But, although I can UEFI boot Win7 here with that EmuVariableRuntimeDxe.efi driver fine, you can not (or is it Win8?). And booting Win with that driver is also not a good idea in general - because you do not have problems with original RT var services with Win.

Please try with this version here: https://dl.dropbox.c.../EmuVarUefi.zip
Contains:
- modified CloverX64.efi and it's copy BootX64.efi - put them to Clover USB stick into /EFI/Boot/
- modified EmuVariableRuntimeDxe.efi, now called EmuVariableUefi.efi - put it to /EFI/Drivers64UEFI/
- and remove previous /EFI/Drivers64UEFI/EmuVariableRuntimeDxe.efi

This version should return back original RT var services when booting Win or Linux, but will continue to use RT var emulation for OSX boot.

Try booting OS and Win with this new files.

#22
Fred30w

Fred30w

    InsanelyMac Protégé

  • Members
  • Pip
  • 34 posts

UEFI boot on Phoenix UEFI I've seen so far does not work properly. There is some problem with original UEFI runtime (RT) variable services when used with OSX. That's why you need that EmuVariableRuntimeDxe.efi for OSX UEFI boot.But, although I can UEFI boot Win7 here with that EmuVariableRuntimeDxe.efi driver fine, you can not (or is it Win8?). And booting Win with that driver is also not a good idea in general - because you do not have problems with original RT var services with Win.Please try with this version here: https://dl.dropbox.c.../EmuVarUefi.zipContains:- modified CloverX64.efi and it's copy BootX64.efi - put them to Clover USB stick into /EFI/Boot/- modified EmuVariableRuntimeDxe.efi, now called EmuVariableUefi.efi - put it to /EFI/Drivers64UEFI/- and remove previous /EFI/Drivers64UEFI/EmuVariableRuntimeDxe.efiThis version should return back original RT var services when booting Win or Linux, but will continue to use RT var emulation for OSX boot.Try booting OS and Win with this new files.

Yes, Windows 7 is the OS that BSOD's when using the previous EmuVariableRuntimeDxe.efi driver. I haven't tried Windows 8, but Windows 7 no longer BSOD's with your new driver. There is a bug that prevents OS X from booting properly. OS X boots fine if I don't touch the touchpad, which doesn't move the mouse. If I try to move the mouse, OS X hangs at AppleRTC, which is the same symptom that happened without the old EmuVariableRuntimeDxe.efi. As I said, the mouse pointer does not move, and if I attempt to move it, OS X hangs, but Windows 7 boots fine. Thank you again btw for helping me this far. :)

#23
dmazar

dmazar

    InsanelyMac Sage

  • Coders
  • 256 posts
  • Gender:Male
Well, to be honest I thought it would be easier. And now you are the only one available for testing improvements to this EmuVariable stuff.

I have no idea what went wrong with this new one. Can you test this one: https://dl.dropbox.c...ariableUefi.efi
When you start Clover, press F2 to generate /efi/misc/preboot.log and post it here, please.

Also, when you boot OSX with it, please make DarwinDump with Ioreg option selected. Want to see if runtime services and platform uuid injection works.

#24
Fred30w

Fred30w

    InsanelyMac Protégé

  • Members
  • Pip
  • 34 posts

Well, to be honest I thought it would be easier. And now you are the only one available for testing improvements to this EmuVariable stuff.I have no idea what went wrong with this new one. Can you test this one: https://dl.dropbox.c...ariableUefi.efiWhen you start Clover, press F2 to generate /efi/misc/preboot.log and post it here, please.Also, when you boot OSX with it, please make DarwinDump with Ioreg option selected. Want to see if runtime services and platform uuid injection works.

Sure thing, I will get the DarwinDump and Preboot.log here later, but Windows and OS X finally boot together great. I still cannot move the mouse pointer in the Clover boot loader (in OS X touchpad works fine), but that can be fixed later. OS X no longer hangs at AppleRTC, so I think that problem is solved. :)

EDIT: I've uploaded the requested items. Also OS X sometimes hangs on shutdown, the screen will go blank after the verbose stuff, then the power light will remain on. I am using NullCpuMManagement with SleepEnabler.

Attached Files



#25
dmazar

dmazar

    InsanelyMac Sage

  • Coders
  • 256 posts
  • Gender:Male
Cool. Logs look good now. I will then add this to Clover package to be available for future.

But before that, I would like to identify why it did not work in the first place. Can you please try following 3 versions of that driver: https://dl.dropbox.c...VarUefiTest.zip
Try each one, and use only one version of EmuVariableUefi for each test. No need for any logs, I just want to know for each one: does it work properly or not.

#26
Fred30w

Fred30w

    InsanelyMac Protégé

  • Members
  • Pip
  • 34 posts

Cool. Logs look good now. I will then add this to Clover package to be available for future.

But before that, I would like to identify why it did not work in the first place. Can you please try following 3 versions of that driver: https://dl.dropbox.c...VarUefiTest.zip
Try each one, and use only one version of EmuVariableUefi for each test. No need for any logs, I just want to know for each one: does it work properly or not.

EmuVariableUefi1 -> Freezes at AppleRTC after touchpad usage. (mouse still does not move) If I don't touch the touchpad, OS X boots fine. Windows 7 boots fine.
EmuVariableUefi2 -> Still freezes at AppleRTC after touchpad usage. (still no mouse movement) Windows 7 BSOD's (bios not ACPI compliant) on this version.
EmuVariableUefi3 -> Again, freezes at AppleRTC. (seems at random) Windows 7 again BSOD's for the same reason above.

The 2nd emuvariableuefi (post #23) can also hang at AppleRTC. Extremely strange, it also gave a BSOD with Windows 7. (and I thought it didn't)

EmuVariableUefi1 seems to be the best version here so far. It may freeze at AppleRTC at times, but Windows 7 has no problems with it.

It seems like Clover is sensitive to how I navigate between the options. For example, OS X may hang if I use my arrow keys to go all the way to the left (UEFI boot) and back to OS X and everything inbetween. OS X can also hang if I attempt to use the touchpad (most of the time, not always) while in the Clover boot menu. Windows boots regardless if I use the EmuVariableUefi1.

#27
dmazar

dmazar

    InsanelyMac Sage

  • Coders
  • 256 posts
  • Gender:Male
Ok, so it's not working properly after all.

It's strange that you get BSOD again. All versions I sent you have the code to return real RT var services for Windows. But you must use CloverX64.efi and BootX64.efi I sent you in post #21 (or the ones I am attaching below).

Well, I can offer you one more test - Clover with disabled mouse stuff: https://dl.dropbox.c...overNoMouse.zip
Just to see if this mouse/touchpad code is making problems. So, you need to replace CloverX64.efi and BootX64.efi and EmuVar.

If this does not work, I'll have to stop since I have no more ideas. :(

If you will still want to install Clover to HDD you can do it like this:
1. Copy Clover to EFI partition
2. Register Clover as a firmware boot option so that it appears in boot selection

In details:

1. Copy Clover to EFI partition
- use Terminal:
diskutil list
to see where your EFI partition is: diskXs1 and then mount it:
mkdir /Volumes/efi
sudo mount -t msdos /dev/diskXs1 Volumes/efi
where diskXs1 is proper name for your EFI partition
- and then copy EFI folder from your USB key to /Volumes/efi volume
- you should then have /Volumes/efi/EFI/ folder on that EFI partition
- you can delete /Volumes/efi/EFI/Boot/Bootx64.efi - will not be needed when booting from HDD

2. Register Clover as a boot option
- important: remove temporarily EmuVariableUefi.efi from USB stick /EFI/drivers64UEFI - to allow Clover to have access to boards original RT var services
- boot into Clover from USB stick
- since there is now /EFI/Boot/CloverX64.efi file on HDD efi partition, you should get new "Clover Boot Options" in the tools menu (second row of icons)
- choose that "Clover Boot Options" and you should get new screen with option "Add as UEFI boot option"
- select "Add as UEFI boot option" and this should register Clover from HDD Efi partition as a boot option to your firmware
- you can also later come to the same screen and select "Remove ..." to remove it
- now you should be able to remove USB key and boot directly from HDD
- and you can add back EmuVariableUefi.efi to USB key

Procedure for Clover upgrade:
- always install new version on USB key and check if works
- if all is ok, then use above procedure to copy it to EFI partition
- no need for "Register Clover as a boot option" again, since it's already added

#28
Fred30w

Fred30w

    InsanelyMac Protégé

  • Members
  • Pip
  • 34 posts

Ok, so it's not working properly after all.It's strange that you get BSOD again. All versions I sent you have the code to return real RT var services for Windows. But you must use CloverX64.efi and BootX64.efi I sent you in post #21 (or the ones I am attaching below).Well, I can offer you one more test - Clover with disabled mouse stuff: https://dl.dropbox.c...overNoMouse.zipJust to see if this mouse/touchpad code is making problems. So, you need to replace CloverX64.efi and BootX64.efi and EmuVar.If this does not work, I'll have to stop since I have no more ideas. :(If you will still want to install Clover to HDD you can do it like this:1. Copy Clover to EFI partition2. Register Clover as a firmware boot option so that it appears in boot selectionIn details:1. Copy Clover to EFI partition- use Terminal:diskutil listto see where your EFI partition is: diskXs1 and then mount it:mkdir /Volumes/efisudo mount -t msdos /dev/diskXs1 Volumes/efiwhere diskXs1 is proper name for your EFI partition- and then copy EFI folder from your USB key to /Volumes/efi volume- you should then have /Volumes/efi/EFI/ folder on that EFI partition- you can delete /Volumes/efi/EFI/Boot/Bootx64.efi - will not be needed when booting from HDD2. Register Clover as a boot option- important: remove temporarily EmuVariableUefi.efi from USB stick /EFI/drivers64UEFI - to allow Clover to have access to boards original RT var services- boot into Clover from USB stick- since there is now /EFI/Boot/CloverX64.efi file on HDD efi partition, you should get new "Clover Boot Options" in the tools menu (second row of icons)- choose that "Clover Boot Options" and you should get new screen with option "Add as UEFI boot option"- select "Add as UEFI boot option" and this should register Clover from HDD Efi partition as a boot option to your firmware- you can also later come to the same screen and select "Remove ..." to remove it- now you should be able to remove USB key and boot directly from HDD- and you can add back EmuVariableUefi.efi to USB keyProcedure for Clover upgrade:- always install new version on USB key and check if works- if all is ok, then use above procedure to copy it to EFI partition- no need for "Register Clover as a boot option" again, since it's already added

Thank you very much for your help. Unfortunately, OS X still hangs at AppleRTC occasionally, but I will see if there is a fix for that. Clover is now on the EFI partition and OS X can now boot dirrectly from HDD. :) I will post back if I find a fix for AppleRTC hang.EDIT: Ah, I think I found the problem. I had to remove a few kexts that I used for Chameleon. ElliottForceLegacyRTC and EvOreboot were removed. NullCPUManagement and SleepEnabler are still needed, otherwise I get a KP from AppleIntelCPUManagment. Now OS X no longer hangs at AppleRTC.

I noticed on app store update, there is a firmware update for Macbook EFI, is this safe to get, or should I ignore it?

Also is there a way to hide specific boot options? I used the option to "nolegacy" to hide legacy Windows options. Can I hide "Boot UEFI boot menu from"? (it shows up twice in the list) Basically I only want Windows and OS X to be the boot options available, even hiding the options on the bottom. (the shutdown option is broken for me anyway)

#29
dmazar

dmazar

    InsanelyMac Sage

  • Coders
  • 256 posts
  • Gender:Male
Ok, so what is the status now? Is OSX boot and Windows boot from Clover working? Did Clover version with mouse disabled made any difference, or is the same as with previous version? I would like to include those changes to Clover, but I'm not sure any more what works for you. Can you give me some details on files you are using? From which posts?

Firmware update: do not install it. Ignore it. It will probably not even execute if you install it, specially since you are using RT vars emulation, but no need to try that. You can right-click on it and hide it.

Regarding hiding volumes and other common Clover related stuff, better ask on Clover thread - may be interesting to others also.

#30
Fred30w

Fred30w

    InsanelyMac Protégé

  • Members
  • Pip
  • 34 posts

Ok, so what is the status now? Is OSX boot and Windows boot from Clover working? Did Clover version with mouse disabled made any difference, or is the same as with previous version? I would like to include those changes to Clover, but I'm not sure any more what works for you. Can you give me some details on files you are using? From which posts?

Firmware update: do not install it. Ignore it. It will probably not even execute if you install it, specially since you are using RT vars emulation, but no need to try that. You can right-click on it and hide it.

Regarding hiding volumes and other common Clover related stuff, better ask on Clover thread - may be interesting to others also.

OS X and Windows 7 and Windows 8 boot perfectly. There is no more AppleRTC hang. I am using your no mouse version from post #27. I don't think disabling mouse support helped because I'm pretty sure either ElliottForceLegacyRTC.kext or EvOreboot.kext were the cause of the AppleRTC hang. I removed both of those kexts and now OS X no longer hangs. If you need more details, I'm happy to post them.

#31
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 935 posts
  • Gender:Male
@dmazar. Thank you for the improvements, will give the new emuvar a test tomorrow for OSX booting.

You can get lots if people from L702x thread onboard for testing for Phoenix. They are leaning towards UEFI boot it seems but most people are struggling due to lack of details.

#32
gabn

gabn

    InsanelyMac Protégé

  • Members
  • Pip
  • 12 posts
Thank you TimeWalker75a for pointing out this thread. And thank you dmazar for the nomouse version of clover. I can confirm that UEFI booting windows 8 from the nomouse version of clover works for me. Both windows 8 and the Mac OS X installer are bootable from my clover USB stick. Next step will be to install clover to my hard disk, but before I want to install Mac OS X correctly in UEFI.

I am now struggling to make the OS X install correctly (I think I copied some wrong kext or forgot to delete some).

After that I will follow dmazars guide for installing clover on my hdd :)

#33
Fred30w

Fred30w

    InsanelyMac Protégé

  • Members
  • Pip
  • 34 posts
So far, Clover seems to work great with Windows and OS X. I haven't had a single hang when booting either Windows or OS X. The only problem I have been getting so far, is that OS X and Clover hang on shutdown. Restart and sleep work fine in OS X, restart works fine in the Clover boot loader. If I select shutdown in OS X or Clover, my laptop hangs with power leds and fans running. Is there a special driver for Clover needed to fix shutdown?

#34
dmazar

dmazar

    InsanelyMac Sage

  • Coders
  • 256 posts
  • Gender:Male
Ok. Thanks for reporting.

About shutdown issue: I have no idea. There is no special driver in Clover for that. Maybe TimeWalker and guys with similar laptops could give you some hints.

#35
Fred30w

Fred30w

    InsanelyMac Protégé

  • Members
  • Pip
  • 34 posts

Ok. Thanks for reporting.

About shutdown issue: I have no idea. There is no special driver in Clover for that. Maybe TimeWalker and guys with similar laptops could give you some hints.

Understood. Well, for anyone who has Lenovo Ideapad or another Phoenix UEFI based laptop, can you use the shutdown option in the Clover bootloader. When I try to, my laptop hangs with screen off, and lights on. OS X hangs on shutdown occasionally, mostly after working in Safari and immediately shutting down. Sleep and restart work fine. Restart works in the Clover bootloader, but not shutdown.

#36
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 935 posts
  • Gender:Male

Also I can&#39;t confirm the touchpad *tap* behavior with any of prior version I have tried since v771. I have yet to try windows in uefi mode with the new emuvar driver, but I believe it wont be aproblem for my machine, at least Dell has bothered to fix WMI for it. <br /><br />Huge props for new fixes, @dmazar. Keep it up .. maybe some day our crippled Phoenix SCT2.0 will arise from its ashes ..<br />



#37
Fred30w

Fred30w

    InsanelyMac Protégé

  • Members
  • Pip
  • 34 posts
I have an idea, once my laptop finishes its battery calibration cycle, I will try the old EmuVarRuntime (the one that BSOD'd Windows) to see if shutdown works on that version. It's strange though, Clover will not shutdown. (just to clarify, the Clover bootloader itself will not shutdown, which I think is my problem for OS X)

EDIT: I think I found something. When I use my Clover USB (this has NO EmuVariableUefi installed), selecting shutdown sends me to a screen that says "boot0:" and then Clover (from USB) shows up again. If I select shut down a second time, I get a screen that looks like this:

Attached File  20121202_185416.jpg   59.2KB   64 downloads

#38
Brabbelbla

Brabbelbla

    InsanelyMac Protégé

  • Members
  • Pip
  • 21 posts
  • Gender:Male
  • Location:Netherlands
@Fred30w
Looks like DUET, or in Clover's case rEFIt. Strange you can get there,

#39
Fred30w

Fred30w

    InsanelyMac Protégé

  • Members
  • Pip
  • 34 posts

@Fred30w
Looks like DUET, or in Clover's case rEFIt. Strange you can get there,

Strange thing is, with EmuVarUEFI, using shut down hangs. Without EmuVarUEFI, the first time I use shutdown, I am sent back to Clover boot menu. The second time, that menu appears.

#40
dmazar

dmazar

    InsanelyMac Sage

  • Coders
  • 256 posts
  • Gender:Male
Well, I'll try to explain ...

Shutdown from Clover does not do shutdown, but actually just exits Clover application. This means that control returns back to UEFI firmware.

It works like this:
- you select to boot from USB stick
- firmware detects /efi/boot/bootx64.efi (Clover) on the stick and does UEFI boot - starts Clover in UEFI mode and you get Clover GUI
- you select shutdown in Clover, but that just returns back to firmware
- firmware then continues by trying next boot option. and that is USB key again, but in BIOS mode
- since you have BIOS bootable USB key (boot0, boot1h2, boot = CloverEFI), firmware starts BIOS booted Clover (standard Clover boot) and you see boot0 message
- but this BIOS booted Clover installs it's own version of UEFI on top of BIOS - we call it CloverEFI, UEFI based on tianocore Duet
- CloverEFI starts /efi/boot/cloverx64.efi and you get GUI again
- when you select shutdown from this, Cloverx64.efi exits, and control is returned back to CloverEFI firmware
- CloverEFI firmware presents you with boot manager that is on your screenshot
:)

This does not help you much, but shows that you can boot standard BIOS Clover boot (CloverEFI) by just removing /efi/boot/bootx64.efi from USB stick and then booting from it. You may try that and see if shutdown works from there. To get UEFI boot back from USB stick, you just need to return /efi/boot/bootx64.efi.

Regarding shutdown from OSX: I'm not 100% sure, but I think that OSX does not use UEFI services for shutdown. I think that your shutdown issue is not related to Clover, but maybe caused by something in your DSDT. You are using the same DSDT as for Chameleon, right? But there is no guarantee that original DSDT for BIOS boot is the same as original DSDT for UEFI boot. They usually are, but ... Meaning: it's possible that you are injecting invalid DSDT when doing UEFI boot. Just my guess.

You can extract and compare BIOS ACPI tables and UEFI ACPI tables by:
1. do UEFI Clover boot (GUI start) from USB stick and press F4 - this will dump UEFI ACPI tables to /efi/acpi/origin. Move those tables to another place.
2. do BIOS Clover boot from USB stick (by removing /efi/boot/bootx64.efi) and press F4 to dump BIOS ACPI tables to /efi/acpi/origin.
3. compare UEFI and BIOS DSDT (and other ACPI tables) to see if there are any differences
4. if there are differences, then try to apply your DSDT fixes from your moded BIOS DSDT onto UEFI DSDT and try UEFI boot with that new one





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy