From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VYdPA-0001tZ-UR for mharc-grub-devel@gnu.org; Tue, 22 Oct 2013 10:57:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYdP0-0001t2-Td for grub-devel@gnu.org; Tue, 22 Oct 2013 10:57:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYdOp-0001Dg-S8 for grub-devel@gnu.org; Tue, 22 Oct 2013 10:57:46 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:27894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYdOp-0001Db-Kj for grub-devel@gnu.org; Tue, 22 Oct 2013 10:57:35 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r9MEvULU002377 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Oct 2013 14:57:30 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9MEvSfd019492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Oct 2013 14:57:29 GMT Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9MEvSNH019454; Tue, 22 Oct 2013 14:57:28 GMT Received: from phenom.dumpdata.com (/50.195.21.189) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 22 Oct 2013 07:57:27 -0700 Received: by phenom.dumpdata.com (Postfix, from userid 1000) id 42BAE1C253F; Tue, 22 Oct 2013 10:57:24 -0400 (EDT) Date: Tue, 22 Oct 2013 10:57:24 -0400 From: Konrad Rzeszutek Wilk To: "Woodhouse, David" Subject: Re: EFI and multiboot2 devlopment work for Xen Message-ID: <20131022145724.GA18763@phenom.dumpdata.com> References: <20131021125756.GA3626@debian70-amd64.local.net-space.pl> <20131021135437.GD1283@fenchurch.internal.datastacks.com> <20131021185758.GD3626@debian70-amd64.local.net-space.pl> <1382433990.1657.66.camel@hastur.hellion.org.uk> <5266620602000078000FCA48@nat28.tlf.novell.com> <1382435127.1657.70.camel@hastur.hellion.org.uk> <526668A502000078000FCA7B@nat28.tlf.novell.com> <20131022134252.GA27302@phenom.dumpdata.com> <1382449985.18283.12.camel@hastur.hellion.org.uk> <7gf8ufyngxh0extp8a0ifnrp.1382451526144@email.android.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7gf8ufyngxh0extp8a0ifnrp.1382451526144@email.android.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 Cc: "grub-devel@gnu.org" , "keir@xen.org" , Ian Campbell , "stefano.stabellini@eu.citrix.com" , Daniel Kiper , "linux-kernel@vger.kernel.org" , "ross.philipson@citrix.com" , Jan Beulich , "boris.ostrovsky@oracle.com" , "xen-devel@lists.xen.org" , "Maliszewski, Richard L" X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 14:57:55 -0000 On Tue, Oct 22, 2013 at 02:18:52PM +0000, Woodhouse, David wrote: > > > I wonder why Linux can't make the EFI calls to fetch them itself? > > It can. It does. It prefers to. This is what the "EFI boot stub" is all about. But grub2 is crack-inspired and likes to do all kinds of crap that it shouldn't. It is an exercise in complexity for complexity's sake. The 'linuxefi' method is actually not really Linux-specific; it just boots an EFI executable (which the bzImage *is* when compiled that way). Perhaps I am reading the wrong code, but I am unable to find this in the source. I am looking in grub_cmd_linux in grub-core/loader/i386/efi/linux.c (Fedora 19 src RPM) and I see: if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) { if (!grub_errno) grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); goto fail; } if (lh.boot_flag != grub_cpu_to_le16 (0xaa55)) { grub_error (GRUB_ERR_BAD_OS, N_("invalid magic number")); goto fail; } if (lh.setup_sects > GRUB_LINUX_MAX_SETUP_SECTS) { grub_error (GRUB_ERR_BAD_OS, N_("too many setup sectors")); goto fail; } .. snip.. if (!lh.handover_offset) { grub_error (GRUB_ERR_BAD_OS, N_("kernel doesn't support EFI handover")); goto fail; } Which would imply that the header MUST have a Linux x86/boot header. Which GRUB2 module can boot an non-Linux x86/boot header? > > Seriously, forget bootloaders (especially grub2) and make it a COFF/PE executable. Then everything should just work, including Secure Boot etc. > > And bootloaders can still load that, of course. That 'that' is a standard PE/COFF image? Could you please point me to the code that does that in GRUB2? Thanks!