[patch] Switch to text mode during efi boot

Ed Maste emaste at freebsd.org
Fri May 23 20:35:38 UTC 2014


On 22 May 2014 11:32, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
>
> The ConsoleControl.h file is copied from
> EdkCompatibilityPkg/Foundation/Protocol/ConsoleControl in
> https://github.com/tianocore/edk2.

I'm not aware of the full ancestry of our EFI include files, but it
looks like the initial import made some attempt to bring them to
FreeBSD style.  For example, our eficon.h is a version of
SimpleTextOut.h and efiser.h is SerialIo.h.  For consistency with the
existing files I'll probably rename this one to eficonctl.h.

        printf(" \n>> FreeBSD EFI boot block\n");
        printf("   Loader path: %s\n", path);

+       EFI_BOOT_SERVICES *BS = systab->BootServices;
+       EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL;
+       status = BS->LocateProtocol(&ConsoleControlGUID, NULL, (VOID
**)& ConsoleControl);
+       if (EFI_ERROR(status))
+               panic("No console control protocol located");
+
+       status = ConsoleControl->SetMode(ConsoleControl,
EfiConsoleControlScreenText);
+       if (EFI_ERROR(status))
+               panic("Could not switch to text mode");

I think we want to move the mode setting earlier so those printfs
work, and it probably makes sense to silently ignore failure from
LocateProtocol or SetMode.  If we're already in text mode the failure
doesn't matter, and if we're not, the panic won't help diagnose the
problem.

Anyhow, I'll commit a version of this soon.


More information about the freebsd-current mailing list