From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Meut3-0004uW-Bq for mharc-grub-devel@gnu.org; Sat, 22 Aug 2009 14:00:21 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Meusz-0004ly-3a for grub-devel@gnu.org; Sat, 22 Aug 2009 14:00:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Meusu-0004e9-9b for grub-devel@gnu.org; Sat, 22 Aug 2009 14:00:16 -0400 Received: from [199.232.76.173] (port=49544 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Meusu-0004dw-4T for grub-devel@gnu.org; Sat, 22 Aug 2009 14:00:12 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:47628) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Meust-0008Gy-Ki for grub-devel@gnu.org; Sat, 22 Aug 2009 14:00:11 -0400 Received: by ewy7 with SMTP id 7so1416664ewy.31 for ; Sat, 22 Aug 2009 11:00:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+ART3iozfArMempHrYD3OtZHeB0g/kYwKAm4C783YuA=; b=at7M7zLKGmnB/ATm1EcCaWkwelUiD8ybq8M47kdeyUitW8xRBWCJ36TuNfDGpybHAI TMNP9xtevdCx6OdhfCA7O52bkDN75X30WXZch++J+sNXm3W05mxqEebQSKnwRCdnmwwE 2nHJEdLJLARjnTgopeP51xUBK7mAu3tD6D04o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Rg6VVEzvlQqLj3SZ/QY4jlnWp2Ue93XIhTiiD10gfW9WkHT8x6S1O2YBZeocSJK9dm zGaa0xNLAa9W1n+JGUwIVcuuIQVu4s8gcogVPemz5VitX7WcBqUHzdseD8dr0TqgpCqW LVFZ1Zfii8smeVpsplaLyXgbCn+MxSDrtIe0k= MIME-Version: 1.0 Received: by 10.210.17.14 with SMTP id 14mr2767550ebq.11.1250964010195; Sat, 22 Aug 2009 11:00:10 -0700 (PDT) In-Reply-To: <20090810114103.GG9344@thorin> References: <20090810114103.GG9344@thorin> Date: Sat, 22 Aug 2009 20:00:10 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: Report: compil error on OSX for target=i386 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, 22 Aug 2009 18:00:17 -0000 On Mon, Aug 10, 2009 at 1:41 PM, Robert Millan wrote: > On Sat, Aug 08, 2009 at 10:44:25PM +0800, Bean wrote: >> Hi, >> >> I also encounter this problem with apple gcc 4.0, the fix is to replace: >> >> asm volatile ("jmp *%2" : : "b" (0), "S" (real_mode_mem), "g" >> (params->code32_start)); >> >> With: >> =A0 asm volatile ("movl %0, %%ecx" : : "m" (params->code32_start)); >> =A0 asm volatile ("movl %0, %%esi" : : "m" (real_mode_mem)); >> >> =A0 asm volatile ("xorl %%ebx, %%ebx" : : ); >> =A0 asm volatile ("jmp *%%ecx" : : ); > > I think I did precisely the opposite change a while ago, with the purpose= of > general cleanup (to make it more compact and avoid generating unnecessary > instructions). What about following compromise: diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 4144384..1380eb8 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -543,7 +543,8 @@ grub_linux_boot (void) asm volatile ("lgdt %0" : : "m" (gdt_desc)); /* Enter Linux. */ - asm volatile ("jmp *%2" : : "b" (0), "S" (real_mode_mem), "g" (params->code32_start)); + asm volatile ("xorl %%ebx, %%ebx\n" + "jmp *%1" : : "S" (real_mode_mem), "g" (params->code32_start)); #endif --=20 Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git