Page 2 of 5
#16 RE: Add option in AMI UEFI bios menu (how to?) by davidm71 23.12.2017 22:25

avatar

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.

#17 RE: Add option in AMI UEFI bios menu (how to?) by oldirdey 31.07.2018 22:16

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

#18 RE: Add option in AMI UEFI bios menu (how to?) by davidm71 31.07.2018 22:18

avatar

What do you want to do exactly?

#19 RE: Add option in AMI UEFI bios menu (how to?) by oldirdey 31.07.2018 22:21

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.

#20 RE: Add option in AMI UEFI bios menu (how to?) by davidm71 31.07.2018 22:55

avatar

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

#21 RE: Add option in AMI UEFI bios menu (how to?) by oldirdey 31.07.2018 23:00

No Problem, here you go. Picture is taken from ASUS Homepage but it shows the Menu. You can Sync All Cores (that is working in the modded bios and all cores, up to 8, will be set) But you can´t change the core ratio for each core up to 8 cores, only 4. Sorry for my bad english.

#22 RE: Add option in AMI UEFI bios menu (how to?) by davidm71 31.07.2018 23:06

avatar

So you want essentially to have '1-core ratio limit' to '8-core ratio limit' with eight entries listed? Looking at your IFR Code looks like maybe variable 1DF controlls this setting set by the '8 bit unsigned int' last byte value. This is what I would do. Create a RU.EFI Usb disk and take a look at what variable 1DF is set at after different values are set of Core Ratio Limit. I would do this so you don't spend time reflashing your bios every time you get something wrong. I see a pattern though in values '02' to '04' being set for each setting. Perhaps higher values may affect higher cores. Perhaps not. Worth experimenting with that first. Also good to read the specification and datasheet for your processor and see if its actually supported because if that doesn't work maybe there is a register you could set instead.

#23 RE: Add option in AMI UEFI bios menu (how to?) by davidm71 31.07.2018 23:14

avatar

Also can I see a little more of that form a few lines earlier?

#24 RE: Add option in AMI UEFI bios menu (how to?) by oldirdey 31.07.2018 23:28

Yes, that is what I want, eight entries for every core. I think the CPU can handle it (coffee lake 6 core) but the problem is that the board was not designed for more then 8 cores (4 native plus HT) I will try what you said in the next few days, I have to wait for some conductive tape to bridge two contacts underneath the cpu.

Sure, here is the part a few lines earlier. If you want to see the full text, it´s inside the attachment in post #17.

#25 RE: Add option in AMI UEFI bios menu (how to?) by davidm71 01.08.2018 05:15

avatar

@oldirdey

I looked into your setup ifr code for the latest Maximus Impact 8 bios ver 3801 and this is what I found for every 'Core Ratio Limit':

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
Suppress If: {0A 82}
0x4D1B3 Variable 0xEA4 equals value in list (0x0, 0x1) {14 0A A4 0E 02 00 00 00 01 00}
0x4D1BD String: , Variable: 0x1FD5 {1C 90 78 1A 7C 1A 0F 29 34 00 D5 1F 14 00 14 00}
0x4D1CD End {29 02}
0x4D1CF Suppress If: {0A 82}
0x4D1D1 True {46 02}
0x4D1D3 Numeric: (1103806597128-1103806597128) , Variable: 0x1FD4 {07 91 02 00 02 00 BC 00 34 00 D4 1F 00 10 00 FF 01}
0x4D1E4 Default: 8 Bit, Value: 0x0 {5B 06 00 00 00 00}
0x4D1EA End {29 02}
0x4D1EC End If {29 02}
0x4D1EE End If {29 02}
0x4D1F0 Suppress If: {0A 82}
0x4D1F2 Variable 0xEA4 equals value in list (0x0, 0x1, 0x2) {14 0C A4 0E 03 00 00 00 01 00 02 00}
0x4D1FE String: , Variable: 0x1FFE {1C 90 79 1A 7D 1A 10 29 34 00 FE 1F 14 00 14 00}
0x4D20E End {29 02}
0x4D210 Suppress If: {0A 82}
0x4D212 True {46 02}
0x4D214 Numeric: (1103806597128-1103806597128) , Variable: 0x1FFD {07 91 02 00 02 00 BD 00 34 00 FD 1F 00 10 00 FF 01}
0x4D225 Default: 8 Bit, Value: 0x0 {5B 06 00 00 00 00}
0x4D22B End {29 02}
0x4D22D End If {29 02}
0x4D22F End If {29 02}
0x4D231 Suppress If: {0A 82}
0x4D233 Variable 0xEA4 equals value in list (0x0, 0x1, 0x2, 0x3) {14 0E A4 0E 04 00 00 00 01 00 02 00 03 00}
0x4D241 String: , Variable: 0x2027 {1C 90 7A 1A 7E 1A 11 29 34 00 27 20 14 00 14 00}
0x4D251 End {29 02}
0x4D253 Suppress If: {0A 82}
0x4D255 True {46 02}
0x4D257 Numeric: (1103806597128-1103806597128) , Variable: 0x2026 {07 91 02 00 02 00 BE 00 34 00 26 20 00 10 00 FF 01}
 



The numeric variables that hold the ratio values are 1FAB, 1FD4, 1FFD, and 2026. Interesting to note that they ascend by 29 hexadecimal increment after each one. That 29 value increase is also present for the Maximus X Hero which is setup for an 8 core cpu with 8 Core Ratio Values. The problem is wether or not if you extrapolate the next 4 values and change them would they do anything or not because the bios may not be coded to respond to those variables. So I would recommend you create an RU efi fat32 formated usb disk and copy RU.EFI onto the EFI/BOOT folder and rename bootx64.efi and boot from it. Also turn on per core ratio mode and change the first 4 ratio values. Then in RU.efi check out those first variables within 'SETUP' and also change the value of 0x204F (which is 2026+29) and see if the value of the 5th core changes. If so then it would be simple to make changes to the bios though adding entries would require removal of equal bytes to keep the file size the same possibly. First tackle one problem at a time. Verify the addresses that affect your 5th to 8th cores!

Good Luck!

#26 RE: Add option in AMI UEFI bios menu (how to?) by oldirdey 01.08.2018 12:09

@davidm71 Thank you very much for your response and effort to look into the file. I´ll be back in a few days and will tell you my result with RU.EFI.

#27 RE: Add option in AMI UEFI bios menu (how to?) by davidm71 02.08.2018 04:50

avatar

@oldirdey

Look forward to hearing about your results!

#28 RE: Add option in AMI UEFI bios menu (how to?) by davidm71 02.08.2018 21:52

avatar

I just wanted share the latest version of Universal IFR Extractor ver LS 0.3 by LongSoft which is a fork of Donavon6000's IFR Extractor which only goes to version 0.5 I believe. I compiled it myself for 64 bit Windows as LongSoft (aka CodeRush) only published the source code and I got to say it does a nicer job in that its more descriptive translating the byte code.

Here it is for others to play with: http://www.mediafire.com/file/777arjm4cb...tractor.7z/file

#29 RE: Add option in AMI UEFI bios menu (how to?) by Lost_N_BIOS 03.08.2018 10:30

avatar

Thanks @davidm71 - Here's 0.7 of the other one. Not sure where I found, or which source it's compiled from?
https://www.sendspace.com/file/66f7m0

#30 RE: Add option in AMI UEFI bios menu (how to?) by davidm71 04.08.2018 09:39

avatar

Version .7 output looks exactly like LS .3. I studied and compared the IFR from both versions and could not find a difference. Thanks for sharing your copy.

Xobor Forum Software von Xobor
Datenschutz