Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Dec 2015 14:44:56 -0800
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Emmanuel Vadot <manu@bidouilliste.com>, 'Ed Maste' <emaste@freebsd.org>, Rui Paulo <rpaulo@freebsd.org>
Subject:   Re: boot1.efi and ConsoleControl on HP 840G1/G2
Message-ID:  <2690526.ic7VAp0tDr@ralph.baldwin.cx>
In-Reply-To: <20151119141026.c1c859703fc5fcc09d18d9b5@bidouilliste.com>
References:  <20151119120945.71d0cb068006398d3a556559@bidouilliste.com> <20151119141026.c1c859703fc5fcc09d18d9b5@bidouilliste.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, November 19, 2015 02:10:26 PM Emmanuel Vadot wrote:
> On Thu, 19 Nov 2015 12:09:45 +0100
> Emmanuel Vadot <manu@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,
> > 
> 
>  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.

Hmm, Rui added the console reset in r281059.  It sounds like you need to
revert the changes made there?  Does it work if you leave the reset and disable
the SetMode() bits?

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2690526.ic7VAp0tDr>