[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131022145724.GA18763@phenom.dumpdata.com>
Date: Tue, 22 Oct 2013 10:57:24 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To: "Woodhouse, David" <david.woodhouse@...el.com>
Cc: Ian Campbell <ian.campbell@...rix.com>,
Jan Beulich <JBeulich@...e.com>,
"ross.philipson@...rix.com" <ross.philipson@...rix.com>,
"stefano.stabellini@...citrix.com" <stefano.stabellini@...citrix.com>,
"grub-devel@....org" <grub-devel@....org>,
"Maliszewski, Richard L" <richard.l.maliszewski@...el.com>,
"xen-devel@...ts.xen.org" <xen-devel@...ts.xen.org>,
"boris.ostrovsky@...cle.com" <boris.ostrovsky@...cle.com>,
Daniel Kiper <daniel.kiper@...cle.com>,
Peter Jones <pjones@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"keir@....org" <keir@....org>
Subject: Re: EFI and multiboot2 devlopment work for Xen
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!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists