Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/crates/aienos-artifact-tool/fixtures/p2_5/assemble.sh # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / crates / aienos-artifact-tool / fixtures / p2_5 / assemble.sh` 29 lines ยท 1215 bytes Raw Blame History 1 #!/usr/bin/env bash 2 # Reassemble every P2-5 probe from probe.S into OUT_DIR//code.bin. 3 # The committed code.bin files are the qualification inputs; this script 4 # only exists to prove they are exactly what probe.S assembles to. 5 # Needs an AArch64 GNU `as` and `objcopy` (native on the Spark). 6 set -euo pipefail 7 8 here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 9 out="${1:?usage: assemble.sh OUT_DIR}" 10 as_bin="${AS:-as}" 11 objcopy_bin="${OBJCOPY:-objcopy}" 12 if [[ "$(uname -m)" != "aarch64" ]]; then 13 as_bin="${AS:-aarch64-linux-gnu-as}" 14 objcopy_bin="${OBJCOPY:-aarch64-linux-gnu-objcopy}" 15 fi 16 17 for probe in p25exec p25wx p25spin; do 18 mkdir -p "${out}/${probe}" 19 "${as_bin}" -o "${out}/${probe}/probe.o" "${here}/${probe}/probe.S" 20 # A probe must be fully resolved: no relocations, so the bytes the kernel 21 # authenticates are the bytes that execute, with no loader fix-ups. 22 if command -v readelf >/dev/null; then 23 if readelf -r "${out}/${probe}/probe.o" | grep -q "Relocation section"; then 24 echo "FAIL ${probe} has relocations" >&2 25 exit 1 26 fi 27 fi 28 "${objcopy_bin}" -O binary -j .text "${out}/${probe}/probe.o" "${out}/${probe}/code.bin" 29 done