diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-26 19:02:32 +0100 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-26 19:02:32 +0100 |
commit | 4d3cd9bd400b3d07d752d60ce2b3c425a53b72d6 (patch) | |
tree | 4b7333d69113fff1137fe1bf805be8905c5b752e | |
parent | 9d587f9f750253461314757f2f861c5214563120 (diff) | |
download | rpi-MMU-example-4d3cd9bd400b3d07d752d60ce2b3c425a53b72d6.tar.gz rpi-MMU-example-4d3cd9bd400b3d07d752d60ce2b3c425a53b72d6.zip |
improve linking of initial boot code
-rw-r--r-- | boot.S | 12 | ||||
-rw-r--r-- | linker.ld | 14 |
2 files changed, 8 insertions, 18 deletions
@@ -1,20 +1,14 @@ // armv7 mode -// To keep this in the first portion of the binary. -.section ".boot" - -//.org 0x8000 - -// Make _start global. -.globl _start - // Entry point for the kernel. // r15 -> should begin execution at 0x8000. // r0 -> 0x00000000 // r1 -> 0x00000C42 // r2 -> 0x00000100 - start of ATAGS // preserve these registers as argument for kernel_main -_start: + +.globl _boot // make entry point label global +_boot: // Shut off extra cores mrc p15, 0, r5, c0, c0, 5 and r5, r5, #3 @@ -1,4 +1,4 @@ -ENTRY(_start) /* defined in boot.S */ +ENTRY(_boot) /* defined in boot.S; qemu needs it to run elf file */ SECTIONS { @@ -15,20 +15,16 @@ SECTIONS . = 0x8000; - /* For AArch64, use . = 0x80000 */ + /* RPi in 64-bit mode uses address 0x80000 instead */ __start = .; - .boot : - { - boot.o - } - __kernel_start = .; .kernel : { + __kernel_start = .; + KEEP(boot.o) *(EXCLUDE_FILE (libkernel.o interrupt_vector.o interrupts.o) *) + __kernel_end = .; } - . = ALIGN(4096); /* align to page size */ - __kernel_end = .; __kernel_size = __kernel_end - __kernel_start; |