Received: from mailman by lists.gnu.org with archive (Exim 4.33) id 1CaDOB-0004vK-Hm for mharc-grub-devel@gnu.org; Fri, 03 Dec 2004 08:22:23 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CaDO9-0004v2-8O for grub-devel@gnu.org; Fri, 03 Dec 2004 08:22:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CaDO8-0004uq-PN for grub-devel@gnu.org; Fri, 03 Dec 2004 08:22:21 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CaDO8-0004um-Lx for grub-devel@gnu.org; Fri, 03 Dec 2004 08:22:20 -0500 Received: from [145.74.66.11] (helo=mail-cn.han.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CaDEE-0000qb-I4 for grub-devel@gnu.org; Fri, 03 Dec 2004 08:12:06 -0500 Received: from localhost (charlie.han.nl [145.74.66.9]) by mail-cn.han.nl (Postfix) with ESMTP id B1682AB05 for ; Fri, 3 Dec 2004 13:51:58 +0100 (CET) Received: from mail-cn.han.nl ([145.74.66.11]) by localhost (charlie.han.nl [145.74.66.9]) (amavisd-new, port 10024) with ESMTP id 03085-06 for ; Fri, 3 Dec 2004 13:51:56 +0100 (CET) Received: from mail1.han.nl (mail1.han.nl [145.74.103.11]) by mail-cn.han.nl (Postfix) with ESMTP id 6D497A90C for ; Fri, 3 Dec 2004 13:51:56 +0100 (CET) Received: from marco.marco-g.com (mgerards.xs4all.nl [82.92.27.129]) by mail1.han.nl (Postfix) with ESMTP id 26124C04B for ; Fri, 3 Dec 2004 13:51:56 +0100 (CET) Mail-Copies-To: metgerards@student.han.nl To: The development of GRUB 2 References: <20041203053646.GA22463@miracle> From: Marco Gerards Date: Fri, 03 Dec 2004 12:50:47 +0000 In-Reply-To: <20041203053646.GA22463@miracle> (Hollis Blanchard's message of "Thu, 2 Dec 2004 23:36:46 -0600") Message-ID: <87mzwvlf4o.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@vscan-cn.han.nl Subject: Re: [ppc patch] grub-mkimage 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: Fri, 03 Dec 2004 13:22:21 -0000 Hollis Blanchard writes: > I'm going to be on vacation next week, so I wanted to get this out so > others could continue progress on PPC module loading... this is not > ready for inclusion, but it is functional. Comments are welcome. Nice! Enjoy your vacation. > Use the -n/--note switch to add the CHRP NOTE segment on CHRP platforms > (e.g. briQ and Pegasos). NEVER use this switch on Power Macintosh. I > guess that should be documented better in the help text, but anyways... Oh, weird. For me grubof worked on the PegasosII without doing this. > It may be possible to place module variables into their own section > containing nothing else, yet still in a LOAD segment. Then grub-mkimage > could parse the *section* table (right now it only does segments) and > overwrite the contents of this section to inform the runtime of the > module location. I'm not convinced it's worth the effort. Whatever is the most flexible seems the best to me... > I'm firmly convinced that grub_load_modules(), currently in kern/main.c, > will need to be changed to a more generic interface. For example, each > arch could provide its own grub_module_start() and grub_module_end() > functions. It is no longer a valid assumption that the modules begin > immediately after grub_end_addr in memory. But for now I will leave that > to someone (Marco?) doing the real module loading; grub-mkimage just > needs to get it into memory (which I've verified it does). Right, I agree. AS Hollis said, I'm working on the relocator for PPC at the moment. It is quite easy, but PPC_REL24 is a bit more complex. It is used for relative jumps. That means the module should be loaded close to grubof, which IMHO really sucks... For some reason my REL24 code does not work, when it does I will send in a patch. But there are 3 options we should consider: - Making sure REL24 should not be used. This can be done using the -mlongcall option. Still, after using this the module will not work when it uses libraries, this is a gcc bug that has been fixed last week. The library that we use is libgcc. If we choose for eliminating all calls to libgcc and if we use -mlongcall the relocator will work. The disadvantage of this solution is that the modules will get a bit bigger. - It is possible to fix the relocator just to use PPC_REL24, but in that case the module should be loaded near grubof. - What linux uses is jumping to some code near the module and that code does a long jump into grubof. This is the hardest solution and I don't yet have enough knowledge to do this. I am now trying to get option 2 to work first (by using black magic to get everything loaded at the right address ;)) and when module loading works for me I will try to make 3 work. Does someone else think I try to do something else, or can someone help a bit somehow? As you might have noticed I really suck at this stuff and doing it just because no one else does. ;) Thanks, Marco