-
-
Notifications
You must be signed in to change notification settings - Fork 12
EFI
Ausdauersportler edited this page Nov 27, 2022
·
8 revisions
This page contains just a short construction plan how to create an EFI vBIOS starting with the standard GOP vBIOS.... You may come back here to check it when the detailed construction page becomes too long to follow or the outline gets out of my hands during editing. Please note that this plan may mention tools, which will be explained later on within the real construction example.
- Save the original BIOS of a MXM card named
AMDGPU
toAMDGPU-ORIG.rom
, e.g. saving theW5170M
BIOS to a file namedW5170M-ORIG.rom
. Keep it and make all upcoming modifications of copies of that file. For the sake of simplicity I stick with the example. - Create a copy of
W5170M-ORIG.rom
and rename it toW5170M-GOP.rom
. - Check of this BIOS already contains a GOP part, if not add one manually or with a tool.
- Now adjust the OBJ_INFO module within the legacy part of the BIOS to make the backlight of the internal iMac LCD work and test it on the iMac. This is a tricky operation.
- Find the firmware of an Apple Mac system which uses the same AMD GPU family (here the MacBookPro12,1 2015). Extract the graphics driver EFI module from this firmware and save it using the GPU family name, here
VenusEG2.efi
. This is de facto Apples own (pre UEFI 2.0?) implementation of GOP. - Modify the module by changing the FrameBuffer name and save the modified file with the new name M370.efi (this is the name of the GPU within macOS when asking the system_profiler).
- compress the M370.efi file using EfiRom to convert it to BIOS code (BIOS is literally just a series of compressed EFI programs)
- replace the GOP part in the
W5170M-GOP.rom
with the compressed EFI code and save it toW5170M-EG2.rom
(this is fully functional, but EFI boot picker still depends on modding the firmware) - now either modify your iMac firmware adding the two other modules to it or use OpenCore to load those modules to test your current work
- create another copy of the
W5170M-EG2.rom
and name itW5170M-EFI.rom
(this will be the final version not depending on a firmware mod nor ob OpenCore as long as you stick with supported macOS versions) - find and delete the VGA part from the legacy BIOS part, mark it's length in bytes (hexadecimal)
- find all address tables and correct the absolute addresses referring to all code and data modules by subtracting the length recorded in the former step, check the success. all tables contain addresses in hexadecimal form and wrong order (big vs. little endian).
- now use EfiRom to compress the other two EFI modules in the same way you did it in step 7
- add these two compressed parts to the BIOS file created in step 10
- flash it to the MXM card and test your success
- done
To avoid any confusion when preparing all modifications this naming scheme will be used during the development. We will create several versions of the BIOS for a single AMDGPU card, in detail named like this:
-
AMDGPU-ORIG.rom
orAMDGPU.rom
(Original file, can already contain a GOP) -
AMDGPU-GOP.rom
(GOP added, iMac connector table modded file) -
AMDGPU-EG2.rom
(GOP replaced by EG2: needs on OpenCore or iMac firmware modification) -
AMDGPU-EFI.rom
(EFI modded file: fully standalone EFI modded rom, no iMac firmware mod needed) -
AMDGPU-EG2_adj.rom
(EG2 modded file : needs OpenCore or iMac firmware modification) -
AMDGPU-EFI_adj.rom
(fully standalone EFI modded rom with adjustments to enable backlight on boot)