Add option in AMI UEFI bios menu (how to?)

In my bios I don’t have xhci hand-off nor ehci hand-off options. I found these are present in bios string with handles 0x0632 and 0x0634 … is there a way to add these options in the USB menu?
Amibcp doesn’t have any option to modify the menu.

http://i.imgur.com/SR6IdfB.png?1
http://i.imgur.com/SRZAIg0.png?1

Edit by Fernando: Thread title customized

No, it’s hardcoded during build process and can’t be changed easily. There is a possibility left that the code to enable/disable XHCI hand-off is still present and it can be controlled by an entry in Setup variable. Try finding where “Legacy USB Support” option is located in your Setup var and switch some 0x00s to 0x01s near it.

Should I extract the setup image and look for a pattern of 0 and 1 near the handle identifier?

No. First, prepare an UEFI-bootable USB drive with RU utility (download, unpack, rename RU.efi to bootx64.efi, copy it to /BOOT/EFI of a FAT32-formatted USB drive and boot from it).
Press Alt+= to open NVRAM variable selector, type “Setup” and press Enter. You see your Setup variable (press Ctrl+PgDn to see offsets past 0xFF), make screenshots (F12) of all values, then change “Legacy USB support” option and repeat the process. Compare screenshots to see where are that 0x00/0x01 is located and try to change (Enter) some 0x00s near it to 0x01s and see if XHCI HO is enabled.

Oh great! Thanks for the info. I’ll try today.



So I made some screesnhots as I am not sure of what I found, in the "Setup" screen there is nothing verbose, I found another variable called UsbSupport. Please check pictures. What do you suggest trying?











nevermind, I solved my problem in another way.



Interesting tool.
Is it any different to dumping the nvram-settings with SCEWIN for example?

Or will I be able to do more than with SCEWIN?



Interesting.

@Coderush,

Would it be possible to change a useless bios menu option to say something else and change the variable address? For example make an Option that says ‘pci lane control’ ‘16/0 8/8’ to something else like address bifurcation control from RcSetup on another lane? Thanks

Everything is possible with enough dedication, but it’s much easier to write a script for EFI shell to switch that setting than modify BIOS Setup.

Actually I have thanks to you learned how to alter the options in RU tool and verify the after effects. The only thing is I am confused about the hex codes that you see after you print out the setup variables in IFR utility. So not sure if it’s enough just to change a variable address?

Also I’m very dedicated. So much so. Been looking through the Intel specs and datasheets.

If you aren’t sure - try it and see what happens. Maybe it will be enough, maybe you’ll need an additional change somewhere else. The best way to find out is to experiment.

I’ve kind of hit a wall. I want to set a variable that exists in IntelRCSetup from the main Setup menu. Not sure how to do that…

@CodeRush and all,

Had success finally adding a new option to my MSI Godlike X99A Bios Menu!!! And it also writes a bit to the intended destination being the IntelSetup section of memory!!! Will detail the how I did it and steps soon!

Here I added a Bifurcation support sub-menu item:

Going to detail how I pulled this off for the benefit of others and for receiving suggestions from those that know more than myself. Basically I wanted to create a menu option that wrote a ‘0x0’ to IntelSetup subsection of my bios at address 0x539. This option turned on the ability to split a 8X pci-e lane into two 4X/4X lanes. First I needed to find out the register address. I did this by dumping the IntelSetup and Setup modules using UEFITool and using IFR-Extractor to study which variable corresponded to what ever feature I was interested in. Thats how I knew ‘0x539 - 0x53C’ was resposible for bifurcating 8X lanes and with RU I knew that 0x539 worked best. Anyhow back to talking about the menu modding. My bios had a hidden feature that needed AMIBCP to show it with USER rights called ‘PCI-Lane Allocation’ or something with ‘16/0’ and ‘8x/8x’ options and this option did nothing for me and locked up my system not allowing it to post so it was useless. So with AMIBCP ver 5.02 I changed the names to ‘Bifurcation Support’ with ‘ON’ and ‘OFF’ options and saved the file. The next step involved studying the IFR extracted code. Unfortunately it wasn’t as easy as copy pasting the binary code from IntelSetup (aka Platform inside UefiTool) for the x539 variable over the old ‘PCI-E lane Allocation’ menu item. It needed some alteration.

Studying the code this is what I had after AMIBCP alteration:

1
2
3
4
5
 
 Setting: Bifurcation Control, Variable: 0x535 {05 91 DF 0B E0 0B 8B 00 01 00 35 05 10 10 03 FF 00}
0x306B4 Option: OFF, Value: 0x3 {09 07 E3 0B 00 00 03}
0x306BB Option: ON, Value: 0x4 {09 07 E2 0B 00 00 04}
0x306C2 Option: Auto, Value: 0xFF {09 07 E1 0B 30 00 FF}
0x306C9 End of Options {29 02}
 


I'm going to break it down as best as I was able to understand. The '0x535' was basically a local variable to the Setup program. Had to change that to '0x539'. Thats done later in a hex editor.

The first '05 91' is knows as an op-code. The next two pairs reference variable identifiers in the Setup's string file. The first 'DF 0B' or 0BDF is a 'Prompt Token' number found at 0BDF in the string file as 'Bifurcation Support'. The next two hex numbers 'E0 0B' or 0BE0 is a 'Help Token' number found address the description in the string file. You can get AMIBCP to dump out the string file for review under its 'BIOS Strings' tab where you can also change its values.

The following two numbers, '8B 00' in this case is a 'Question ID' number which for the most part should be unique. The next token is a 'varStore ID' number where we find a '01 00' where I believe the '01' referenced the local Setup or its self. If you looked at the top of the Setup and Platform IFR file you would see this:

Var Store: 0x1[1020] (Setup) {24 1C 43 D6 87 EC A4 EB B5 4B A1 E5 3F 3E 36 B2 0D A9 01 00 FC 03 53 65 74 75 70 00}
..
..
..
Var Store: 0x28[6091] (IntelSetup) {24 21 43 D6 87 EC A4 EB B5 4B A1 E5 3F 3E 36 B2 0D A9 28 00 CB 17 49 6E 74 65 6C 53 65 74 75 70 00}

So I assumed the '01' referenced itself and '28' the Platform variables I wanted to modify. Not sure what those sets of numbers refer to. Wasn't a GUID.

So I changed the menu code to this instead:

1
2
3
4
5
6
 
True {46 02}
0x306A3 Setting: PCIE Bifurcation Support, Variable: 0x539 {05 91 DF 0B E0 0B 6F 02 28 00 39 05 10 10 00 FF 00}
0x306B4 Option: OFF, Value: 0x1 {09 07 E3 0B 00 00 01}
0x306BB Option: ON, Value: 0x0 {09 07 E2 0B 00 00 00}
0x306C2 Option: Auto, Value: 0xFF {09 07 E1 0B 30 00 FF}
0x306C9 End of Options {29 02}
 



After the 'VarStore ID' we find the 'varStoreInfo' variable which is what and where the setup program writes in memory to make changes at the intended address.
Here is '39 05' also known as our 0x539 variable. Note that the FF at the end is the default value. I copied and pasted the ON OFF options without needing to change values.
In my case '0x1' turned the function off and and '0x0' turned it on. Whats important is that you don't change the local variable values because you'll get the wrong strings
being displayed in the menu but I took a chance and changed the '01' to a '28'.

I did this by searching for the original code in a hex editor inside the 'Setup.bin' file and replaced it accordingly to my new altered code detailed above.

Then I flashed it using fptw64. Was easier than using the bios flash utility, and rebooted and went into bios to examine the changes.

Even though it all looked good had to verify that IntelSetup at 0x539 was being changed to a '00' and thanks Coderush's suggestion to use RU Utility that wasn't a problem.

Now working as it should.

Has anyone an Idea how to extend a Bios Menu? In this Case the option to change Core Ratio 5-8 on an Maximus 8 Impact Board.

I extracted the Setup Module as binary file and here are the options for changing core 1-4. My Question is, is there a way to extend it to core 5-8?



Full File is attached

setup.zip (524 KB)

What do you want to do exactly?

The Bios is unlocked for Coffe Lake Support. I want the possibility to change the core ratio from core 1-8 independent. At the moment it´s only possible to change core 1-4.

If you could please post a screenshot of the bios page in question?