On Wed, Dec 28 2022, Mark Kettenis <[email protected]> wrote:
> Dear Sergii,
>
> Sorry for the delay, but I have finally found the time to work on the
> EFI variable and ESRT support for OpenBSD. As a first step, here is a
> diff that adds support for copying the ESRT in the bootloader and
> passing it on to the kernel.
>
> I adjusted your diff a bit. It now adds the new config_esrt member at
> the end of the bios_efiinfo struct and sets a flag to indicate that
> extra bit of information is present. That makes it possible to load
> new kernels with the old bootloader and vice versa.
>
> patrick@, mlarkin@, yasuoka@ and other devs: ok?
Tested on my x280, I used the following diff to check whether ESRT was
detected and copied:
efi0 at bios0: UEFI 2.5
efi0: Lenovo rev 0x1380, ESRT present
ok jca@
Index: arch/amd64/amd64/efi_machdep.c
===================================================================
RCS file: /home/cvs/src/sys/arch/amd64/amd64/efi_machdep.c,v
retrieving revision 1.4
diff -u -p -r1.4 efi_machdep.c
--- arch/amd64/amd64/efi_machdep.c 7 Nov 2022 01:41:57 -0000 1.4
+++ arch/amd64/amd64/efi_machdep.c 31 Dec 2022 03:38:20 -0000
@@ -135,9 +135,14 @@ efi_attach(struct device *parent, struct
printf("%s: ", sc->sc_dev.dv_xname);
for (i = 0; st->FirmwareVendor[i]; i++)
printf("%c", st->FirmwareVendor[i]);
- printf(" rev 0x%x\n", st->FirmwareRevision);
+ printf(" rev 0x%x", st->FirmwareRevision);
}
efi_leave(sc);
+
+ if (bios_efiinfo->flags & BEI_ESRT)
+ printf(", ESRT present");
+
+ printf("\n");
if (efi_enter_check(sc))
return;
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE