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." _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel