From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1D3Ih7-0001Qy-QN for mharc-grub-devel@gnu.org; Mon, 21 Feb 2005 13:54:09 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D3Igv-0001NP-Ng for grub-devel@gnu.org; Mon, 21 Feb 2005 13:53:58 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D3Igo-0001J0-Bx for grub-devel@gnu.org; Mon, 21 Feb 2005 13:53:51 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D3Igm-0001Cw-RM for grub-devel@gnu.org; Mon, 21 Feb 2005 13:53:48 -0500 Received: from [145.74.66.11] (helo=mail-cn.han.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D3INC-0006Aa-0U for grub-devel@gnu.org; Mon, 21 Feb 2005 13:33:34 -0500 Received: from vscan-cn.han.nl (venus.han.nl [145.74.65.6]) by mail-cn.han.nl (Postfix) with ESMTP id 8D20E9C05 for ; Mon, 21 Feb 2005 19:28:10 +0100 (CET) Received: from mail-cn.han.nl ([145.74.66.11]) by vscan-cn.han.nl (venus.han.nl [145.74.65.6]) (amavisd-new, port 10024) with ESMTP id 28309-05 for ; Mon, 21 Feb 2005 19:28:09 +0100 (CET) Received: from mail1.han.nl (mail1.han.nl [145.74.103.11]) by mail-cn.han.nl (Postfix) with ESMTP id 1F76E9BDA for ; Mon, 21 Feb 2005 19:28:08 +0100 (CET) Received: from localhost.localdomain (mgerards.xs4all.nl [82.92.27.129]) by mail1.han.nl (Postfix) with ESMTP id DB543C05A for ; Mon, 21 Feb 2005 19:28:07 +0100 (CET) Mail-Copies-To: metgerards@student.han.nl To: The development of GRUB 2 References: <20050219233439.GA17519@miracle> From: Marco Gerards Date: Mon, 21 Feb 2005 19:28:08 +0100 In-Reply-To: <20050219233439.GA17519@miracle> (Hollis Blanchard's message of "Sat, 19 Feb 2005 17:34:40 -0600") Message-ID: <87fyzppy2v.fsf@student.han.nl> User-Agent: Gnus/5.1007 (Gnus v5.10.7) 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-cn.han.nl Subject: Re: [patch] PPC build fixes 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, 21 Feb 2005 18:54:05 -0000 Hollis Blanchard writes: > This patch fixes PowerPC build breakage from the recent grub-emu changes. Of > note: > > - grub_reboot and grub_halt in util/i386/pc/misc.c are not > architecture-specific, so have been moved to util/grub-emu.c. > > - commands/ieee1275/halt.c and reboot.c are no longer > architecture-specific either. This is because we now want those > commands to be loaded in grub-emu, and of course grub-emu does not > emulate Open Firmware. Accordingly, these files are moved up to the > commands directory. Since i386 needs a special argument ("no-apm"), it > still uses its version in commands/i386/pc. > > - since grub_machine_fini isn't called yet, I haven't yet figured out > how to release the memory indicated in the comments. > > OK? > > -Hollis > > 2005-02-19 Hollis Blanchard > > * commands/ieee1275/halt.c (grub_cmd_halt): Call grub_halt. > Move file... > * commands/halt.c: ... to here. > * commands/ieee1275/reboot.c (grub_cmd_reboot): Call grub_reboot. > Move file... > * commands/reboot.c: ... to here. If you do this, you could delete the PC specific reboot and halt commands. Personally I like separate reboot and halt commands. If you do it like this it will become hard/ugly to make platform specific changes, I think. > * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_fini): New > function. > * include/grub/powerpc/ieee1275/ieee1275.h (grub_reboot): Add > prototype. Better put this in `include/grub/powerpc/ieee1275/init.h', just like it is done for the PC. Perhaps it would be even better to have a new header file for such things. > (grub_halt): Likewise. > * kern/powerpc/ieee1275/init.c (heap_start): Make global. > (heap_len): Likewise. `New variable.' would be more appropriate, I think. Can you put a prefix before the function name? > (grub_machine_fini): New function. It's really nice that we have this now. :) > * kern/powerpc/ieee1275/openfw.c (grub_reboot): New function. > (grub_halt): Likewise. > * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_fini): New > function. You have added grub_console_fini, not grub_ofconsole_fini. > void > +grub_machine_fini (void) > +{ > + grub_ofdisk_fini (); > + grub_console_fini (); > + > + grub_ieee1275_release (heap_start, heap_len); > + /* XXX Release memory claimed in 'linux' and 'initrd' commands. */ > + /* XXX Release memory claimed for Old World firmware. */ > +} Why would you release the memory for linux and initrd? IIRC there is a callback function. I think it should work like this: In case someone quits GRUB: - longjump (?) - Release the memory for the loader (use grub_loader_unset). - Call grub_console_fini. - Call grub_ofdisk_fini. - Release the heap. In case someone starts a loader the same should be done, except calling grub_loader_unset. After that the OS should be loaded. I wonder what should happen when the OS can not be loaded. Perhaps GRUB just has to fail or so. Thanks, Marco