-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failsafe and Optimal are being ignored #9
Comments
I have found in my testing (see link below) that it takes optimized default settings from NVRAM. The solution would look like this:
So, how does UEFI Editor know what byte to change in NVRAM.bin? Example: Now, where is "Setup" within "StdDefault" within "AmiNvramMainRomAreaGuid"? What is Setup's offset within "StdDefault" within "AmiNvramMainRomAreaGuid"? In hex editor, it looks like this. Now, knowing that the Setup variable's body starts at 0xb8 within the user uploaded Volume_FFSv2_AmiNvramMainRomAreaGuid.vol file, add to that, the offset that UEFI Editor already knows is 0x5d. From there, adding "0x5d" gives us 0x115. This is the byte that needs changing to 0x1. I have posted some of my findings here: [Guide] Enabling hidden BIOS settings on Gigabyte Z690 mainboards. Only chapter 4 will be of interest to you. |
Has this been tested on other vendors' boards as well? |
So far, this has only been tested on one mainboard. If it helps, I have a few Intel PCs that I could test it with: ASUS Prime H470-PLUS, ASRock B360M-HDV, Gigabyte B660M DS3H DDR4. Also, Laptops (Intel 10th gen, 11th gen). Don;t know how much of this applies to Laptops though. |
Short answer: Very likely. Long answer: I've looked into the It basically boils down to whether the gap between |
Today, I tested this with my ASUS Prime H470-PLUS, to see if this works across different mainboard manufacturers. At first, I tried to change defaults in UEFI Editor and then to re-insert the resulting AMITSESetupData_body.bin. The I flashed and loaded optimized defaults. This did not work (which I kind of expected at this point but I wanted to try it). Then, I tried with the NVRAM StdDefaults method that I described above and this worked. Now we know, it works with ASUS too. To this, I can add, the offset of Setup was once again 0x8b. This is because it seems that the Setup variable is always first among the StdDefaults. But the other variables occur in different order, and therefore have different offsets within NVRAM. I excepted this. If this is done programmatically, the offsets/positions of StdDefault variables/VarStors, like PchSetup, cannot be assumed to be in the same place in every BIOS. Rather, they need to be found using UEFI Tool or some other tool. |
I'm aware the addresses are different. Check the image I sent above. It might be possible to figure out the offsets using just the |
Same problems on Gigabyte Z170N-GAMING 5; |
I have a couple dells here that I've flashed the bios a few dozen times in an attempt to over clock them. (It's just something to do) the issue above seems to be what I was facing. I ended up finding a copy of the correct version of amisce which doesn't change defaults but mostly accomplished what I needed. I'm more than willing to test out anything of them. I have a programmer to flash if bricked which I've had to use alot lol. |
It might not be possible to implement an unified workaround. Vendors do things differently. Thus, if workaround would require changing some fickle piece of code, you would need to write a very flexible algorithm. I want to present a routine that might be what you looking for. Executing which, I think, is the solution for Failsafe and Optimal are being ignored. But referring londbell:
Things are not that simple. In some cases, Defaults can be controlled by NVRAM too, along with values set in AMIBCP. |
I can confirm this method worked on Asus Crosshair X670E Gene to force CSM by default, by changing the failsafe value at the given offset. |
explain this |
It's the same method explained in one of the earlier posts: #9 (comment) I've changed the value in AmiNvramMainRomArea. The base address and header size and the offset are the same as the Setup variable is the first one for me as well. Then reinserted everything back and flashed with usb flashback function. |
First off, a huge thank you to @BoringBoredom for this amazing tool! I can confirm that the NVRAM editing method described by @HappyRogue658 for setting defaults works on the ASUS ROG STRIX B760-I board as well. Since this board doesn’t have USB-Flashback, I disabled Publish HII Resources and Password protection of Runtime Variables. I then tested setup_var and ru_uefi, but both resulted in write protection errors. Instead, I used the latest version of SCEWIN/AMISCE (v5.05.01.0002) to disable the BIOS lock. Afterward, I made a BIOS dump with FPTwin and used UEFI-Editor to modify the access levels and flashed it back with FPTwin. On this board, I had to change access level 9 to 1 to make hidden features visible. I also edited the NVRAM and noticed something interesting: if I reset the BIOS to factory defaults and dump it, the second NVRAM area doesn’t exist. However, when I change some settings and make another dump, a second entry appears. Additionally, UEFI-Editor sometimes shows values that aren’t present in the menu or in the AMISCE NVRAM export. For instance, when I try to set certain options, like Adaptive Mode, using SCE, I get an "out of range" error and the value doesn’t change. I’m not sure where UEFI-Editor gets these values? Some other examples are Intel Default Settings like 'Extreme' or SVID Behavior 'Trained,' that don't seem to have NVRAM values. I’m hesitant to try in change values values in another way as I don’t know what might happen. I’d prefer to avoid having to use my hardware flasher to recover incase it goes wrong. |
This behaviour is normal to EFI firmwares. The first NVRAM area is meant to always remain unchanged, it stores variables at their default values. And the second NVRAM area is created based on the first area, along with changes you applied in setup utility. When you click load defaults the bios switches to the first NVRAM, while its copy gets deleted.
There might be many instances with the same name but in different sub-menus. Sure you didn't miss one? UEFI Editor is basically enhanced version of AMIBCP, so it should expose every setting as it does AMIBCP. But it also has search function. You can try it on SVID voltage and see if there really 2 of them. |
Then I was not right on that. Didn't check, still don't wanna download bios file. If you look at the items in the IFR txt file you'll probably get a clue. I mean, options under a setting can be suppressed as well. If AMISCE is capable of handling this, this may be the reason some options arent available. |
No worries at all! I wasn’t expecting you to. Thanks for replying and clearing some things up!
You’re absolutely right, the options in the IFR extract do have a IFR_Extractor_output - Global Core SVID VoltageMin.: 0.005V | Max.: 0.635V | Standard: By CPU | Increment: 0.005V", QuestionFlags: 0x0, QuestionId: 0x41, VarStoreId: 0x30, VarOffset: 0x165, Flags: 0x11, Size: 16, Min: 0x0, Max: 0xFFFF, Step: 0x1 { 07 94 E8 27 E9 27 41 00 30 00 65 01 00 11 00 00 FF FF 01 00 } I hope this is not too much off-topic. |
Toggle all 2,982 occurrences? If so, I don't know any way. Often suppressions are nested, this makes almost impossible to toggle all of them using single expression. |
It would probably be a very bad idea anyway. I figured out by exporting the .json from UEFI-Editor, that the suppressions point to questionID's that don't have a name or description so they're not visible or searchable in this tool. I know what I need to do now, thanks for the help! |
@Denisuu try hex-editing the setup.sct file to match this: 0x6A02F: SuppressIf { 0A 82 }
0x6A031: Uint64 Value: 0x0 { 45 8A 00 00 00 00 00 00 00 00 }
- 0x6A03B: Uint64 Value: 0x0 { 45 0A 00 00 00 00 00 00 00 00 }
+ 0x6A03B: Uint64 Value: 0xFF { 45 0A FF 00 00 00 00 00 00 00 }
0x6A045: Equal { 2F 02 }
0x6A047: End { 29 02 }
0x6A049: SuppressIf { 0A 82 }
0x6A04B: EqIdVal QuestionId: 0x1574, Value: 0x7 { 12 86 74 15 07 00 }
0x6A051: Not { 17 02 }
0x6A053: End { 29 02 }
0x6A055: SuppressIf { 0A 82 }
- 0x6A057: EqIdVal QuestionId: 0x1594, Value: 0x1 { 12 06 94 15 01 00 }
+ 0x6A057: EqIdVal QuestionId: 0x1594, Value: 0xFF { 12 06 94 15 FF 00 }
0x6A05D: OneOfOption Option: "Adaptive Mode" Value: 3 { 09 07 89 27 00 00 03 }
0x6A064: End { 29 02 }
0x6A066: End { 29 02 }
0x6A068: End { 29 02 } If this still doesn't work, try moving |
That worked like a charm, also for the other options. Now everything I need, or might need in the future, is accessible. Thanks again! |
Failsafe
andOptimal
are being ignored, as seen here and here. I lack the necessary information on how to proceed implementing a workaround for these (probably very common) cases. If anyone can point me towards documentation or forum/blog posts dissecting this topic, please post here.The text was updated successfully, but these errors were encountered: