From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rv6IX-0007kc-9B for qemu-devel@nongnu.org; Wed, 08 Feb 2012 07:07:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rv6IR-000595-H9 for qemu-devel@nongnu.org; Wed, 08 Feb 2012 07:06:53 -0500 Received: from mail-lpp01m010-f45.google.com ([209.85.215.45]:63576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rv6IR-000591-9h for qemu-devel@nongnu.org; Wed, 08 Feb 2012 07:06:47 -0500 Received: by lahi5 with SMTP id i5so432455lah.4 for ; Wed, 08 Feb 2012 04:06:46 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <87y5sdejnb.fsf@frosties.localnet> References: <87y5sdejnb.fsf@frosties.localnet> Date: Wed, 8 Feb 2012 12:06:46 +0000 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Support for multiboot images in elf64 (EM_X86_64) format List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Goswin von Brederlow Cc: qemu-devel@nongnu.org On Wed, Feb 8, 2012 at 9:53 AM, Goswin von Brederlow wr= ote: > Stefan Hajnoczi writes: > >> On Sat, Feb 4, 2012 at 5:38 PM, Goswin von Brederlow = wrote: >>> Description: Allow 64bit elf binaries in multiboot format >>> =A0This patch allows 64bit elf files with multiboot header to be loaded= . >>> =A0The entry point will still be called in 32bit mode and the kernel >>> =A0must switch to 64bit mode on its own. The image and all modules must >>> =A0also be located in the lower 2GB of ram. All the restrictions of a >>> =A032bit image still apply. >>> Author: Goswin von Brederlow >>> Last-Updated: 2011-04-08 >>> --- >> >> The multiboot specification is 32-bit only. =A0This patch enables a >> non-standard 64-bit version of multiboot. =A0Have you checked whether >> GRUB or other multiboot loaders have equivalent functionality? =A0Have >> you contacted the multiboot specification authors? > > Not really. The multiboot specification allow for different executable > formats as long as the multiboot header is correct. For example you can > have an a.out multiboot image. The entry vector specified in the > multiboot header is still called in 32bit mode, as per specs. All that > changes is that the kvm allows another executable format for loading the > image. > > Actually per mutliboot specs the elf64 image should already be loaded as > plain image (which means not neccessarily reloacted to the right > address) just like a.out would but kvm doesn't support that. > > I don't think other loaders support elf64 (yet) unless they support > plain images. Frankly I never tried booting a toy kernel on real > hardware so there never was the need. Yes, this is why I asked about support in other software. If each bootloader implements a different custom method then it will be a pain to run your binary on real hardware in the future. It's worth at least checking their source first - maybe there is already a similar code path that we can be compatible with, hence making life easier for developers who want to play with 64-bit payloads in multiboot executables. Stefan