Hi,

a collegue of mine recently tried to get OpenBSD running on an HP E820
laptop. Apparently this machine is UEFI only and its BIOS only works
in a 240x56 text mode.

So he did the patch below to add support for this mode to efiboot.

I've asked him to provide us a dmesg and acpidump for this machine
too. In the mean time here is his patch. I've tried it on the NUC that
I have been using with efiboot, it doesn't break it.

Index: efiboot.c
===================================================================
RCS file: /cvs/OpenBSD/src/sys/arch/amd64/stand/efiboot/efiboot.c,v
retrieving revision 1.11
diff -u -p -u -r1.11 efiboot.c
--- efiboot.c   4 Feb 2016 09:19:39 -0000       1.11
+++ efiboot.c   12 Mar 2016 09:16:05 -0000
@@ -357,7 +357,7 @@ static void
 efi_video_init(void)
 {
        EFI_CONSOLE_CONTROL_PROTOCOL    *conctrl = NULL;
-       int                              i, mode80x25, mode100x31;
+       int                              i, mode80x25, mode100x31, mode240x56;
        UINTN                            cols, rows;
        EFI_STATUS                       status;
 
@@ -369,20 +369,25 @@ efi_video_init(void)
                        EfiConsoleControlScreenText);
        mode80x25 = -1;
        mode100x31 = -1;
-       for (i = 0; ; i++) {
+       mode240x56 = -1;
+       for (i = 0; i < conout->Mode->MaxMode; i++) {
                status = EFI_CALL(conout->QueryMode, conout, i, &cols, &rows);
                if (EFI_ERROR(status))
-                       break;
+                       continue;
                if (mode80x25 < 0 && cols == 80 && rows == 25)
                        mode80x25 = i;
                if (mode100x31 < 0 && cols == 100 && rows == 31)
                        mode100x31 = i;
+               if (mode240x56 < 0 && cols == 240 && rows == 56)
+                       mode240x56 = i;
                if (i < nitems(efi_video)) {
                        efi_video[i].cols = cols;
                        efi_video[i].rows = rows;
                }
        }
-       if (mode100x31 >= 0)
+       if (mode240x56 >= 0)
+               EFI_CALL(conout->SetMode, conout, mode240x56);
+       else if (mode100x31 >= 0)
                EFI_CALL(conout->SetMode, conout, mode100x31);
        else if (mode80x25 >= 0)
                EFI_CALL(conout->SetMode, conout, mode80x25);

-- 
Matthieu Herrb

Attachment: signature.asc
Description: PGP signature

Reply via email to