From owner-freebsd-current@FreeBSD.ORG Fri May 23 20:35:38 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 664585EF for ; Fri, 23 May 2014 20:35:38 +0000 (UTC) Received: from mail-qc0-x232.google.com (mail-qc0-x232.google.com [IPv6:2607:f8b0:400d:c01::232]) (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 26D8E2407 for ; Fri, 23 May 2014 20:35:38 +0000 (UTC) Received: by mail-qc0-f178.google.com with SMTP id l6so8966549qcy.9 for ; Fri, 23 May 2014 13:35:37 -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=DTAJLEBK/dZm6pW6Gl1aXcuPZm8nFJhlZvk/LiSTcMA=; b=UNye2EAO86n0ywFK0tCxAyFZFerm92Ls5/0QOA9I3wWyt/FZUf6jY2KNePLbKADMuF pT2pUWCvbUjGkAljRrSLMXdKtYLTyZ4DMJDfb4L8hqlN024mcGVnbMopfWGcNNgIEO89 dzPnZDiH2M/QPPdQqKPoXY3FRzq7KSHnNFZ6FG1VdGBCEBSUVCwqS4NlHZPLv5OIsvW/ NHj1cPzK1hy8Wix/6TQsHmnBwLaLQPwq6JDp0DOTIUKM0bUnTC0dFS7aW0iReYqMxF1d 90HBAAcOnmWeGzRH2kAORBizkvbRJPce3xRO55el5acoXytXeAEFd5Af3J8DkcTSJZ6e ns2A== MIME-Version: 1.0 X-Received: by 10.229.58.68 with SMTP id f4mr10710495qch.18.1400877337335; Fri, 23 May 2014 13:35:37 -0700 (PDT) Sender: carpeddiem@gmail.com Received: by 10.140.49.239 with HTTP; Fri, 23 May 2014 13:35:37 -0700 (PDT) In-Reply-To: References: Date: Fri, 23 May 2014 16:35:37 -0400 X-Google-Sender-Auth: XBjOwzyI5BchzJBwzzMAmkF9OQQ 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: Fri, 23 May 2014 20:35:38 -0000 On 22 May 2014 11:32, Rafael Esp=C3=ADndola 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.