New tutorial, raspbootin for 64 bit

pull/4/head
bzt 6 years ago
parent 2937d2c1fe
commit d5d1df6678

@ -14,15 +14,16 @@ Hogy az új kernelt ugyanoda tölthessük be, el kell mozdítanunk a kódunkat a
az első kód ugyanarra a címre tölti be a második kódot, ezért az utóbbi azt hiszi, a firmware töltötte be.
Hogy ezt megvalósítsuk, egy alacsonyabb címre linkeljük a kódot, és mivel a GPU ettől függetlenül a 0x80000-ra tölt be,
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őrizheted:
végeztünk, a 0x80000-as címen lévő memóriának használaton kívülinek kell lennie. Ezt a következő paranccsal ellenőrizheted:
```sh
$ aarch64-elf-readelf -s kernel8.elf | grep __bss_end
21: 000000000007ffc0 0 NOTYPE GLOBAL DEFAULT 4 __bss_end
```
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.
Start
-----

@ -14,15 +14,17 @@ In order to load the new kernel to the same address, we have to move ourself out
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. 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. You can checked that with:
while doing so. When we're done, the memory at 0x80000 must be free to use. You can checked that with:
```sh
$ aarch64-elf-readelf -s kernel8.elf | grep __bss_end
21: 000000000007ffc0 0 NOTYPE GLOBAL DEFAULT 4 __bss_end
```
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.
Start
-----

Loading…
Cancel
Save