2009-08-14 Pavel Roskin <proski@gnu.org>

* boot/i386/pc/cdboot.S: Use LOCAL for local labels.  Eliminate
	ABS and APPLE_CC.
	* boot/i386/pc/diskboot.S: Likewise.
	* boot/i386/pc/lnxboot.S: Likewise.  Hardcode the number of code
	sectors allow compilation on MacOSX.
	* conf/i386-pc.rmk: Enable unconditional compilation of
	lnxboot.img.
This commit is contained in:
proski 2009-08-14 04:12:22 +00:00
parent 9a10df160e
commit d404ee5646
5 changed files with 63 additions and 164 deletions

View file

@ -17,6 +17,7 @@
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/symbol.h>
#include <grub/boot.h>
#include <grub/machine/boot.h>
#include <grub/machine/kernel.h>
@ -38,9 +39,9 @@
start:
_start:
call next
call LOCAL(next)
next:
LOCAL(next):
jmp 1f
. = start + 8
@ -67,24 +68,17 @@ bi_reserved:
movw %ax, %ds
movw %ax, %es
#ifdef APPLE_CC
err_noboot_msg_abs = 0x7C00 + err_noboot_msg - start
movw $err_noboot_msg_abs, %si
bi_length_dif = bi_length - next
movl %cs:bi_length_dif(%bx), %ecx
#else
movw $(0x7C00 + err_noboot_msg - start), %si
movl %cs: bi_length - next(%bx), %ecx
#endif
movl %cs: bi_length - LOCAL(next)(%bx), %ecx
orl %ecx, %ecx
jz fail
jz LOCAL(fail)
addl $((1 << CDSEC_SHIFT) - 1), %ecx
shrl $CDSEC_SHIFT, %ecx
movl %cs: bi_file - next(%bx), %esi
movl %cs: bi_file - LOCAL(next)(%bx), %esi
call read_cdrom
call LOCAL(read_cdrom)
ljmp $(DATA_ADDR >> 4), $0
@ -93,7 +87,7 @@ bi_reserved:
* esi: start sector
* ecx: number of sectors
*/
read_cdrom:
LOCAL(read_cdrom):
xorl %eax, %eax
/* Number of blocks to read. */
@ -134,7 +128,7 @@ read_cdrom:
2:
shrw $1, %di /* Reduce transfer size. */
jz cdrom_fail
jz LOCAL(cdrom_fail)
movw %di, 0x10(%si)
movw %di, 2(%si)
movb $0x42, %ah
@ -155,15 +149,10 @@ read_cdrom:
addw $0x12, %sp
ret
cdrom_fail:
#ifdef APPLE_CC
err_cdfail_msg_abs = 0x7C00 + err_cdfail_msg - start
movw $(err_cdfail_msg_abs), %si
#else
LOCAL(cdrom_fail):
movw $(0x7C00 + err_cdfail_msg - start), %si
#endif
fail:
LOCAL(fail):
movb $0x0e, %ah
xorw %bx, %bx
1: