From owner-freebsd-hackers@freebsd.org Sat Dec 19 21:02:20 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99FCBA4DE29 for ; Sat, 19 Dec 2015 21:02:20 +0000 (UTC) (envelope-from rpaulo@me.com) Received: from mr11p00im-asmtp004.me.com (mr11p00im-asmtp004.me.com [17.110.69.135]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86C4211CB; Sat, 19 Dec 2015 21:02:20 +0000 (UTC) (envelope-from rpaulo@me.com) MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset=UTF-8 Received: from akita.hsd1.ca.comcast.net (c-73-162-13-215.hsd1.ca.comcast.net [73.162.13.215]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0NZM00GTWIFPIS00@mr11p00im-asmtp004.me.com>; Sat, 19 Dec 2015 21:02:14 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-12-19_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1512190388 Message-id: <1450558933.2348.11.camel@me.com> Subject: Re: boot1.efi and ConsoleControl on HP 840G1/G2 From: Rui Paulo To: John Baldwin , freebsd-hackers@freebsd.org Cc: Emmanuel Vadot , 'Ed Maste' , Rui Paulo Date: Sat, 19 Dec 2015 13:02:13 -0800 In-reply-to: <2690526.ic7VAp0tDr@ralph.baldwin.cx> References: <20151119120945.71d0cb068006398d3a556559@bidouilliste.com> <20151119141026.c1c859703fc5fcc09d18d9b5@bidouilliste.com> <2690526.ic7VAp0tDr@ralph.baldwin.cx> X-Mailer: Evolution 3.18.2-1 X-Mailman-Approved-At: Sun, 20 Dec 2015 02:47:32 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2015 21:02:20 -0000 On Fri, 2015-12-18 at 14:44 -0800, John Baldwin wrote: > On Thursday, November 19, 2015 02:10:26 PM Emmanuel Vadot wrote: > > On Thu, 19 Nov 2015 12:09:45 +0100 > > Emmanuel Vadot 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/I > > > MG_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.bidouil > > liste.com/images/efi/IMG_2649.JPG > >  This is the screen when the console is not reseted : https://www.b > > idouilliste.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? At least we need to find a way to reset certain consoles.  My changes were intended to reset the console and use the best available mode which worked on my laptop and got rid of the Lenovo logo that was stuck during boot1+loader. -- Rui Paulo