aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-10-11 18:53:13 +0200
committerWojtek Kosior <kwojtus@protonmail.com>2019-10-11 18:53:13 +0200
commitb452b0edbc784722c25014a20f554737d64ba758 (patch)
treeae8cb96f362241070cbe53f1eab0ac818093cfe7
parente056312b52faf9eff2a88b1c751fb06824263b14 (diff)
downloadrpi-MMU-example-b452b0edbc784722c25014a20f554737d64ba758.tar.gz
rpi-MMU-example-b452b0edbc784722c25014a20f554737d64ba758.zip
use bootloader in qemu
-rw-r--r--Makefile4
-rw-r--r--linker.ld13
2 files changed, 10 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 6ced357..2fbb0aa 100644
--- a/Makefile
+++ b/Makefile
@@ -41,8 +41,8 @@ loader.img : loader.elf
qemu-elf : kernel.elf
qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $^
-qemu-bin : kernel7.img
- qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $^
+qemu-bin : loader.img kernel7.img pipe_image
+ ./pipe_image | qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $<
qemu-loader : loader.img
qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $^
diff --git a/linker.ld b/linker.ld
index 0cbd1fb..c9a91df 100644
--- a/linker.ld
+++ b/linker.ld
@@ -2,12 +2,15 @@ ENTRY(_start)
SECTIONS
{
- /* Starts at LOADER_ADDR. */
- /* Warning! Internet says RPis in 32-bit mode load kernel at 0x8000! */
+ /* Starts at LOADER_ADDR, which is 0x8000 - that's where RPis in */
+ /* 32-bit mode load kernel at. */
/* My experiments do, however, show, that qemu emulating RPi2 */
- /* Loads the kernel at 0x10000! (took some pain to find out) */
- . = 0x10000;
- /* For AArch64, use . = 0x80000; Unless this too is wrong */
+ /* loads the kernel at 0x10000! (took some pain to find out). */
+ /* 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) */
+ . = 0x8000;
+ /* For AArch64, use . = 0x80000; Unless this too is wrong in qemu… */
__start = .;
__text_start = .;
.text :