datasone / grub-mod-setup_var

A modified grub allowing tweaking hidden BIOS settings.
GNU General Public License v3.0
372 stars 38 forks source link

Hello, I am having trouble modifying the Bios of Fujitsu T732, and I hope to get your help. #20

Closed nsby494 closed 3 years ago

nsby494 commented 3 years ago

Hello, I am having trouble modifying the Bios of Fujitsu T732, and I hope to get your help. The bios version is 1.12. I want to unlock the two contents of CFG LOCK and BIOS LOCK. Question A: But the content of CFG LOCK cannot be found in the BIOS, and the corresponding content can be found with the prompt in UEFI Patch. In comparison, I would rather use your method for safety reasons.

Question B: The BIOS LOCK field can be found, but the modification is unsuccessful One Of: BIOS Lock, VarStoreInfo (VarOffset/VarName): 0x17E, VarStore: 0xD, QuestionId: 0x1E9, Size: 1 VarStore: VarStoreId: 0xD [04BD8413-15F9-43F3-9675-4618E03240E3], Size: 0x223, Name: PchProtocolSetupVar When I use the command: setup_var_vs PchProtocolSetupVar 0x17E An error is prompted during execution. Maybe it’s because I didn’t understand it correctly, but I still hope you can help me., but I still hope you can help me. I will pass the extracted BIOS file to you together.If you have free time, I hope to take the time to help me solve these two problems. Thank you very much. I uploaded the extracted BIOS file here: T732-1.12.zip T732 Bios IFR.txt

datasone commented 3 years ago

About CFG Lock: I looked up your PC, it has a Ivy Bridge CPU. Well, many pre-Skylake CPU has the MSR 0xE2 unlocked, and it's until Skylake when most BIOS come with "CFG Lock" setting item. So it is normal that your firmware doesn't have it. And about UEFIPatch, it is an active and extensively tested project, and for older platforms, its patches may do better. I think if you want to modify your BIOS, you can feel free to use it.

About BIOS Lock: The setup_var_vs command is used for multi byte variables in "Setup" varstore. You can access variables in other varstores using setup_var_cv. In your condition, you can read the variable by:

setup_var_cv PchProtocolSetupVar 0x17E

And you could write it (e.g. to 0x00) by:

setup_var_cv PchProtocolSetupVar 0x17E 0x01 0x00

Here the 0x01 is for the variable size (Size: 1)

nsby494 commented 3 years ago

关于CFG Lock: 我查了一下您的PC,它有一个Ivy Bridge CPU。 好吧,许多Skylake之前的CPU都已解锁MSR 0xE2,直到Skylake为止,大多数BIOS都带有“ CFG Lock”设置项。因此,您的固件没有固件是正常的。 关于UEFIPatch,它是一个活跃且经过广泛测试的项目,对于较旧的平台,其补丁可能会做得更好。我认为,如果您要修改BIOS,可以随时使用它。

关于BIOS锁定: 该setup_var_vs命令用于“设置” varstore中的多字节变量。您可以使用来访问其他varstore中的变量setup_var_cv。 在您的情况下,可以通过以下方式读取变量:

setup_var_cv PchProtocolSetupVar 0x17E

您可以通过以下方式将其写入(例如,写入0x00):

setup_var_cv PchProtocolSetupVar 0x17E 0x01 0x00

这里的0x01是可变大小(Size: 1

I tried it your way, and the following prompt appeared: WechatIMG3

datasone commented 3 years ago

Are you using the new release here? Those commands are added in this release. And due to legacy code reasons (the setup_var2 patch), the new commands are treated as setup_var2 if using old grub shell.

nsby494 commented 3 years ago

Yes,I am using the new release.

datasone commented 3 years ago

There was a bug that causing the tool to operate on "Setup" variable even in custom varstore mode, so there are "offset out of range" messages, because the offset is larger than the "Setup" variable. I've fixed the problem, can you test this and see if there is any errors? If things is right, there will be a new release with the fix. modGRUBShell-test.zip

nsby494 commented 3 years ago

I tried the new test version, and the value returned after running is 0x00, but in fact it should return 0x01 to be correct. As shown below: WechatIMG3

datasone commented 3 years ago

I assume you have got the wrong picture? This seems the same as the one above. BTW, the value is the last parameter, so you need setup_var_cv PchProtocolSetupVar 0x17E 0x01 0x01 to set that value to 0x01.