Contribute
Register

[Guide] Writing your own Intel 4600 framebuffer patch by example of ASUS Z-87-A mobo (Clover)

Status
Not open for further replies.
Joined
Oct 2, 2015
Messages
12
Mac
  1. 0
Classic Mac
  1. 0
Mobile Phone
  1. 0
How to make your own patch from scratch

This guide is meant for newbies that want to learn how to create their own kext patches and understand how framebuffers work in general. Knowing how to mount EFI partition, boot into single user mode and mount EFI partition in single user mode is required. I am not an expert and this guide might be suboptimal, so your suggestions are welcome!

I assume that you have acceleration working correctly and you use Azul framebuffer (Intel 4600)

Required programs:
1. Hex editor, I recommend Hex Fiend
2. IORegistryExplorer
3. Clover Configurator

Open IORegistryExplorer and find your video controller (usually GFX0). Then, look for value AAPL,ig-platform-id. This is the value framebuffer uses to determine your port layout. My value is "<03 00 22 0d>" or "0300220d", if you use mobile video your value could be different.

Open Hex Fiend, File -> Open Path ->
/System/Library/Extensions/AppleIntelFramebufferAzul.kext/Contents/MacOS/AppleIntelFramebufferAzul. Use search to find your platform id. You should find a byte sequence that looks like this (without word delimiters):

0300220D00030303000000020000300100000000000000609914000099140000000000000000000001050900000400008700000002040A000004000087000000030608000004000011000000

Explaining the colors:
x - ig-platform-id
x - framebuffer index (indexed from 1)
x - port number (indexed from 0)
x - port type (00040000 - DP, 0002000 - DVI, 0008000 - HDMI)

Now you have to figure out your port numbers. This is mostly done by trial error, safest way is to set all port types to the value of current working port type (HDMI or DVI).

So, assuming that your current connection is DVI (recommended), your first patch might look like this:

0300220D00030303000000020000300100000000000000609914000099140000000000000000000001050900000200008700000002040A000002000087000000030608000002000011000000

So, let's make our first patch!
1. Mount EFI parition
2. Open Clover Configurator and select your config.plist
3. Go to Kernel and Kext Patches tab and add a new line in KextsToPatch section
4. Set Name to AppleIntelFramebufferAzul
5. Set Find to our byte sequence
6. Set Replace to the patch value above
7. Comment is optional, but better put your current config there, like "#5 DVI, #6 DVI, #7 DVI"
8. Save and reboot

If you want to configure HDMI now, change one port type value to HDMI (0008), reboot and check if it works. If you get a black screen, reboot into single user mode, mount EFI partition, open your config.plist with nano or vim, set port type back and change the value of another port number. Repeat until it works.

The same method also applies to AppleIntelFramebufferCapri.kext

Useful links:
https://github.com/Piker-Alpha/AppleIntelFramebufferAzul.sh
https://github.com/Piker-Alpha/AppleIntelFramebufferAzul.sh/issues/4
 
Last edited:
ASUS Z-87-A has following port configuration:

#5 - DVI
#6 - HDMI
#7 - DP (actually mini Display port)

Original byte sequence decoded by Clover Editor:
0300220D00030303000000020000300100000000000000609914000099140000000000000000000001050900000400008700000002040A000004000087000000030608000004000011000000

Patched byte sequence decoded by Clover Editor:
0300220D00030303000000020000300100000000000000609914000099140000000000000000000001050900000200008700000002040A000008000087000000030608000004000000000000

The patch was done using the method above, the only tricky part was the one highlighted with red. This value is connector attribute. No idea what it means and how it works, but I had port-number 0 for my third framebuffer (DisplayPort) until I changed this value. Thanks to Picker-Alpha and this GitHub issue: https://github.com/Piker-Alpha/AppleIntelFramebufferAzul.sh/issues/4

End result from my config.plist:
Code:
<dict>
    <key>Comment</key>
    <string>Patch #5 DVI, #6 HDMI, #7 DP</string>
    <key>Disabled</key>
    <false/>
    <key>Find</key>
    <data>
    AwAiDQADAwMAAAACAAAwAQAAAAAAAABgmRQAAJkUAAAA
    AAAAAAAAAAEFCQAABAAAhwAAAAIECgAABAAAhwAAAAMG
    CAAABAAAEQAAAA==
    </data>
    <key>Name</key>
    <string>AppleIntelFramebufferAzul</string>
    <key>Replace</key>
    <data>
    AwAiDQADAwMAAAACAAAwAQAAAAAAAABgmRQAAJkUAAAA
    AAAAAAAAAAEFCQAABAAAhwAAAAIECgAABAAAhwAAAAMG
    CAAABAAAEQAAAA==
    </data>
</dict>

Happy hacking!
 
Last edited:
Status
Not open for further replies.
Back
Top