diff --git a/src/system/boot/Jamfile b/src/system/boot/Jamfile index 826c677197..e23eac3572 100644 --- a/src/system/boot/Jamfile +++ b/src/system/boot/Jamfile @@ -101,6 +101,16 @@ rule BuildEFILoader { local bootLoader = $(2) ; Depends $(efiLoader) : $(bootLoader) ; + + switch $(TARGET_ARCH) { + case x86_64 : + OUTPUT_TARGET on $(efiLoader) = efi-app-x86_64 ; + case arm : + OUTPUT_TARGET on $(efiLoader) = binary ; + case * : + Exit "Currently unsupported arch:" $(TARGET_ARCH) ; + } + MakeLocateDebug $(efiLoader) ; } @@ -109,8 +119,7 @@ actions BuildEFILoader rm -f $(1) $(TARGET_OBJCOPY_$(TARGET_PACKAGING_ARCH)) -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc -j .dynstr \ - --input-target=efi-app-x86_64 --output-target=efi-app-x86_64 \ - $(2) $(1) + --output-target=$(OUTPUT_TARGET) $(2) $(1) } diff --git a/src/system/boot/arch/arm/Jamfile b/src/system/boot/arch/arm/Jamfile index e11116fd7f..3830c341e4 100644 --- a/src/system/boot/arch/arm/Jamfile +++ b/src/system/boot/arch/arm/Jamfile @@ -1,8 +1,6 @@ SubDir HAIKU_TOP src system boot arch arm ; -UseLibraryHeaders [ FDirName libfdt ] ; UsePrivateHeaders [ FDirName kernel platform $(TARGET_BOOT_PLATFORM) ] ; -SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers fdt ; # TODO: Is there any reason to recompile arch_string.S here? local librootArchObjects = @@ -15,18 +13,16 @@ local kernelLibArchObjects = memset.o ; +local kernelArchSources = + arch_elf.cpp + arch_uart_8250.cpp +; + local kernelDebugSources = blue_screen.cpp frame_buffer_console.cpp ; -local kernelArchDriverSources = - # Serial UART Drivers - arch_uart_8250.cpp - arch_uart_8250_omap.cpp - arch_uart_pl011.cpp -; - local kernelGenericDriverSources = debug_uart_8250.cpp ; @@ -38,20 +34,9 @@ for platform in [ MultiBootSubDirSetup u-boot efi ] { BootMergeObject [ FGristFiles boot_arch_$(TARGET_KERNEL_ARCH).o ] : # Kernel Drivers (src/system/kernel) $(kernelGenericDriverSources) - $(kernelArchDriverSources) + $(kernelArchSources) - # Framebuffer Drivers - arch_framebuffer_920.cpp - arch_framebuffer_bcm2835.cpp - arch_framebuffer_pxa.cpp - arch_framebuffer_omap3.cpp - - # Mailbox drivers - arch_mailbox_bcm2835.cpp - - arch_elf.cpp arch_cpu.cpp - arch_mmu.cpp arch_start_kernel.S # Reuse a subset of kernel debugging. @@ -63,7 +48,8 @@ for platform in [ MultiBootSubDirSetup u-boot efi ] { : $(kernelLibArchObjects) ; - SEARCH on [ FGristFiles arch_elf.cpp $(kernelArchDriverSources) ] + + SEARCH on [ FGristFiles $(kernelArchSources) ] = [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ; SEARCH on [ FGristFiles $(kernelGenericDriverSources) ] diff --git a/src/system/boot/platform/efi/Jamfile b/src/system/boot/platform/efi/Jamfile index 2a92d9ceed..b7d62e366d 100644 --- a/src/system/boot/platform/efi/Jamfile +++ b/src/system/boot/platform/efi/Jamfile @@ -33,10 +33,6 @@ local platform_src = local support_libs ; -if $(TARGET_KERNEL_ARCH) in arm arm64 { - support_libs += boot_fdt.a ; -} - local platform ; for platform in [ MultiBootSubDirSetup efi ] { on $(platform) { diff --git a/src/system/boot/platform/u-boot/Jamfile b/src/system/boot/platform/u-boot/Jamfile index d268a0425d..587f274cb5 100644 --- a/src/system/boot/platform/u-boot/Jamfile +++ b/src/system/boot/platform/u-boot/Jamfile @@ -5,6 +5,7 @@ SubDirHdrs $(HAIKU_TOP) headers private kernel platform $(TARGET_BOOT_PLATFORM) SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers fdt ; SubDirHdrs $(HAIKU_TOP) src system boot arch $(TARGET_KERNEL_ARCH) ; +SubDirHdrs $(HAIKU_TOP) src system boot platform u-boot arch $(TARGET_KERNEL_ARCH) ; UseLibraryHeaders [ FDirName libfdt ] ; diff --git a/src/system/boot/platform/u-boot/arch/arm/Jamfile b/src/system/boot/platform/u-boot/arch/arm/Jamfile index 765d3db7ab..787b84f9af 100644 --- a/src/system/boot/platform/u-boot/arch/arm/Jamfile +++ b/src/system/boot/platform/u-boot/arch/arm/Jamfile @@ -2,6 +2,9 @@ SubDir HAIKU_TOP src system boot platform u-boot arch arm ; SubDirHdrs $(HAIKU_TOP) src system boot platform $(TARGET_BOOT_PLATFORM) ; SubDirHdrs $(HAIKU_TOP) src system boot arch $(TARGET_KERNEL_ARCH) ; +SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers fdt ; + +UseLibraryHeaders [ FDirName libfdt ] ; UsePrivateSystemHeaders ; UsePrivateHeaders kernel [ FDirName kernel platform u-boot ] ; @@ -13,6 +16,18 @@ SubDirC++Flags -fno-rtti ; BootMergeObject boot_platform_u-boot_arm.o : # must come first to have _start_* at correct locations shell.S + + # Framebuffer drivers + arch_framebuffer_920.cpp + arch_framebuffer_bcm2835.cpp + arch_framebuffer_omap3.cpp + arch_framebuffer_pxa.cpp + + # Mailbox drivers + arch_mailbox_bcm2835.cpp + + # u-boot mmu setup + arch_mmu.cpp ; #SEARCH on [ FGristFiles arch_cpu_asm.S ] diff --git a/src/system/boot/arch/arm/arch_framebuffer.h b/src/system/boot/platform/u-boot/arch/arm/arch_framebuffer.h similarity index 100% rename from src/system/boot/arch/arm/arch_framebuffer.h rename to src/system/boot/platform/u-boot/arch/arm/arch_framebuffer.h diff --git a/src/system/boot/arch/arm/arch_framebuffer_920.cpp b/src/system/boot/platform/u-boot/arch/arm/arch_framebuffer_920.cpp similarity index 100% rename from src/system/boot/arch/arm/arch_framebuffer_920.cpp rename to src/system/boot/platform/u-boot/arch/arm/arch_framebuffer_920.cpp diff --git a/src/system/boot/arch/arm/arch_framebuffer_bcm2835.cpp b/src/system/boot/platform/u-boot/arch/arm/arch_framebuffer_bcm2835.cpp similarity index 100% rename from src/system/boot/arch/arm/arch_framebuffer_bcm2835.cpp rename to src/system/boot/platform/u-boot/arch/arm/arch_framebuffer_bcm2835.cpp diff --git a/src/system/boot/arch/arm/arch_framebuffer_omap3.cpp b/src/system/boot/platform/u-boot/arch/arm/arch_framebuffer_omap3.cpp similarity index 100% rename from src/system/boot/arch/arm/arch_framebuffer_omap3.cpp rename to src/system/boot/platform/u-boot/arch/arm/arch_framebuffer_omap3.cpp diff --git a/src/system/boot/arch/arm/arch_framebuffer_pxa.cpp b/src/system/boot/platform/u-boot/arch/arm/arch_framebuffer_pxa.cpp similarity index 100% rename from src/system/boot/arch/arm/arch_framebuffer_pxa.cpp rename to src/system/boot/platform/u-boot/arch/arm/arch_framebuffer_pxa.cpp diff --git a/src/system/boot/arch/arm/arch_mailbox.h b/src/system/boot/platform/u-boot/arch/arm/arch_mailbox.h similarity index 100% rename from src/system/boot/arch/arm/arch_mailbox.h rename to src/system/boot/platform/u-boot/arch/arm/arch_mailbox.h diff --git a/src/system/boot/arch/arm/arch_mailbox_bcm2835.cpp b/src/system/boot/platform/u-boot/arch/arm/arch_mailbox_bcm2835.cpp similarity index 100% rename from src/system/boot/arch/arm/arch_mailbox_bcm2835.cpp rename to src/system/boot/platform/u-boot/arch/arm/arch_mailbox_bcm2835.cpp diff --git a/src/system/boot/arch/arm/arch_mmu.cpp b/src/system/boot/platform/u-boot/arch/arm/arch_mmu.cpp similarity index 100% rename from src/system/boot/arch/arm/arch_mmu.cpp rename to src/system/boot/platform/u-boot/arch/arm/arch_mmu.cpp