From f5d935e9361c42db1daaab067af478e655d9303d Mon Sep 17 00:00:00 2001 From: bzt Date: Mon, 26 Feb 2018 03:47:38 +0100 Subject: [PATCH] New tutorial, raspbootin for 64 bit --- 14_raspbootin64/OLVASSEL.md | 4 ++-- 14_raspbootin64/README.md | 6 +++--- 14_raspbootin64/kernel8.img | Bin 936 -> 928 bytes 14_raspbootin64/main.c | 5 +---- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/14_raspbootin64/OLVASSEL.md b/14_raspbootin64/OLVASSEL.md index 4ae239fc..0820ac6d 100644 --- a/14_raspbootin64/OLVASSEL.md +++ b/14_raspbootin64/OLVASSEL.md @@ -16,11 +16,11 @@ Hogy ezt megvalósítsuk, egy alacsonyabb címre linkeljük a kódot, és mivel nekünk kell a módosított címre másolnunk magunkat. Fontos, hogy ezalatt csak relatív címzést használhatunk. Amikor végeztünk, a 0x80000-as címen lévő memóriának használaton kívülinek kell lennie. Ajánlott a kódunkat minimalizálni, mivel úgyis figyelmen kívül hagyja az újonnan betöltendő kód. Ezért kivettem az `uart_puts()` eljárást, így a teljes méret -1024 bájt alá csökkent. Ezt a következő paranccsal ellenőriztem: +1024 bájt alá csökkent. Ezt a következő paranccsal ellenőrizheted: ```sh $ aarch64-elf-readelf -s kernel8.elf | grep __bss_end - 21: 000000000007ffd0 0 NOTYPE GLOBAL DEFAULT 4 __bss_end + 21: 000000000007ffc0 0 NOTYPE GLOBAL DEFAULT 4 __bss_end ``` Start diff --git a/14_raspbootin64/README.md b/14_raspbootin64/README.md index 48a43147..8d4c3e31 100644 --- a/14_raspbootin64/README.md +++ b/14_raspbootin64/README.md @@ -13,14 +13,14 @@ If you want to send kernels from a Windows machine, I suggest to take a look at In order to load the new kernel to the same address, we have to move ourself out of the way. It's called chain loading: one code loads the next code to the same position in memory, therefore the latter thinks it was loaded by the firmware. To implement that we use a different linking address this time, and since GPU loads us to 0x80000 -regardless, we have to copy our code to that link address. That's important that we can only use relative addresses +regardless, we have to copy our code to that link address. What's important, that we can only use relative addresses while doing so. When we're done, the memory at 0x80000 must be free to use. We also should minimize the size of the loader, since it will be regarded by the newly loaded code anyway. By removing `uart_puts()` I've managed to shrink the -size below 1024 bytes. I've checked that with: +size below 1024 bytes. You can checked that with: ```sh $ aarch64-elf-readelf -s kernel8.elf | grep __bss_end - 21: 000000000007ffd0 0 NOTYPE GLOBAL DEFAULT 4 __bss_end + 21: 000000000007ffc0 0 NOTYPE GLOBAL DEFAULT 4 __bss_end ``` Start diff --git a/14_raspbootin64/kernel8.img b/14_raspbootin64/kernel8.img index 0c1a13b14509d2a6215f3ef228364ed9bf03544c..7551a233b183fc09dc553b548817e6d51d329ad3 100755 GIT binary patch delta 125 zcmZ3%zJPr~gk%K+0|N^XGca&~Nrpe{V0yvELUSgMVm5|A5yl0VikX}yKHzK!0`ezr z{r`V@0+78KNbdpS1||l}Mxgi?X2w%iwcKrW8y_k(5FagNk z3S>_?=Kd4NpIFQ!(!CqVZxCa!sAm#+z3~745C#S&kT5*6m{u;=*$sd>| QXl(coF&btC#6C