On Mon, Aug 10, 2009 at 1:41 PM, Robert Millan<r...@aybabtu.com> 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: >> asm volatile ("movl %0, %%ecx" : : "m" (params->code32_start)); >> asm volatile ("movl %0, %%esi" : : "m" (real_mode_mem)); >> >> asm volatile ("xorl %%ebx, %%ebx" : : ); >> 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 -- Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel