From 78f961efe91838e561907479fb52d23415c9b00e Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 24 Nov 2013 06:13:45 +0100 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ grub-core/boot/i386/pc/boot.S | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) 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: