boot1.efi and ConsoleControl on HP 840G1/G2
Emmanuel Vadot
manu at bidouilliste.com
Thu Nov 19 13:10:32 UTC 2015
On Thu, 19 Nov 2015 12:09:45 +0100
Emmanuel Vadot <manu at bidouilliste.com> wrote:
>
> Hello Hackers,
>
> After hours I've found why I couldn't use properly FreeBSD on my HP 840G1/G2 laptop.
>
> What is happening right now with -current is that the kernel framebuffer is garbage (https://www.bidouilliste.com/images/efi/IMG_2650.JPG).
> The problem is that boot1.efi calls ConsoleControl which, from my findings, is not in the UEFI specs but was only in the EDK implementation.
> This should not be a problem as LocateProtocol should return != EFI_SUCCESS but on my laptops (and probably others) this is not the case.
>
> After removing the ConsoleControl related lines and recompiling boot1.efi I can now boot FreeBSD.
>
> I'm pretty sure that this would not be a problem on other machine (with the patch I can still boot correctly FreeBSD on my Samsung 870Z laptop) but I would prefer that other people test it.
>
> I've opened a bug on bugzilla (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204674) if some people want to try the patch.
>
> Cheers,
>
> --
> Emmanuel Vadot <manu at bidouilliste.com>
Replying to myself cause I've found other stuff.
I looked at GRUB sources and it do what boot1.efi do (use ConsoleControl to set the Console to text mode, grub_efi_set_text_mode in grub-core/kern/efi/efi.c).
The only difference that I can see between how GRUB handle the EFI console and boot1 is that grub never Reset the Console nor change the current text mode (grub-core/term/efi/console.c).
So I patched again boot1.efi leaving the ConsoleControl stuff on but commented the Reset and the SetMode stuff, and this worked.
This is the screen when the console is Reset : https://www.bidouilliste.com/images/efi/IMG_2649.JPG
This is the screen when the console is not reseted : https://www.bidouilliste.com/images/efi/IMG_2651.JPG
From loader(8) with the current boot1.efi, if I type gop list I got 4 modes but all of them are 1920x1280.
If I gop set X and gop set 0 (1920x1280) (Or via loader.rc), when the kernel start the framebuffer data is correct.
From loader(8) with the patched boot1.efi, if I type gop list I got the 4 correct modes.
Cheers,
--
Emmanuel Vadot <manu at bidouilliste.com>
More information about the freebsd-hackers
mailing list