Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1G9tMg-00011Z-LM for mharc-grub-devel@gnu.org; Sun, 06 Aug 2006 20:53:06 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G9tMf-00011S-BS for grub-devel@gnu.org; Sun, 06 Aug 2006 20:53:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G9tMe-00011F-Oe for grub-devel@gnu.org; Sun, 06 Aug 2006 20:53:05 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G9tMe-00011C-Kf for grub-devel@gnu.org; Sun, 06 Aug 2006 20:53:04 -0400 Received: from [207.69.195.63] (helo=pop-satin.atl.sa.earthlink.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G9tQm-0002N8-8o for grub-devel@gnu.org; Sun, 06 Aug 2006 20:57:20 -0400 Received: from user-0vvde2g.cable.mindspring.com ([63.246.184.80] helo=[192.168.0.103]) by pop-satin.atl.sa.earthlink.net with esmtp (Exim 3.36 #1) id 1G9tMc-0005S7-00 for grub-devel@gnu.org; Sun, 06 Aug 2006 20:53:02 -0400 From: Hollis Blanchard To: The development of GRUB 2 In-Reply-To: <20060803065655.GA31825@icon.4k.ca> References: <20060803065655.GA31825@icon.4k.ca> Content-Type: text/plain Date: Sun, 06 Aug 2006 19:52:58 -0500 Message-Id: <1154911978.27074.113.camel@diesel> Mime-Version: 1.0 X-Mailer: Evolution 2.6.2 (2.6.2-1.fc5.5) Content-Transfer-Encoding: 7bit Subject: Re: [RFC][PATCH] vmlinux/vmlinux.bin loading capability X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2006 00:53:05 -0000 On Thu, 2006-08-03 at 00:57 -0600, Maciek Nowacki wrote: > > Here is an attempt at a patch to load and execute a vmlinux kernel image, > only tested with QEMU for x86_64. It is very preliminary, excludes a large > amount of planned functionality, and so far only boots the raw vmlinux.bin > file found in arch/[x86_64,i386]/boot/vmlinux.bin after compiling Linux with > the 'make vmlinux' target (and 'make bzImage' as well). This means that the > user must supply the entry point of the kernel on the GRUB command line. This > nastiness will be easily removed once vmlinux is used in place of > vmlinux.bin. > > vmlinux.bin is a derivative of the vmlinux kernel executable that is produced > by: > > objcopy -O binary linux-2.6.xx/vmlinux vmlinux.bin I have no comments on your motivation, but I do think that a binary loader would be valuable. In that case, it might make sense to refactor this code into a "binary" loader that exports a function that your Linux binary loader calls. Then you can isolate all this "linux_kernel_header" stuff from the binary loader. You want to combine these lines: + asm( "movl %0,%%esi" :: "m" (lh) ); + asm("jmp *%0" :: "m" (begin)); into a single asm statement (and make it volatile too). Otherwise, the compiler can insert instructions between the asm statements (especially at -O0), making you a very sad debugger. There are pretty flagrant coding style violations all over the place, so I won't comment on those. I will however say that "/* notes: grub leaks memory. */" is an extraordinarily bad way to submit a bug report. Finally, please don't call this a "vmlinux" loader. vmlinux is an ELF file. What you're loading is not. -Hollis