- Joined
- Oct 2, 2015
- Messages
- 12
- Mac
- Classic Mac
- Mobile Phone
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
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: