Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.43 KB

README.md

File metadata and controls

40 lines (30 loc) · 1.43 KB

SetCon

SetCon manipulates the console variables: ConIn, ConOut, ErrOut and ConInDev, ConOutDev, ErrOutDev.

Use it to see the current devices encoded:

fs0:\> SetCon ConOut
ConOut:
   VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenMsg(DFA66065-B419-11D3-9A2D-0090273FC14D)
   PciRoot(0x0)/Pci(0x2,0x0)/AcpiAdr(0x80010100)

Use it to set the variables:

  • -i takes a handle index as produced by dh.
  • -h takes an actual EFI_HANDLE value.
  • -p takes a textual path representation.

The optional -a flag results in appending the new path to the existing set of device paths instead of replacing.

fs0:\> SetCon -i AA ConIn
fs0:\> SetCon -h 1ABCDEF01 ErrOutDev
fs0:\> SetCon -a -p PciRoot(0x0)/Pci(0x2,0x0)/AcpiAdr(0x80010100) ConOut

Note that no validation is done on the device path. Yes, you can set ConOut to your disk drive. No, it won't work or do anything.

Finally, the -A option will automatically build console variables from the current available devices. This is especially interesting in Shell scripts. The example below loads a GOP driver, sets ConOut to include the video device, and forces UEFI to refresh active consoles by disconnecting and reconnecting all drivers to devices.

ShellMapVar.efi
%mapvar%
ShellPlatVars.efi
if x%pvar-smbios-manufacturer% eq xQEMU then
    load QemuVideoDxe.efi
    SetCon -A ConOut
    reconnect -r
endif