interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / crates / aienos-artifact-tool / fixtures / p2_6 / assemble.sh

26 lines · 981 bytes Raw Blame History
1#!/usr/bin/env bash
2# Reassemble the P2-6 SEED-0B probe from probe.S into OUT_DIR/<probe>/code.bin.
3# The committed code.bin is the qualification input; this proves it is
4# exactly what probe.S assembles to, with no relocations.
5set -euo pipefail
6
7here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8out="${1:?usage: assemble.sh OUT_DIR}"
9as_bin="${AS:-as}"
10objcopy_bin="${OBJCOPY:-objcopy}"
11if [[ "$(uname -m)" != "aarch64" ]]; then
12 as_bin="${AS:-aarch64-linux-gnu-as}"
13 objcopy_bin="${OBJCOPY:-aarch64-linux-gnu-objcopy}"
14fi
15
16for probe in p26seed; do
17 mkdir -p "${out}/${probe}"
18 "${as_bin}" -o "${out}/${probe}/probe.o" "${here}/${probe}/probe.S"
19 if command -v readelf >/dev/null; then
20 if readelf -r "${out}/${probe}/probe.o" | grep -q "Relocation section"; then
21 echo "FAIL ${probe} has relocations" >&2
22 exit 1
23 fi
24 fi
25 "${objcopy_bin}" -O binary -j .text "${out}/${probe}/probe.o" "${out}/${probe}/code.bin"
26done