Support mkrescue on sparc64.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-04-14 17:10:55 +02:00
parent aa1af9bbda
commit 8ca86b3a03
7 changed files with 122 additions and 26 deletions

View file

@ -283,10 +283,19 @@ image = {
image = {
name = cdboot;
i386_pc = boot/i386/pc/cdboot.S;
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
sparc64_ieee1275 = boot/sparc64/ieee1275/boot.S;
sparc64_ieee1275_objcopyflags = '-O a.out-sunos-big';
sparc64_ieee1275_ldflags = ' -Wl,-Ttext=0x4000';
sparc64_ieee1275_cppflags = '-DCDBOOT=1';
objcopyflags = '-O binary';
enable = sparc64_ieee1275;
enable = i386_pc;
};

View file

@ -28,6 +28,7 @@ pic_base:
call boot_continue
mov %o4, CIF_REG
#ifndef CDBOOT
/* The offsets to these locations are defined by the
* GRUB_BOOT_MACHINE_foo macros in include/grub/sparc/ieee1275/boot.h,
* and grub-setup uses this to patch these next three values as needed.
@ -43,9 +44,19 @@ pic_base:
. = _start + GRUB_BOOT_MACHINE_BOOT_DEVPATH
boot_path:
. = _start + GRUB_BOOT_MACHINE_KERNEL_BYTE
boot_path_end:
kernel_byte: .xword (2 << 9)
boot_path_end:
kernel_address: .word GRUB_BOOT_MACHINE_KERNEL_ADDR
#else
#define boot_path (_start + 512)
#define boot_path_end (_start + 1024)
#include <grub/offsets.h>
. = _start + 8
kernel_byte: .xword (2 << 9)
kernel_size: .word 512
kernel_address: .word GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS
#endif
prom_finddev_name: .asciz "finddevice"
prom_chosen_path: .asciz "/chosen"
@ -158,8 +169,10 @@ boot_continue:
mov GRUB_NAME_LEN, %o3
GET_ABS(boot_path, %o3)
#ifndef CDBOOT
ldub [%o3], %o1
brnz,pn %o1, bootpath_known
#endif
/* getprop(chosen_node, "bootpath", &buffer, buffer_size) */
GET_ABS(prom_bootpath_name, %o2)
@ -194,12 +207,19 @@ bootpath_known:
GET_ABS(prom_read_name, %o0)
LDUW_ABS(kernel_address, 0x00, %o2)
call prom_call_3_1_o1
#ifdef CDBOOT
LDUW_ABS(kernel_size, 0x00, %o3)
#else
mov 512, %o3
#endif
LDUW_ABS(kernel_address, 0x00, %o2)
jmpl %o2, %o7
#ifdef CDBOOT
mov CIF_REG, %o4
#else
nop
#endif
. = _start + GRUB_BOOT_MACHINE_CODE_END
/* the last 4 bytes in the sector 0 contain the signature */