Ticket #6309: haiku_loader_bios.x86_64.patch

File haiku_loader_bios.x86_64.patch, 10.8 KB (added by nmentley, 14 years ago)

haiku_loader bios_x86_64 patch

  • build/jam/KernelRules

     
    1818    local object ;
    1919    for object in $(objects) {
    2020        # add kernel flags for the object
    21         ObjectCcFlags $(object) : $(TARGET_KERNEL_CCFLAGS) $(2) ;
    22         ObjectC++Flags $(object) : $(TARGET_KERNEL_C++FLAGS) $(2) ;
    23         ObjectDefines $(object) : $(TARGET_KERNEL_DEFINES) ;
     21        if $(DEFINES) = _BOOT_MODE {
     22            ObjectCcFlags $(object) : $(TARGET_KERNEL_CCFLAGS) $(TARGET_BOOT_CCFLAGS) $(2) ;
     23            ObjectC++Flags $(object) : $(TARGET_KERNEL_C++FLAGS) $(TARGET_BOOT_C++FLAGS) $(2) ;
     24            ObjectDefines $(object) : $(TARGET_KERNEL_DEFINES) ;
     25        }
     26        else
     27        {
     28            ObjectCcFlags $(object) : $(TARGET_KERNEL_CCFLAGS) $(2) ;
     29            ObjectC++Flags $(object) : $(TARGET_KERNEL_C++FLAGS) $(2) ;
     30            ObjectDefines $(object) : $(TARGET_KERNEL_DEFINES) ;
     31        }
    2432
    2533        # override warning flags
    2634        TARGET_WARNING_CCFLAGS on $(object) = $(TARGET_KERNEL_WARNING_CCFLAGS) ;
     
    4452    LINKFLAGS on $(1) = $(4) ;
    4553    if $(3) { LINKFLAGS on $(1) += --script=$(3) ; }
    4654
     55    if $(DEFINES) = _BOOT_MODE {
     56        LINKFLAGS on $(1) += $(TARGET_BOOT_LINKFLAGS) ;
     57    }
     58
    4759    # Remove any preset LINKLIBS, but link against libgcc.a
    48     LINKLIBS on $(1) = $(TARGET_STATIC_LIBSUPC++) $(TARGET_GCC_LIBGCC) ;
     60    # MAJOR TODO: In configure and buildsetup add code to setup a TARGET_BOOT_GCC_LIBGCC varible
     61    if $(DEFINES) = _BOOT_MODE && $(HAIKU_ARCH) = x86_64 {
     62        LINKLIBS on $(1) = generated/cross-tools/x86_64-pc-haiku/lib/legacy/libsupc++.a generated/cross-tools/lib/gcc/x86_64-pc-haiku/4.4.4/legacy/libgcc.a ;
     63    }
     64    else
     65    {
     66        LINKLIBS on $(1) = $(TARGET_STATIC_LIBSUPC++) $(TARGET_GCC_LIBGCC) ;
     67    }
    4968
    5069    # TODO: Do we really want to invoke SetupKernel here? The objects should
    5170    # have been compiled with KernelObjects anyway, so we're doing that twice.
  • build/jam/MainBuildRules

     
    363363        } else {
    364364            LINK on $(1) = $(TARGET_LD) ;
    365365            LINKFLAGS on $(target) = $(TARGET_LDFLAGS) ;
     366            if $(DEFINES) = _BOOT_MODE {
     367                LINKFLAGS on $(1) += $(TARGET_BOOT_LINKFLAGS) ;
     368            }
    366369        }
    367370    }
    368371
  • build/jam/OverriddenJamRules

     
    178178    local includesSeparator ;
    179179    local localIncludesOption ;
    180180    local systemIncludesOption ;
     181
     182    if $(DEFINES) = _BOOT_MODE {
     183        flags = $(TARGET_BOOT_CCFLAGS) ;
     184    }
     185
    181186    if [ on $(1) return $(PLATFORM) ] = host {
    182         flags = [ on $(1) return $(HOST_ASFLAGS) $(ASFLAGS) ] ;
     187        flags += [ on $(1) return $(HOST_ASFLAGS) $(ASFLAGS) ] ;
    183188
    184189        CC on $(1) = $(HOST_CC) ;
    185190
     
    188193        systemIncludesOption = $(HOST_SYSTEM_INCLUDES_OPTION) ;
    189194
    190195    } else {
    191         flags = [ on $(1) return $(TARGET_ASFLAGS) $(ASFLAGS) ] ;
     196        flags += [ on $(1) return $(TARGET_ASFLAGS) $(ASFLAGS) ] ;
    192197
    193198        CC on $(1) = $(TARGET_CC) ;
    194199
  • src/system/boot/platform/bios_x86_64/Jamfile

     
     1SubDir HAIKU_TOP src system boot platform bios_x86_64 ;
     2
     3DEFINES += _BOOT_MODE ;
     4
     5SubDirHdrs $(SUBDIR) $(DOTDOT) bios_ia32 ;
     6SubDirHdrs $(HAIKU_TOP) headers private kernel boot platform $(TARGET_BOOT_PLATFORM) ;
     7
     8UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
     9UsePrivateHeaders [ FDirName graphics common ] ;
     10UsePrivateHeaders [ FDirName graphics vesa ] ;
     11UsePrivateHeaders [ FDirName storage ] ;
     12
     13{
     14    local defines = _BOOT_MODE ;
     15
     16    defines = [ FDefines $(defines) ] ;
     17    SubDirCcFlags $(defines) -Wall -Wno-multichar $(HAIKU_BOOT_CCFLAGS) ;
     18    SubDirC++Flags $(defines) -Wall -Wno-multichar -fno-rtti $(HAIKU_BOOT_C++FLAGS) ;
     19}
     20
     21SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons accelerants common ] ;
     22
     23local genericPlatformSources =
     24    text_menu.cpp
     25    video_blit.cpp
     26    video_splash.cpp
     27    video_rle.cpp
     28;
     29
     30local bios_ia32_src =
     31    shell.S
     32    start.cpp
     33    debug.cpp
     34    bios.S
     35    console.cpp
     36    serial.cpp
     37    devices.cpp
     38    keyboard.cpp
     39    menu.cpp
     40    mmu.cpp
     41    multiboot.cpp
     42    cpu.cpp
     43    acpi.cpp
     44    smp.cpp
     45    smp_trampoline.S
     46    support.S
     47    video.cpp
     48    apm.cpp
     49    hpet.cpp
     50;
     51
     52local bios_ia32_edid_src =
     53    decode_edid.c
     54    dump_edid.c
     55;
     56
     57KernelMergeObject boot_platform_bios_x86_64.o :
     58    $(bios_ia32_src)
     59    $(bios_ia32_edid_src)
     60    $(genericPlatformSources)
     61    : -fno-pic
     62;
     63
     64SEARCH on [ FGristFiles $(bios_ia32_src) ]
     65    = [ FDirName $(SUBDIR) $(DOTDOT) bios_ia32 ] ;
     66
     67SEARCH on [ FGristFiles $(bios_ia32_edid_src) ]
     68    = [ FDirName $(HAIKU_TOP) src add-ons accelerants common ] ;
     69
     70SEARCH on [ FGristFiles $(genericPlatformSources) ]
     71    = [ FDirName $(HAIKU_TOP) src system boot platform generic ] ;
     72
     73# We also need the bios_ia32 stage1.bin for building bin/makebootable
     74SEARCH on stage1.bin
     75    = [ FDirName $(SUBDIR) $(DOTDOT) bios_ia32 ] ;
  • src/system/boot/loader/file_systems/tarfs/Jamfile

     
    11SubDir HAIKU_TOP src system boot loader file_systems tarfs ;
    22
     3DEFINES += _BOOT_MODE ;
     4
    35UseHeaders [ FDirName $(HAIKU_TOP) headers libs zlib ] ;
    46
    57UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
  • src/system/boot/loader/file_systems/hfs_plus/Jamfile

     
    11SubDir HAIKU_TOP src system boot loader file_systems hfs_plus ;
    22
     3DEFINES += _BOOT_MODE ;
     4
    35UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
    46UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
    57UsePrivateHeaders kernel storage ;
    68
     9local defines = [ FDefines _BOOT_MODE ] ;
    710SubDirC++Flags -fno-rtti ;
    811
    912KernelStaticLibrary boot_hfs_plus :
  • src/system/boot/loader/file_systems/bfs/Jamfile

     
    11SubDir HAIKU_TOP src system boot loader file_systems bfs ;
    22
     3DEFINES += _BOOT_MODE ;
     4
    35UsePrivateKernelHeaders ;
    46UsePrivateHeaders shared storage ;
    57
  • src/system/boot/loader/file_systems/fat/Jamfile

     
    11SubDir HAIKU_TOP src system boot loader file_systems fat ;
    22
     3DEFINES += _BOOT_MODE ;
     4
    35#UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
    46#UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
    57#UsePrivateHeaders [ FDirName storage ] ;
  • src/system/boot/loader/file_systems/amiga_ffs/Jamfile

     
    66
    77#SubDirHdrs $(HAIKU_TOP) src add-ons kernel file_systems amiga_ffs ;
    88
     9DEFINES += _BOOT_MODE ;
     10
    911SubDirC++Flags -fno-rtti ;
    1012
    1113KernelStaticLibrary boot_amiga_ffs :
  • src/system/boot/loader/Jamfile

     
    11SubDir HAIKU_TOP src system boot loader ;
    22
     3DEFINES += _BOOT_MODE ;
     4
    35SubDirHdrs $(HAIKU_TOP) src add-ons kernel partitioning_systems amiga ;
    46SubDirHdrs $(HAIKU_TOP) src add-ons kernel partitioning_systems apple ;
    57SubDirHdrs $(HAIKU_TOP) src add-ons kernel partitioning_systems efi ;
     
    4345                #BOOT_SUPPORT_FILE_SYSTEM_FAT
    4446            ;
    4547        }
     48        case "x86_64" :
     49        {
     50            defines +=
     51                BOOT_SUPPORT_PARTITION_EFI
     52
     53                #BOOT_SUPPORT_FILE_SYSTEM_FAT
     54            ;
     55        }
    4656    }
    4757
    4858    defines = [ FDefines $(defines) ] ;
  • src/system/boot/Jamfile

     
    11SubDir HAIKU_TOP src system boot ;
    22
    3 local librootFunctions =
    4     abs.o
    5     ctype.o
    6     qsort.o
    7     kernel_vsprintf.o
    8     memcmp.o
    9     memmove.o
    10     strdup.o
    11     strlen.o
    12     strnlen.o
    13     strcmp.o
    14     strcasecmp.o
    15     strncmp.o
    16     strcat.o
    17     strcpy.o
    18     strlcat.o
    19     strlcpy.o
    20     strchr.o
    21     strrchr.o
    22     strtol.o
     3DEFINES += _BOOT_MODE ;
     4
     5SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot posix string ] ;
     6SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot posix stdlib ] ;
     7SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot posix locale ] ;
     8SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) kernel lib ] ;
     9
     10KernelMergeObject boot_librootFunctions.o :
     11    abs.c
     12    ctype.c
     13    qsort.c
     14    kernel_vsprintf.cpp
     15    memcmp.c
     16    memmove.c
     17    strdup.c
     18    strlen.c
     19    strnlen.c
     20    strcmp.c
     21    strcasecmp.c
     22    strncmp.c
     23    strcat.c
     24    strcpy.c
     25    strlcat.c
     26    strlcpy.c
     27    strchr.c
     28    strrchr.c
     29    strtol.c
     30    : -fno-pic
    2331;
    2432
    2533local extraLinkerArgs = ;
     
    4755
    4856    # libroot functions needed by the stage2 boot loader (compiled for the
    4957    # kernel)
    50     $(librootFunctions:G=src!system!kernel!lib)
     58    boot_librootFunctions.o
    5159
    5260    : $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/boot_loader_$(TARGET_BOOT_PLATFORM).ld
    5361    : -Bstatic $(extraLinkerArgs)
    5462;
    5563
     64
     65
    5666rule BuildCoffLoader {
    5767    local coffLoader = $(1) ;
    5868    local bootLoader = $(2) ;
  • src/system/boot/arch/x86_64/Jamfile

     
     1SubDir HAIKU_TOP src system boot arch x86_64 ;
     2
     3DEFINES += _BOOT_MODE ;
     4
     5local kernelArchSources =
     6    arch_elf.cpp
     7    cpuid.S
     8;
     9
     10local kernelLibArchSources =
     11    arch_string.S
     12;
     13
     14local librootosArchObjects =
     15    byteorder.S
     16;
     17
     18KernelMergeObject boot_arch_$(TARGET_ARCH).o :
     19    $(kernelArchSourcesCPP)
     20    $(kernelArchSources)
     21    $(kernelLibArchSources)
     22    $(librootosArchObjects)
     23    : # additional flags
     24;
     25
     26SEARCH on [ FGristFiles $(kernelArchSources) ]
     27    = [ FDirName $(HAIKU_TOP) src system kernel arch x86 ] ;
     28SEARCH on [ FGristFiles $(kernelLibArchSources) ]
     29    = [ FDirName $(HAIKU_TOP) src system kernel lib arch x86 ] ;
     30SEARCH on [ FGristFiles $(librootosArchObjects) ]
     31    = [ FDirName $(HAIKU_TOP) src system libroot os arch x86 ] ;
     32