Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 May 2014 16:35:37 -0400
From:      Ed Maste <emaste@freebsd.org>
To:        =?UTF-8?Q?Rafael_Esp=C3=ADndola?= <rafael.espindola@gmail.com>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: [patch] Switch to text mode during efi boot
Message-ID:  <CAPyFy2AwraycW9OM0PZiGcH5eCRZZut8-w-mfbZ0Na=-Rpujsg@mail.gmail.com>
In-Reply-To: <CAG3jReLhdO7xdM8W8M65iokD9y5tFDTR7vRO0Tz8C6d0e5Q3Jw@mail.gmail.com>
References:  <CAG3jReLhdO7xdM8W8M65iokD9y5tFDTR7vRO0Tz8C6d0e5Q3Jw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 22 May 2014 11:32, Rafael Esp=C3=ADndola <rafael.espindola@gmail.com> wr=
ote:
>
> 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 =3D systab->BootServices;
+       EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl =3D NULL;
+       status =3D BS->LocateProtocol(&ConsoleControlGUID, NULL, (VOID
**)& ConsoleControl);
+       if (EFI_ERROR(status))
+               panic("No console control protocol located");
+
+       status =3D 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2AwraycW9OM0PZiGcH5eCRZZut8-w-mfbZ0Na=-Rpujsg>