aboutsummaryrefslogtreecommitdiff
path: root/kernel_stage1.ld
blob: 313063478caa21faf6f5bfd68c7cc1d0ef962db9 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
ENTRY(_boot) /* defined in boot.S; qemu needs it to run elf file */

/* Code starts at  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).
 * rpi-open-firmware, on the other hand, loads kernel at 0x2000000!
 * This is not really a problem, since:
 *   1. We can use our bootloader to load the kernel at 0x8000
 *   2. We've rewritten stage 1 of both bootloader and kernel in
 *      careful assembly, so that they should work regardless of
 *      where they are loaded.
 *   3. In qemu, we can load kernel.elf instead of raw binary
 *      (qemu will do the right thing then)
 */

SECTIONS
{

	. = 0x8000;

	__start = .;
	.kernel_stage1 :
	{
		KEEP(kernel_stage1.o)
	}
	__end = .;
}