From: Marco Gerards <metgerards@student.han.nl>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [patch] PPC build fixes
Date: Mon, 21 Feb 2005 19:28:08 +0100 [thread overview]
Message-ID: <87fyzppy2v.fsf@student.han.nl> (raw)
In-Reply-To: <20050219233439.GA17519@miracle> (Hollis Blanchard's message of "Sat, 19 Feb 2005 17:34:40 -0600")
Hollis Blanchard <hollis@penguinppc.org> 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 <hollis@penguinppc.org>
>
> * 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
next prev parent reply other threads:[~2005-02-21 18:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-19 23:34 [patch] PPC build fixes Hollis Blanchard
2005-02-20 13:39 ` Yoshinori K. Okuji
2005-02-20 16:38 ` Hollis Blanchard
2005-02-20 18:41 ` Yoshinori K. Okuji
2005-02-21 18:30 ` Marco Gerards
2005-02-21 18:28 ` Marco Gerards [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-03-24 3:00 Hollis Blanchard
2005-03-24 21:41 ` Marco Gerards
2005-03-25 14:58 ` Hollis Blanchard
2005-03-25 17:40 ` Marco Gerards
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fyzppy2v.fsf@student.han.nl \
--to=metgerards@student.han.nl \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.