Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LVvSW-0004qY-H7 for mharc-grub-devel@gnu.org; Sat, 07 Feb 2009 17:15:32 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVvSU-0004pk-A9 for grub-devel@gnu.org; Sat, 07 Feb 2009 17:15:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVvSS-0004pY-Gh for grub-devel@gnu.org; Sat, 07 Feb 2009 17:15:29 -0500 Received: from [199.232.76.173] (port=58195 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVvSS-0004pV-Ae for grub-devel@gnu.org; Sat, 07 Feb 2009 17:15:28 -0500 Received: from aybabtu.com ([69.60.117.155]:49796) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LVvSS-0003ol-16 for grub-devel@gnu.org; Sat, 07 Feb 2009 17:15:28 -0500 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1LVvNF-0006Cv-Q7 for grub-devel@gnu.org; Sat, 07 Feb 2009 23:10:06 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1LVvRy-00028s-6s for grub-devel@gnu.org; Sat, 07 Feb 2009 23:14:58 +0100 Date: Sat, 7 Feb 2009 23:14:58 +0100 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090207221458.GM6343@thorin> References: <4981D1D4.2080102@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4981D1D4.2080102@gmail.com> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: Move BSD and multiboot boot helper out of the kernel to their respective modules 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: Sat, 07 Feb 2009 22:15:30 -0000 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 > + > + .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."