Files
LithosAnanke/kernel/linker/starkernel-native-rpi5.ld
Claude 3bd81097e1 chore(license): an SPDX header on every source file that had none (LicenseRef-Starship-1.0) [skip ci]
The header scan (Captain Bob, 2026-11-10): 788 source files -- 351 with the
SL-1.0 header, 12 with the old name (docs/working/experiments, kept by
ruling), 31 under someone else's licence (tools/kconfig, Linux's, GPL-2.0:
kept), and 394 with none. Ruled: the SPDX form; capsules (.4th, .f18) and
proofs (.thy) left for a ruling of their own (mkcapsule's 64x16 block format,
content-addressed capsules).

253 files now begin
    SPDX-License-Identifier: LicenseRef-Starship-1.0
    Copyright (c) 2023-2026 Robert A. James
as a /* */ block (C, headers, assembly, linker scripts) or # lines (scripts,
Makefiles, Kconfig; below a shebang or a coding line); tools/mkcapsule.c,
which had the copyright line, gets the SPDX line only.

Not touched: docs/working/ (archive and old campaign material, as the
ruling kept the experiments); v4/system/post_cases.c (generated by
v4/tools/mkpost.py, "do not edit" -- the generator has the header).

Comments only: the kernel builds on amd64, aarch64, riscv64; make -C v4
test-32: 39 programs, 0 failures; every changed script parses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
2026-11-10 04:12:49 +00:00

81 lines
2.2 KiB
Plaintext

/* SPDX-License-Identifier: LicenseRef-Starship-1.0
* Copyright (c) 2023-2026 Robert A. James
*/
/* Linker script for the Raspberry Pi 5 native (non-UEFI) kernel image.
*
* Linked from the same objects as the aarch64 kernel ELF, entered at
* rpi5_native_start (arch/aarch64/native_rpi5_entry.S, section
* .text.entry -- placed first so it sits at the load address), then
* flattened with `objcopy -O binary` into kernel_2712.img.
*
* Load address 0x80000 must match boards/raspi/config.txt's
* kernel_address=0x80000: Pi 5 firmware's own default for
* kernel_2712.img is 0x200000, so the address is pinned on both sides
* rather than left to the firmware default.
*
* __kernel_start/__kernel_end span the whole image including .bss so
* pmm_init() reserves every page the image occupies (aarch64 boot.S's
* zero-length substitutes are only correct for the UEFI loader path,
* where UEFI owns the image pages). __bss_start/__bss_end are 16-byte
* aligned for the entry stub's zeroing loop: firmware does not clear
* memory past the end of the file it loads.
*/
OUTPUT_FORMAT("elf64-littleaarch64")
OUTPUT_ARCH(aarch64)
ENTRY(rpi5_native_start)
SECTIONS
{
/* RPI5_NATIVE_BASE comes from kernel/Makefile (--defsym): 0x80000 on
* the Pi 5; 0x40080000 for the QEMU virt rehearsal only, whose RAM
* starts at 0x40000000 and which loads a raw image 0x80000 into it. */
. = RPI5_NATIVE_BASE;
__kernel_start = .;
.text : {
__text_start = .;
KEEP(*(.text.entry))
*(.text .text.*)
__text_end = .;
}
.rodata : ALIGN(4K) {
__rodata_start = .;
*(.rodata .rodata.*)
__rodata_end = .;
}
.data : ALIGN(4K) {
__data_start = .;
*(.data .data.*)
*(.got .got.*)
__data_end = .;
}
.rela.dyn : ALIGN(8) {
*(.rela .rela.*)
}
.bss (NOLOAD) : ALIGN(4K) {
__bss_start = .;
*(.bss .bss.*)
*(COMMON)
. = ALIGN(16);
__bss_end = .;
}
. = ALIGN(4K);
__kernel_end = .;
/DISCARD/ : {
*(.comment)
*(.note*)
*(.eh_frame)
*(.dynamic)
*(.dynsym)
*(.interp)
}
}