Raspberry Pi Bare Bones: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
modified aarch64 gcc commands because of redundancy and errors, links to libgcc now, added __bss_size to linker.ld, spelling
Line 30: Line 30:


We will now create a file called boot.S and discuss its contents. In this example, we are using the GNU assembler, which is part of the cross-compiler toolchain you built earlier. This assembler integrates very well with the rest of the GNU toolchain.
We will now create a file called boot.S and discuss its contents. In this example, we are using the GNU assembler, which is part of the cross-compiler toolchain you built earlier. This assembler integrates very well with the rest of the GNU toolchain.

Each Pi Model requires different set up. In general, you must distinguish AArch32 and AArch64 mode, as they are booted differently. The latter only accessible from Pi 3 and upwards. Within a mode, you can [[Detecting_Raspberry_Pi_Board|detect the board]] in run-time, and set up mmio base address accordingly.


===Pi Model A, B, A+, B+, and Zero===
===Pi Model A, B, A+, B+, and Zero===
Line 156: Line 158:
===Pi 3===
===Pi 3===


Note that in 64 bit mode, the boot code is loaded at 0x80000 and not 0x8000.
It worth mentioning that Pi 3 normally boots kernel8.img into 64 bit mode, but you can still use AArch32 with kernel7.img for backward compatibility. Note that in 64 bit mode, the boot code is loaded at 0x80000 and not 0x8000.


<source lang="text">
<source lang="text">