openfirmware: support a.out bootloader
Apparently each architecture and manufacturer uses a different binary format (I heard current POWER hardware uses elf). Change-Id: I4f1b9977d0a9d5a700c2d50b36844d6e4640b68b Reviewed-on: https://review.haiku-os.org/c/1365 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
+45
-5
@@ -4,19 +4,59 @@ DEFINES += _BOOT_MODE ;
|
||||
|
||||
UsePrivateHeaders [ FDirName libroot locale ] ;
|
||||
|
||||
rule BuildOpenFirmwareLoader {
|
||||
local haikuLoader = $(1) ;
|
||||
local bootLoader = $(2) ;
|
||||
|
||||
Depends $(haikuLoader) : $(bootLoader) ;
|
||||
MakeLocateDebug $(haikuLoader) ;
|
||||
|
||||
switch $(TARGET_ARCH) {
|
||||
case ppc :
|
||||
BuildCoffLoader $(haikuLoader) : $(bootLoader) ;
|
||||
case sparc :
|
||||
BuildAoutLoader $(haikuLoader) : $(bootLoader) ;
|
||||
case * :
|
||||
Exit "Currently unsupported arch:" $(TARGET_ARCH) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# A.out haiku_loader creation
|
||||
#
|
||||
rule BuildAoutLoader {
|
||||
local haikuLoader = $(1) ;
|
||||
local bootLoader = $(2) ;
|
||||
switch $(TARGET_ARCH) {
|
||||
case sparc :
|
||||
AOUT_FORMAT on $(haikuLoader) = a.out-sunos-big ;
|
||||
case * :
|
||||
Exit "Currently unsupported coff arch:" $(TARGET_ARCH) ;
|
||||
}
|
||||
}
|
||||
|
||||
actions BuildAoutLoader {
|
||||
rm -f $(1)
|
||||
$(TARGET_OBJCOPY_$(TARGET_PACKAGING_ARCH)) -O $(AOUT_FORMAT) $(2) $(1)
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Coff haiku_loader creation
|
||||
#
|
||||
rule BuildCoffLoader {
|
||||
local coffLoader = $(1) ;
|
||||
local bootLoader = $(2) ;
|
||||
# XXX: eventually switch on arch
|
||||
COFF_FORMAT on $(coffLoader) = xcoff-powermac ;
|
||||
switch $(TARGET_ARCH) {
|
||||
case ppc :
|
||||
COFF_FORMAT on $(coffLoader) = xcoff-powermac ;
|
||||
case * :
|
||||
Exit "Currently unsupported coff arch:" $(TARGET_ARCH) ;
|
||||
}
|
||||
HACK_COFF on $(coffLoader) = <build>hack-coff ;
|
||||
|
||||
Depends $(coffLoader) : <build>hack-coff ;
|
||||
Depends $(coffLoader) : $(bootLoader) ;
|
||||
MakeLocateDebug $(coffLoader) ;
|
||||
}
|
||||
|
||||
actions BuildCoffLoader bind HACK_COFF {
|
||||
@@ -214,7 +254,7 @@ for platform in [ MultiBootSubDirSetup ] {
|
||||
BuildBiosLoader haiku_loader.$(TARGET_BOOT_PLATFORM) : boot_loader_$(TARGET_BOOT_PLATFORM) ;
|
||||
|
||||
case openfirmware :
|
||||
BuildCoffLoader haiku_loader.$(TARGET_BOOT_PLATFORM) : boot_loader_$(TARGET_BOOT_PLATFORM) ;
|
||||
BuildOpenFirmwareLoader haiku_loader.$(TARGET_BOOT_PLATFORM) : boot_loader_$(TARGET_BOOT_PLATFORM) ;
|
||||
|
||||
case u-boot :
|
||||
local loader_entry = `printf \"obase=16;ibase=16;10 + %x\\n\" $(HAIKU_BOOT_LOADER_BASE)|bc` ;
|
||||
|
||||
Reference in New Issue
Block a user