You are not logged in.

#1 2019-02-18 23:03:13

AmagicalFishy
Member
Registered: 2016-12-10
Posts: 69

What is the uefi-shell equivalent of setup_var for altering the BIOS?

There are a few tutorials out there which use some EFI shell (presumably a thing in the Windows boot partition) that has the command "setup_var"

For example, a part of a dump of my BIOS might look something like this:

0x387DA 	Setting: Intel Graphics Pei Display Peim, Variable: 0x839 {05 91 D0 06 D1 06 AA 04 01 00 39 08 10 10 00 01 00}
0x387EB 		Option: Enabled, Value: 0x1 {09 07 94 00 00 00 01}
0x387F2 		Option: Disabled, Value: 0x0 {09 07 95 00 00 00 00}
0x387F9 		Default: 8 Bit, Value: 0x0 {5B 06 00 00 00 00}
0x387FF 		Default: 8 Bit, Value: 0x0 {5B 06 01 00 00 00}
0x38805 	End of Options {29 02}

In which case I would boot into the shell and type in something like: "setup_var 0x839 0x1"

I've searched through the documentation of uefi-shell-git, but the closest commands I've found were "setvar" (which I believe is something totally different—it sets variables for EFI bootup) and "mm" (which lets me change the value of things according to their memory-address).

I suspect that there is some way to use "mm" to achieve what I want (the numbers on the left of what I pasted are the addresses of the bios parameters, if I'm not mistaken, no the address of the variable itself).

What is the equivalent of "setup_var" in this shell?

Last edited by AmagicalFishy (2019-02-18 23:11:13)

Offline

#2 2023-03-08 12:48:28

JamesKen
Member
Registered: 2023-03-08
Posts: 1

Re: What is the uefi-shell equivalent of setup_var for altering the BIOS?

:necromancer:

That looks like output from Universal-IFR-Extractor [1]. Congratulations on your fearless dive into the dark inner recesses of your UEFI bios.

Behind the scenes, what `setup_var` does is access an EFI variable called "Setup". The variable contains a binary blob, and the command sets a particular binary value at a given offset inside that blob.

What IFRextract calls "VarStore" is mapped onto an EFI variable, via the GUID and "name" field that IFRextract reports for each varstore.

You can use the  `dmpstore`  command builtin to UEFI Shell to inspect EFI vars, including the "Setup" var.

See [2] for an EFI application which provides similar functionality to the `setup_var` command. To use it, save the `setup_var.efi` EFI application on any file system accessible by UEFI Shell, then boot into UEFI Shell and run `setup_var.efi` to do what you need.

I've also seen references that imply `setup_var` is UEFI shell builtin command, but that doesn't seem to be the case. from what I can tell that command was (at least once) available via patches to either UEFI shell, or grub. But never in upstream "UEFI shell"


[1] https://github.com/datasone/setup_var.efi
[2] https://github.com/LongSoft/Universal-IFR-Extractor

Last edited by JamesKen (2023-03-08 12:50:28)

Offline

Board footer

Powered by FluxBB