aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / scripts / gb10_iort_decode.sh
| 1 | #!/usr/bin/env bash |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # gb10_iort_decode.sh: dump the firmware IORT table (read-only) and resolve the |
| 18 | # GB10 (PCI segment 15, requester id 0x0100) to its SMMUv3 node and stream id. |
| 19 | # Host only. Needs root to read /sys/firmware/acpi/tables/IORT. Changes nothing. |
| 20 | # aienos#286 cut B5; see docs/GB10_IORT_DECODE.md. |
| 21 | set -euo pipefail |
| 22 | here=$(cd "$(dirname "$0")" && pwd) |
| 23 | out=${1:-/tmp/aienos-iort} |
| 24 | seg=${2:-15} |
| 25 | rid=${3:-0x0100} |
| 26 | mkdir -p "$out" |
| 27 | sudo cat /sys/firmware/acpi/tables/IORT > "$out/IORT.bin" |
| 28 | rustc --edition 2021 -O -o "$out/iort_decode" "$here/iort_decode.rs" |
| 29 | sha256sum "$out/IORT.bin" |
| 30 | "$out/iort_decode" "$out/IORT.bin" "$seg" "$rid" |