Received: from mailman by lists.gnu.org with archive (Exim 4.33) id 1ClDBT-0005xL-AA for mharc-grub-devel@gnu.org; Sun, 02 Jan 2005 16:22:43 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1ClDBQ-0005x4-Q3 for grub-devel@gnu.org; Sun, 02 Jan 2005 16:22:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1ClDBP-0005wX-Op for grub-devel@gnu.org; Sun, 02 Jan 2005 16:22:40 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1ClDBP-0005wN-Kb for grub-devel@gnu.org; Sun, 02 Jan 2005 16:22:39 -0500 Received: from [145.74.66.11] (helo=mail-cn.han.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ClCzO-0000jS-SQ for grub-devel@gnu.org; Sun, 02 Jan 2005 16:10:15 -0500 Received: from vscan-ca.han.nl (mars.han.nl [145.74.129.116]) by mail-cn.han.nl (Postfix) with ESMTP id 3BB678CA6 for ; Sun, 2 Jan 2005 22:05:57 +0100 (CET) Received: from mail-cn.han.nl ([145.74.66.51]) by vscan-ca.han.nl (mars.han.nl [145.74.129.116]) (amavisd-new, port 10024) with LMTP id 03959-01-95 for ; Sun, 2 Jan 2005 22:05:53 +0100 (CET) Received: from mail1.han.nl (mail1.han.nl [145.74.103.11]) by mail-cn.han.nl (Postfix) with ESMTP id 31F198D36 for ; Sun, 2 Jan 2005 22:05:53 +0100 (CET) Received: from marco.marco-g.com (mgerards.xs4all.nl [82.92.27.129]) by mail1.han.nl (Postfix) with ESMTP id DEC39C069 for ; Sun, 2 Jan 2005 22:05:52 +0100 (CET) Mail-Copies-To: metgerards@student.han.nl To: The development of GRUB 2 References: <20050102190204.GA27325@miracle> From: Marco Gerards Date: Sun, 02 Jan 2005 21:05:21 +0000 In-Reply-To: <20050102190204.GA27325@miracle> (Hollis Blanchard's message of "Sun, 2 Jan 2005 13:02:04 -0600") Message-ID: <87ekh3r17y.fsf@marco.marco-g.com> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new (2.2.0) at vscan-ca.han.nl Subject: Re: grub-mkimage and module loading 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: Sun, 02 Jan 2005 21:22:41 -0000 Hollis Blanchard writes: > This is a more complete patch for PPC grub-mkimage that I posted a while > back. Important points: > - move grub_load_modules() into i386/pc as grub_arch_load_modules() > - implement PPC's grub_arch_load_modules() using an in-memory structure > telling us how many modules to expect I would prefer a grub_load_modules and a function to return the address and size of the modules in memory. I explained this in my other email. Anyway, I'd prefer this to work the same on every machine and this code to be shared. > - the structure contains a version field to avoid grub-mkimage/grub > binary layout mismatches I don't think versioning is required. > I think there is still some PC cleanup needed, e.g. grub_end_addr and > grub_add_unused_region() should also be moved into i386 code, but my > patch is already fairly large, and I'd prefer a PC person were involved > in this additional cleanup anyways. Ok. Can you at least make sure it compiles on the PC and try not to break it? > This patch has been tested and is needed to load modules on PPC. Please > comment soon so we can get PPC modules working in the main tree... I assume you will make a changelog entry when the patch is more or less ok? It's easier to review a patch using a changelog entry. > Index: include/grub/kernel.h > =================================================================== > RCS file: /cvsroot/grub/grub2/include/grub/kernel.h,v > retrieving revision 1.4 > diff -u -p -r1.4 kernel.h > --- include/grub/kernel.h 4 Apr 2004 13:46:00 -0000 1.4 > +++ include/grub/kernel.h 2 Jan 2005 19:01:53 -0000 > @@ -31,8 +31,14 @@ struct grub_module_header > grub_size_t size; > }; > > -/* The start address of the kernel. */ > -extern grub_addr_t grub_start_addr; ... > -/* Return the end address of the core image. */ > -grub_addr_t grub_get_end_addr (void); Doesn't this break the PC port? > +/* TODO: endianness */ Better move this to the TODO list. > +void load_note (Elf32_Phdr *phdr, const char *dir, FILE *out) GCS nitpick: put the return type on a separate line: void load_note (Elf32_Phdr *phdr, const char *dir, FILE *out) Same for all other functions, btw. > +void load_modules (Elf32_Phdr *phdr, const char *dir, char *mods[], FILE *out) > +{ > + char *module_img; > + struct grub_util_path_list *path_list, *p; Please use separate lines for every declaration: struct grub_util_path_list *path_list; struct grub_util_path_list *p; Thanks, Marco