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.
This commit is contained in:
Vladimir Serbinenko 2013-11-24 06:13:45 +01:00
parent 09bc0a577d
commit 78f961efe9
2 changed files with 14 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2013-11-24 Vladimir Serbinenko <phcoder@gmail.com>
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 <phcoder@gmail.com>
With Apple assembly in .macro environvemnt you have to use $$ instead

View file

@ -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: