From owner-freebsd-current@FreeBSD.ORG Thu May 22 15:54:06 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80842DBC for ; Thu, 22 May 2014 15:54:06 +0000 (UTC) Received: from mail-qg0-x233.google.com (mail-qg0-x233.google.com [IPv6:2607:f8b0:400d:c04::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4159E202C for ; Thu, 22 May 2014 15:54:06 +0000 (UTC) Received: by mail-qg0-f51.google.com with SMTP id q107so5998920qgd.10 for ; Thu, 22 May 2014 08:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=mrOxoPT/uG6TA4FbrTaOR2ovksfrvWvpYeR1UMbVBPM=; b=mYelXebrDkRMWzBmNohcTGNCH8yHn+TDAp0HFJwTRv070MHW8j1nn79EdpQy4BFFnJ e/itkkXIms8pTkfuiesxUduhNgh1C2zi5Ka2K8CVtwXo4iQbN4A9x9S/83LAW3OKugY9 RzgBqhTbdPav5MAfnVmAf2DoI9MK0nUh+crCGn5T0N7cKnMb5/rnGr/7WVqduUt154F0 anZwV/AhVfjqFlLhTx6kYjf7NuzuoM6EbGy02pacZnSPnieGiLTlFkl5KLQjxm0rrvW2 DbTq7sojm38PjR3Lj1GP2g1u7/ts+RJ0qvNUcuLlC6Ru0l8iSpOP8BEFxYUNypeb538N 9Gfw== MIME-Version: 1.0 X-Received: by 10.224.50.205 with SMTP id a13mr69682892qag.19.1400774045387; Thu, 22 May 2014 08:54:05 -0700 (PDT) Sender: carpeddiem@gmail.com Received: by 10.140.49.239 with HTTP; Thu, 22 May 2014 08:54:05 -0700 (PDT) In-Reply-To: References: Date: Thu, 22 May 2014 11:54:05 -0400 X-Google-Sender-Auth: d48Ewe4KX7YEU4U4EiWmtPGLNag Message-ID: Subject: Re: [patch] Switch to text mode during efi boot From: Ed Maste To: =?UTF-8?Q?Rafael_Esp=C3=ADndola?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 15:54:06 -0000 On 22 May 2014 11:32, Rafael Esp=C3=ADndola wr= ote: > The attached patch causes both boot1 and loader.efi to switch to text > mode. This only > seems to make a difference on Macs where otherwise no information was bei= ng > displayed. > > The ConsoleControl.h file is copied from > EdkCompatibilityPkg/Foundation/Protocol/ConsoleControl in > https://github.com/tianocore/edk2. > > I tested that both programs are able to change to text mode by > enabling only one of them at a time. > > With this patch I am able to see loaders output on all the macs I > tried. The kernel boots correctly on a MacPro, but unfortunately it > doesn't seem to be able to find the efi buffer in a MacBookPro. Great, thank you Rafael. There's framebuffer corruption issues on some other hardware as well, so it may be that the eventual fix for those will also solve the MBP issue. > Some design questions: > > * Why do we have both boot1 and loader? It is just the issue with > building a usb image without root that requires having a boot1 that > has a predictable size? No, boot1.efi only exists so that the loader and related Forth and config files can be placed in a UFS root filesystem, as is done with the x86 BIOS boot and on other platforms. This way the UEFI boot easily integrates with the existing installer and tools. We could put the loader and files in the FAT EFI system partition instead, but it would require more substantial changes in the installer and system configuration. > * Even if we want to keep both boot1 and loader, could boot1 use libefi? I don't think there's any fundamental reason we couldn't. However, we're going to need to take a broader look at reworking some of this in the context of secure boot anyway (as we look at a signed shim loader). > * Is it ok to always switch to text mode in libefi or should it > provide a switch_to_text_mode function? I suspect it's fine / correct to always switch; we've just been "lucky" that the current approach works with most firmwares.