From: Vladimir Serbinenko Date: Sun, 24 Nov 2013 05:13:45 +0000 (+0100) Subject: Apple assembly doesn't handle symbol arithmetic well. So instead X-Git-Tag: grub-2.02-beta1~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78f961efe91838e561907479fb52d23415c9b00e;p=thirdparty%2Fgrub.git Apple assembly doesn't handle symbol arithmetic well. So instead of getting addres of kernel_sector + 4 define kernel_sector_high. It also makes code more readable. --- diff --git a/ChangeLog b/ChangeLog index 32d7f0958..751c04774 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-11-24 Vladimir Serbinenko + + Apple assembly doesn't handle symbol arithmetic well. So instead + of getting addres of kernel_sector + 4 define kernel_sector_high. + It also makes code more readable. + 2013-11-24 Vladimir Serbinenko With Apple assembly in .macro environvemnt you have to use $$ instead diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S index ee0b9d621..8338f87b0 100644 --- a/grub-core/boot/i386/pc/boot.S +++ b/grub-core/boot/i386/pc/boot.S @@ -181,7 +181,9 @@ kernel_address: #ifndef HYBRID_BOOT . = _start + GRUB_BOOT_MACHINE_KERNEL_SECTOR kernel_sector: - .long 1, 0 + .long 1 +kernel_sector_high: + .long 0 #endif . = _start + GRUB_BOOT_MACHINE_BOOT_DRIVE @@ -286,7 +288,7 @@ lba_mode: /* the absolute address */ movl kernel_sector, %ebx movl %ebx, 8(%si) - movl kernel_sector + 4, %ebx + movl kernel_sector_high, %ebx movl %ebx, 12(%si) /* the segment of buffer address */ @@ -355,7 +357,7 @@ LOCAL(final_init): setup_sectors: /* load logical sector start (top half) */ - movl kernel_sector + 4, %eax + movl kernel_sector_high, %eax orl %eax, %eax jnz LOCAL(geometry_error) @@ -507,7 +509,9 @@ LOCAL(message): #ifdef HYBRID_BOOT . = _start + 0x1b0 kernel_sector: - .long 1, 0 + .long 1 +kernel_sector_high: + .long 0 #endif . = _start + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC nt_magic: