diff --git a/build/jam/board/raspberry_pi/BoardSetup b/build/jam/board/raspberry_pi/BoardSetup index 6be630cea1..c70eb90a3d 100644 --- a/build/jam/board/raspberry_pi/BoardSetup +++ b/build/jam/board/raspberry_pi/BoardSetup @@ -7,7 +7,7 @@ HAIKU_BOOT_PLATFORM = raspberrypi_arm ; # Various hardcoded addresses # -HAIKU_BOARD_LOADER_BASE = 0x32000000 ; +HAIKU_BOARD_LOADER_BASE = 0x0 ; # # Flash image diff --git a/build/jam/board/raspberry_pi/info.txt b/build/jam/board/raspberry_pi/info.txt index 41e912ac7f..c8651971c2 100644 --- a/build/jam/board/raspberry_pi/info.txt +++ b/build/jam/board/raspberry_pi/info.txt @@ -1,4 +1,5 @@ Setting up the Haiku boot partition +------------------------------------- partition 1 -- FAT32, bootable flag, type 'c' partition 2 -- BeFS, Haiku filesystem, type 'eb' @@ -7,7 +8,7 @@ The boot partition must contain the following files to boot Haiku: * bootcode.bin : 2nd stage bootloader, starts with SDRAM disabled * loader.bin : 3rd stage bootloader, starts with SDRAM enabled * start.elf: The GPU binary firmware image, provided by the foundation. -* kernel.img: Haiku Loader (haiku_loader) +* haiku_loader: Haiku Loader * config.txt: A configuration file read by the GPU. Optional files: @@ -20,4 +21,13 @@ Additional GPU firmware images, rename over start.elf to use them: - this is the default * arm224_start.elf : 224M ARM, 32M GPU split - (use this for Linux only with no 3D or video processing. - Its enough for the 1080p framebuffer, but not much else) + Enough for the 1080p framebuffer, but not much else) + +Building +------------------------------------- +jam -q -sHAIKU_BOOT_BOARD=raspberry_pi -sHAIKU_BOOT_PLATFORM=raspberrypi_arm haiku_loader + +config.txt options +------------------------------------- +kernel=haiku_loader +disable_commandline_tags=1 diff --git a/src/system/boot/platform/raspberrypi_arm/entry.S b/src/system/boot/platform/raspberrypi_arm/entry.S index 7c668ffd09..632e8cf619 100644 --- a/src/system/boot/platform/raspberrypi_arm/entry.S +++ b/src/system/boot/platform/raspberrypi_arm/entry.S @@ -1,8 +1,14 @@ +.section .init .globl _start _start: b jmp_loader -.balign 0x8000, 0 +.section .text + /* Start "safe" code area. + * 0x4000 minimum safe area + * defined in boot_loader_raspberrypi_arm.ld + */ + jmp_loader: /* Start Haiku loader */ diff --git a/src/system/ldscripts/arm/boot_loader_raspberrypi_arm.ld b/src/system/ldscripts/arm/boot_loader_raspberrypi_arm.ld index 15eecff6e5..19c64ac7c8 100644 --- a/src/system/ldscripts/arm/boot_loader_raspberrypi_arm.ld +++ b/src/system/ldscripts/arm/boot_loader_raspberrypi_arm.ld @@ -11,10 +11,22 @@ UND_STACK_SIZE = 0; SECTIONS { + /* + * Raspberry Pi boot logic: + * start.elf loads the kernel specified in config.txt + * if a dtb exists, it is loaded at 0x100 and the kernel at 0x8000 + * else if disable_commandline_tags true, set kernel load address to 0x0 + * else load kernel at 0x8000 and put atags at 0x100 + */ + . = BOARD_LOADER_BASE; - /* text/read-only data */ - .text : { + /* .init is a stub that jumps to code at .text */ + .init : { + *(.init) + } + + .text 0x8000 : { CREATE_OBJECT_SYMBOLS *(.text .text.* .gnu.linkonce.t.*) *(.plt)