grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Move BSD and multiboot boot helper out of the kernel to their respec


From: Robert Millan
Subject: Re: Move BSD and multiboot boot helper out of the kernel to their respective modules
Date: Sat, 7 Feb 2009 23:14:58 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

On Thu, Jan 29, 2009 at 04:57:08PM +0100, phcoder wrote:
> Index: loader/i386/bsd_helper.S
> ===================================================================
> --- loader/i386/bsd_helper.S  (revision 0)
> +++ loader/i386/bsd_helper.S  (revision 0)
> @@ -0,0 +1,26 @@
> +#include <grub/symbol.h>
> +     
> +     .p2align        2       /* force 4-byte alignment */
> +
> +/*
> + * Use cdecl calling convention for *BSD kernels.
> + */
> +
> +FUNCTION(grub_unix_real_boot)
> +
> +        call    EXT_C(grub_stop_floppy)
> +
> +     /* Interrupts should be disabled.  */
> +        cli
> +
> +     /* Discard `grub_unix_real_boot' return address.  */
> +        popl    %eax
> +
> +        /* Fetch `entry' address ...  */
> +        popl %eax
> +
> +        /*
> +         * ... and put our return address in its place. The kernel will
> +         * ignore it, but it expects %esp to point to it.
> +         */
> +        call *%eax

This is small enough that it could make sense to use inline asm instead,
so we can avoid a separate file.  What do you think?

Also, it'd be better if you can submit two separate patches, one for BSD
and one for Multiboot.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]