Skip to content

Enabling hidden 4G decoding

Curi0 edited this page Mar 23, 2024 · 29 revisions

Some motherboards do support 4G decoding even though it's not visible in the BIOS setup. Here you can find out how to enable the hidden option using UEFITool, IRFExtractor-RS and grub-mod-setup_var. This guide has been updated and now works for linux. You can also use this guide to enable other hidden BIOS settings, just search for the setting you're looking for instead.

Before enabling 4G decoding make sure that CSM is off otherwise you might face issues such as black screen or unable to enter BIOS. When CSM is off boot logo will be at full monitor resolution with no stretching/blurring.

  1. Download UEFITool (NE version is fine), IRFExtractor-RS and grub-mod-setup_var.

  2. Extract IRFExtractor-RS and leave the folder for now, we will come back to it later.

  3. Open your BIOS in UEFITool and search for 4G Decod (NOT Decode) with Unicode enabled. If it doesn't find anything, try searching for Above 4G or MMIO. It can also be called 64-Bit Resource Allocation or similar. Some platforms require you enable Above 4GB MMIO assignment too.

  1. Extract body of the section that search finds. Save this .bin to our IRFExtractor-RS folder.
  1. Open terminal and locate the IRFExtractor-RS folder. Now run IRFExtractor-RS provided with our 4GDecodBody.bin that we extracted earlier. This should produce a .txt file.
  1. Open the .txt and search 4G Decod or Above 4G in it. The value after VarStoreInfo (VarOffset/VarName): on the 4G Decoding entry is the offset which stores the setting. You may find multiple entries with the same VarOffset.

In my case, my VarOffset is 0x79B.

  1. Copy modGRUBShell.efi from grub-mod-setup_var to EFI/Boot/bootx64.efi on a USB drive that's bootable (such as one with a Linux or Windows installer on it). Make sure that Secure Boot is disabled and then boot the drive. If you don't have a bootable drive, use the Windows 11 Media Creation Tool to create a bootable drive and then replace EFI/Boot/bootx64.efi with modGRUBShell.efi as needed. Note that you can re-enable Secure Boot once finished doing this guide if you need it.

  2. Run setup_var (offset) replacing (offset) with what you got in step 6. If it already shows 0x1 despite being not enabled, that's not an issue as you can easily solve it by doing setup_var (offset) 0x0, rebooting, doing setup_var (offset) 0x1 and again rebooting. If the variable is 0x0 you can simply enable it doing setup_var (offset) 0x1 and rebooting. If you get an error about GUID mismatch it is safe to ignore. If the above doesn't work you can retry using setup_var_3 instead of setup_var.

4G decoding should work now. Re-enable Secure Boot if you need it.

If your BIOS doesn't have the 4G decoding option (common on Haswell) you can try asking motherboard vendor support for a BIOS with it, they will sometimes send one.

This page was updated on 23/03/24 by MrAnonymous7122