aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-10-15 16:57:45 +0200
committerWojtek Kosior <kwojtus@protonmail.com>2019-10-15 16:57:45 +0200
commit0c0b353572da69a01b7f1b3d940b779ff9fcfb26 (patch)
tree63e8d83f17c01dfabb9473824b8533112f7f20c6
parent0921cc609a1b411d2b6769a327fa11a675ac3d3a (diff)
downloadrpi-MMU-example-0c0b353572da69a01b7f1b3d940b779ff9fcfb26.tar.gz
rpi-MMU-example-0c0b353572da69a01b7f1b3d940b779ff9fcfb26.zip
adjust for rpi-open-firmware
-rw-r--r--linker.ld3
-rw-r--r--loader_stage1.ld11
2 files changed, 13 insertions, 1 deletions
diff --git a/linker.ld b/linker.ld
index c9a91df..e7bfdb8 100644
--- a/linker.ld
+++ b/linker.ld
@@ -9,8 +9,11 @@ SECTIONS
/* Since we're using a bootloader now, we can compile the kernel */
/* for 0x8000 and bootloader will load it properly (although it */
/* itself still has to be compiled for 0x10000) */
+ /* rpi-open-firmware, ont he other hand, loads kernel at 0x2000000 */
+ /* This issue is also to be avoided by the use of bootloader */
. = 0x8000;
/* For AArch64, use . = 0x80000; Unless this too is wrong in qemu… */
+
__start = .;
__text_start = .;
.text :
diff --git a/loader_stage1.ld b/loader_stage1.ld
index ce11095..507e367 100644
--- a/loader_stage1.ld
+++ b/loader_stage1.ld
@@ -6,8 +6,17 @@ SECTIONS
/* Warning! Internet says RPis in 32-bit mode load binary at 0x8000! */
/* My experiments do, however, show, that qemu emulating RPi2 */
/* loads it at 0x10000! (took some pain to find out) */
- . = 0x10000;
+
+ /* . = 0x10000; */
+
+ /* rpi-open-firmware, on the other hand, loads it at 0x2000000 */
+ /* (and this should be not-so-hard to change by modifying the */
+ /* firmware */
+
+ . = 0x2000000;
+
/* For AArch64, use . = 0x80000; Unless this too is wrong */
+
__start = .;
__text_start = .;
.text :