Jump to content

[HOW TO] Fix second stage boot logo and loading bar for some dedicated desktop video cards


arsradu
 Share

391 posts in this topic

Recommended Posts

Hey guys,

This is a tutorial on how to fix (or at least try to fix) the second stage boot, when you're having these issues: missing logo and loading bar being displayed on the bottom left corner of the screen.

 

Might or might not work for other issues. So proceed with caution.

This is an issue that I experienced starting with early stages of development in Yosemite. Still continued in El Capitan. So this thread is primarily for these two versions of Mac OS X. Not sure it will work on earlier versions, cause I never tried it. So far it worked in Yosemite, El Capitan and Sierra.

Please, note that I did not test this on all video cards. So it might or might not work, depending on that. Don't take this as a final solution for everything. Also, I'm pretty sure this won't work with iGPUs. So I would strongly suggest to look around for solutions if that's your case.

This tutorial is not for multiple display setups! Please, don't use it for that! Especially not in iGPU + dedicated GPU combos.
 

Known issue: if you're using the auto-login feature, try to disable it and use the regular login screen. Otherwise you won't get the second stage boot (confirmed as fixed in Sierra).

 

This tutorial would have not been possible without the help and insight of:
Pike R. Alpha
cecekpawon
Mirone
Riley Freeman
 
So all the credit goes to them. I just put this together based on my successes and failures.

Succesfully tested with:
 
NVidia cards:

  • GeForce 210
  • GT 640
  • GTX 650
  • GTX 660
  • GTX 670 Superclocked+ 4GB - works partially (ok for 1080p, with CSM disabled, but no second stage in higher resolutions)
  • GTX 750 Ti - works partially (ok for 1080p, but no Apple logo for second stage in higher resolutions)
  • GTX 760
  • GTX 780
  • GTX 960
  • GTX 970 - works partially (ok for 1080p, and 1440p with CSM disabled, but no second stage in higher resolutions)

ATI cards:

Might work on other graphic cards, as well. But these are the ones that worked so far. Please, share if you got good results with another video card.

Also, the same thing can be achieved by modding your DSDT. Unfortunately this thread does not make the object of that method, nor am I able to help you with that, since I really have no idea how to mod a DSDT, so far. Also, to be honest, this method seems a bit easier.

Nonetheless, try this at your own risk! I'm not responsible for any damage that you might cause to your computer/components etc.
Also, please, note that this tutorial is not perfect. I'm doing my best to make it as easy to understand as possible. Also, I'm opened to suggestions and I'm doing my best to improve this in the future. Still, it's not perfect. So keep that in mind. Suggestions are appreciated though.

Please, note that, if you've got a video card with GOP UEFI Bios, you most likely don't need this tutorial in the first place. All you need is to disable CSM in BIOS (motherboard dependent). Note that, by doing this, only GPT drives will be loaded. So if you've got Windows installed on another drive, for example, you won't be able to select it anymore, if it's installed in "legacy" mode.


With that being said, let's get to work. :)

Prerequisites:

Mandatory:

  • a computer running Mac OS X Yosemite or newer
  • Clover bootloader (changes are gonna be saved to the config.plist file)
  • IORegistryExplorer v 2.1 (attached)
  • gfxutil (attached)
  • gfx_hex (attached) - script credit to cecekpawon

Optional:

  • Sublime Text Editor
  • Clover Configurator
  • a Windows PC for reading the graphic card's VBios version. So far, I couldn't find a way to do it from OS X. But if you know how to do it, please, share. I'll update this accordingly. An alternative (though not really the same thing) is this.
  • an USB installer might come in handy, so keep one close by.

Extra:

  • If you want to try the modded Bootx64.efi (rev 3279), thanks to cecekpawon, featuring an option to easily enable/disable string injection in Clover (in case you're stuck outside your OS, and don't have a USB drive or something else to boot from), click here to get it. Please, note that this revision might not work with newer versions of OS X/macOS.
    You will need to replace the one in your EFI/EFI/CLOVER folder. If you want to revert to the previous one, you can either reinstall Clover, or make a backup of your current one before replacing it.

I would recommend creating a single folder with all the necessary files and tools and putting it on your Desktop, just to have all the needed things in one place.

Note: If you use a custom SSDT/DSDT, I would try first without it, and using Clover's patches instead, so that you minimize the risk for failure due to custom DSDTs. I don't use a custom DSDT, didn't test in collaboration with a custom DSDT, so I don't know if it will work. If you wanna try it this way, I would love to know your results.

What to do:

Step 1 (establishing the port):

Open up your IOreg file (or just open IORegistryExplorer if you don't want to save it as a separate file), and search for "display".

You should see something like this:

post-1303722-0-18242900-1444055080_thumb.png

Now, depending on your card, you might have more or less ports. The important thing is to note the one that has the AppleDisplay attached to it. In this example, the second port (B@1) is the one in use. So that's the one we need to set as default. Please, note that they start at 0, so first port is A@0, the second one is B@1 and so on so forth.

Step 2 (extracting device-properties.hex):

Open up a terminal window, navigate to the desktop folder you're using, and do this (make sure gfxutil is present into that folder):

ioreg -lw0 -p IODeviceTree -n efi -r -x | grep device-properties | sed 's/.*<//;s/>.*//;' > "device-properties.hex" && ./gfxutil -s -n -i hex -o xml "device-properties.hex" "device-properties.xml"

This will extract two new files into that folder: device-properties.hex and device-properties.xml

Step 3 (modding the device-properties.xml):

Open up the xml file using any text editor (I'm gonna use Sublime here) and ADD the number of ports you need for your card (the same number of ports, with the same name as in the IOreg) and the rest of the information, as described in the example below (use the attached xml as reference):

post-1303722-0-46844400-1445715282_thumb.png

Don't forget that the first port is port 0!

In this example, we're using an MSi GTX 650 OC with 2GB of RAM, which has 3 ports, and we want to set as default port #2 (B@1).
Attached you can find my device-properties.xml file, if you wanna use it as reference.

The first section will set port B@1 as default. Change this according to your case.

<!-- Primary display -->
<key>@1,AAPL,boot-display</key>
<string>0x00000001</string>

Whereas on the bottom you can see regular values. Here we can set the amount of VRAM, the name of the card and the VBios version.
 

<key>VRAM,totalMB</key>
<string>0x00000800</string> // for 2048 MB or 2 GB of RAM
<key>device_type</key>
<string>NVDA,Parent</string>
<key>model</key>
<string>MSi GeForce GTX 650</string> // Name of your card
<key>rom-revision</key>
<string>80.07.35.00.04</string> //VBIOS version

In my experience, these values are rather cosmetic than anything else. For an accurate version of your VBios, you can use either the Nvidia driver on Windows, or any hardware information software like GPU-Z, aida64 or nvflash.
 
Here's a little table with hex values for different amounts of RAM. If you need other values than the ones specified in this table, please, ask. Also, if you spot a mistake, let me know so I can correct it.
 
Amount of memory  Hex value
128 MB                      0x00000080
256 MB                      0x00000100
512 MB                      0x00000200
1024 MB (1 GB)        0x00000400
2048 MB (2 GB)        0x00000800
3072 MB (3 GB)        0x00000C00
4096 MB (4 GB)        0x00001000
5120 MB (5 GB)        0x00001400
6144 MB (6 GB)        0x00001800
7168 MB (7 GB)        0x00001C00
8192 MB (8 GB)        0x00002000
9216 MB (9 GB)        0x00002400
10240 MB (10 GB)    0x00002800
11264 MB (11 GB)    0x00002C00
12288 MB (12 GB)    0x00003000
13312 MB (13 GB)    0x00003400
14336 MB (14 GB)    0x00003800
15360 MB (15 GB)    0x00003C00
16384 MB (16 GB)    0x00004000
 
Once we're done modding, we're gonna save the changes and convert the xml file back into hex, using this command:

./gfxutil -i xml -o hex device-properties.xml device-properties.hex

Step 4 (reading the modded hex):

Unpack gfx_hex (attached) file into your working directory and double click to run it.
 
It should output the content of your modded hex into a terminal window, and it should look something like this:
 
post-1303722-0-85170500-1444154243_thumb.png
 
Select and copy that code. After that, open up Clover Configurator and paste that hex code in Devices -> Properties section (see below) and check the box for Inject. You can also add this manually into the config.plist file, if that's more of your thing.

post-1303722-0-50532800-1444057472_thumb.png

Step 5 (setting up final arrangements):

We're almost done. But, if your experience is the same as mine, at this point you only got the loading bar back centered. Which, of course is a step forward. But we're not quite there yet.

So, to add the logo as well, we will check the boxes for Patch VBios and Inject EDID in Clover Configurator (Graphics section). You can inject your own EDID if you have one. Though, in my experience, Clover does a really good job in adding the correct one itself. So you don't really need to add a custom EDID. Just to use Clover's InjectEDID feature.

post-1303722-0-91610300-1444057617_thumb.png

Also, in my experience, you don't need CsmVideoDrv.efi for this to work. And I've got pretty similar results with and without it. So, if you have issues with it, you can try without it, and vice-versa.

When it's all done, save the changes to your config.

Now, I would highly recommend you to make a backup of your current config.plist from EFI/EFI/Clover/config.plist anywhere you want. You might need it later.

When that's done too, replace the config.plist in your Clover folder with the one you just modded, and restart.

Keep your fingers crossed (toes too). And hope for the best. If everything ok, you should have a pretty close to perfect second stage boot. If not, you might have nothing or an unbootable system.

To fix this, boot from your USB installer, or use boot flag nv_disable=1 (for Nvidia cards), upon booting, and revert the changes. Or, if you already know where is the problem, fix that and restart.

That's it.

Please, let me know if it worked for you.

gfx_hex.zip

IORegistryExplorer.app.zip

gfxutil.zip

device-properties.xml

  • Like 12
  • Thanks 1
Link to comment
Share on other sites

Great guide mate!!! I was going to pm you to ask for help on this exact matter... Kudos!!  :thanks_speechbubble:  :thanks_speechbubble:

You're welcome.

 

If there's anything that's not clear enough or if you have any suggestions to make this tutorial clearer/better, please, don't hesitate to tell me and I'll see what I can do. :)

  • Like 1
Link to comment
Share on other sites

Hi arsadu

great guide, very detailed!

would you mind testing something?

instead of this patch,

can you try this 3 settings in clover:

I think the result might be the same. Although I don't see anything related to Patch VBios. Which is needed to get the logo back (or at least it was in my case).

 

Nonetheless, I'll try this, and update this post when done. :)

 

UPDATE:

post-1303722-0-56151500-1444063873_thumb.png post-1303722-0-75926300-1444063885_thumb.png post-1303722-0-19369900-1444063898_thumb.png

 

With this configuration, and with or without Patch VBios and Inject EDID, I got the old issue back: no logo and loading bar on the bottom left corner. Without PatchVBios and Inject EDID I also got the first stage boot resolution higher than it should be. :)

Link to comment
Share on other sites

So I enabled patch vbios and inject edid turned off verbose boot and rebooted. then my motherboard died, I blame this thread. Had to run out and buy a new one...typing from it now, that is all. asus z97-a I was running pci and integrated gfx at the same time. now  on z97-e but no usb3.1 support in 10.11 oh well.

Link to comment
Share on other sites

So I enabled patch vbios and inject edid turned off verbose boot and rebooted. then my motherboard died, I blame this thread. Had to run out and buy a new one...typing from it now, that is all. asus z97-a I was running pci and integrated gfx at the same time. now on z97-e but no usb3.1 support in 10.11 oh well.

I don't see how patching the video bios could damage the motherboard. Were you running dual monitors? How exactly were you running two graphic sources at the same time?

Nonetheless, I'm sorry about your motherboard. I still don't know how could this thread contribute to that, but I feel obligated to remind you what I wrote above:

1. I am not responsible for any damage that you might do to your hardware

2. This has not been tested on all video cards and under all circumstances.

So you're doing it at your own risk.

 

Could you please tell me which dedicated graphics card are you using?

Link to comment
Share on other sites

Added more option to en/disable EFI Strings injection for your risk free if you want to, BOOTX64.efi rev 3279

 

GTCKdlV.jpg

 

Dump device-properties

ioreg -lw0 -p IODeviceTree -n efi -r -x | grep device-properties | sed 's/.*<//;s/>.*//;' > "device-properties.hex" && ./gfxutil -s -n -i hex -o xml "device-properties.hex" "device-properties.xml"

Small util to show gfx hex (place in same directory with "gfxutil" & "device-properties.xml") for easy to copy & paste into config.plist. Save as "gfx.command" & chmod +x:

#!/bin/bash

cd "`dirname "$0"`"
./gfxutil -i xml -o hex "device-properties.xml" "device-properties.hex"
cat <<EOF
---
`cat device-properties.hex`
---
EOF

VRAM values table would be nice too, 0x40000000 = 1024 | 0x80000000 = 2048 | etc : )))

Edited by cecekpawon
  • Like 1
Link to comment
Share on other sites

Added more option to en/disable EFI Strings injection for your risk free if you want to, BOOTX64.efi rev 3279

 

GTCKdlV.jpg

 

Cool, but what exactly does this do? Also, will you be able to do it for newer Clover versions (like 3280 now), in case people want it?

 

Dump device-properties

ioreg -lw0 -p IODeviceTree -n efi -r -x | grep device-properties | sed 's/.*<//;s/>.*//;' > "device-properties.hex" && ./gfxutil -s -n -i hex -o xml "device-properties.hex" "device-properties.xml"

 

I'll add this to the thread. Thank you. So with this, the user doesn't need to use DarwinDumper anymore to extract the device-properties.hex file, since the command automatically outputs both the hex and the xml files in the same folder. Nice!

 

Small util to show gfx hex (place in same directory with "gfxutil" & "device-properties.xml") for easy to copy & paste into config.plist. Save as "gfx.command" & chmod +x:

#!/bin/bash

cd `dirname $0`
./gfxutil -i xml -o hex "device-properties.xml" "device-properties.hex"
cat <<EOF
---
`cat device-properties.hex`
---
EOF
VRAM values table would be nice too, 0x40000000 = 1024 | 0x80000000 = 2048 | etc : )))

 

 

Ok, I'll add this, as well. So with this we don't need HexEdit anymore. :) Interesting.

 

I'll also add a little table or something close to that (though I'm still not sure this forum supports tables). I guess I could do it in xls and take a screenshot of it.

 

Thank you! :)

Link to comment
Share on other sites

I don't see how patching the video bios could damage the motherboard. Were you running dual monitors? How exactly were you running two graphic sources at the same time?

Nonetheless, I'm sorry about your motherboard. I still don't know how could this thread contribute to that, but I feel obligated to remind you what I wrote above:

1. I am not responsible for any damage that you might do to your hardware

2. This has not been tested on all video cards and under all circumstances.

So you're doing it at your own risk.

 

Could you please tell me which dedicated graphics card are you using?

 

Running triple display with dvi+hdmi on gtx970, and hdmi on hd4600. After setting patch vbios and inject edid I did reboot, and it froze at the login prompt. after rebooting it wouldn't even post, just rebooting over and over. This is what I get for trying to fix something that isn't broken. Off to fill out some RMA forms!

 

Also if I disable verbose boot I get the loading screen just fine, so I'm pretty sure I did this for no reason other than to destroy stuff.

Link to comment
Share on other sites

Running triple display with dvi+hdmi on gtx970, and hdmi on hd4600. After setting patch vbios and inject edid I did reboot, and it froze at the login prompt. after rebooting it wouldn't even post, just rebooting over and over. This is what I get for trying to fix something that isn't broken. Off to fill out some RMA forms!

 

Also if I disable verbose boot I get the loading screen just fine, so I'm pretty sure I did this for no reason other than to destroy stuff.

Did you try booting from a USB installer?

 

This tutorial is not for multiple display setups. I will add this to the thread. You are adding the default display port. This doesn't even consider the possibility of a multiple display setup. Also, I did mention it's not for iGPUs.

Link to comment
Share on other sites

Cool, but what exactly does this do? Also, will you be able to do it for newer Clover versions (like 3280 now), in case people want it?

 

To en/disable inject if something goes wrong (ex: failed to boot / screwed display) when playing with those efi / properties strings.. fully optional

<key>Devices</key>
<dict>
  <key>Inject</key>
  <true/>
  <key>Properties</key>
  <string>...</string>
</dict>
Link to comment
Share on other sites

Works here @0, thanks 

 

edit: that was with minimal DSDT edit, RADEON_FB @0,AAPL,boot-display

with full DSDT edit, FUTOMAKI_FB, had to change it to @2,AAPL,boot-display

You're welcome! Glad it worked.

 

So you have a Sapphire Toxic R9 270, right? This would be the first ATI card tested so far. :)) So, you've got the same issue (no second stage boot logo and loading bar in the bottom left corner of the screen)? Just trying to understand if this tutorial only works for this specific issue or can do other things as well.

 

Also, since I'm no expert with ATI cards, could you describe a little bit what did you do, in case other people want to get their ATI cards fixed, as well? I would be glad to point to your post, as reference, if you would be kind enough to do that. Or if you want, I can add it to the initial post.

 

Also, does this work only with Clover DSDT patches? Did you try it? I mean...I see no reason why it wouldn't work but just making sure. I'm trying to keep this thread as close to minimal edits as possible. And adding DSDT editing here is not quite part of my plans. :D Not that I wouldn't love to learn more about that. But I find it a tad more complicated than this.

Link to comment
Share on other sites

To en/disable inject if something goes wrong (ex: failed to boot / screwed display) when playing with those efi / properties strings.. fully optional

<key>Devices</key>
<dict>
  <key>Inject</key>
  <true/>
  <key>Properties</key>
  <string>...</string>
</dict>

 

Could you please, try the attached script on your computer?

 

I can't seem to get it to work.

 

It always says: "./gfxutil: No such file or directory"

 

gfxutil is, of course, present in that directory. Along with device-properties hex and xml. So I'm not really sure what's wrong.

gfx.zip

Link to comment
Share on other sites

- cd to your working dir (with gfxutil there)

 

- OR -

 

- save as "gfx.command" in gfxutil & "device-properties.xml" directory

- chmod +x "gfx.command"

- double click to execute

Apparently it can't run from the working directory. Be it a simple gfx executable file or gfx.command file. Actually I couldn't find any difference between the two approaches. Is there any actual difference between these two? At least in this context?  :)

 

Now, it does however work if you're cd-ing into the working directory and running the executable from there. I'm just not sure why it doesn't do that when you're launching it from the directory itself.

 

Launching with double-click (which is what I would like to achieve):

post-1303722-0-94877900-1444113902_thumb.png

 

Launching by browsing into the working directory and ./ from there:

post-1303722-0-09148200-1444113961_thumb.png

 

Maybe the way I'm making the script is wrong...

 

I'm doing

cd [directory path]
pico gfx.command

[paste the content here]

 

CTRL+X to exit. ENTER to save the name

 

Then

chmod +x "gfx.command" \\ (with or without quotes seems to be the same)

And double click to execute.

gfx.command.zip

Link to comment
Share on other sites

I have to chime in this one with the note that it was I who discovered that you need @1,AAPL,boot-display... feel free to verify this in the other Apple logo related thread.

 

I take it that modesty is not your strong suit. :P However, I am a guy who considers that credit should be given where credit is due. And, with this, I also want to thank you for your help and insight in this. It's definitely helping. Also, just so you know, skipping you from the credits list was nowhere near my intentions. :) I was just not aware of the origin of the idea/research.

 

So, again, thank you. And I just added you to the list of people that contributed with very good ideas/research on getting this issue fixed.

 

Hope it's ok now.

  • Like 2
Link to comment
Share on other sites

 

So my name should be
added to that list does not it?
 

 

 

Of course! 

 

Anyone else wants his name on the first page of this thread? :P I'm feeling generous today.

 

Joking. I will add the names of the ones that contributed to this. I feel like it's the right thing to do. I hope the list doesn't get longer than the thread itself though...

Edited by Micky1979
  • Like 1
Link to comment
Share on other sites

One of the last mysteries is screen flash before last stage, real mac saw the same problem too? Who can figured it out?

Yeah, this is an issue with hackintosh desktops... Laptops seems seems to be ok, for some reason.

 

And I don't think real macs (as in Mac Pros or iMacs) have this issue... I might be wrong though. I will check it out today, if I have a bit of time.

 

Update: on an iMac 27" late 2010, running Yosemite (10.10.4), the boot process is identical! Meaning WITH that gap between first stage and second stage. It might be faster and less noticeable on SSDs. But I think the HDD might play some role in the transition speed between the two stages.

Link to comment
Share on other sites

 Share

×
×
  • Create New...