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 / scripts / ck_allen_memory_test.sh

22 lines · 1159 bytes Raw Blame History
1#!/bin/sh
2# ck_allen_memory_test.sh -- host test of Allen's lasting memory: the record
3# format and two-copy store (native/kernel/svc/allen_memory.c), the AIENOS
4# partition added in unused space next to an existing one
5# (native/kernel/dev/gpt_add.c), power cuts during both, and Allen taught,
6# restarted from the bytes on disk and asked (svc/allen_reply.c). See
7# native/kernel/svc/tests/allen_memory_test.c. Hosted only. Ends with
8# "AIENOS_ALLEN_MEMORY: PASS" or "AIENOS_ALLEN_MEMORY: FAIL <why>".
9set -u
10cd "$(dirname "$0")/.."
11K=native/kernel
12N=native
13W=$(mktemp -d "${TMPDIR:-/tmp}/ck_allen_memory.XXXXXX")
14trap 'rm -rf "$W"' EXIT
15fail() { echo "AIENOS_ALLEN_MEMORY: FAIL $*"; exit 1; }
16CC=${HOSTCC:-cc}
17$CC -std=c11 -D_DEFAULT_SOURCE -O2 -Wall -Wextra -Werror -I$K/svc -I$K/dev -I$K/tools -I$N/disk -I$N/argus \
18 -o "$W/test" $K/svc/tests/allen_memory_test.c $K/svc/allen_memory.c $K/svc/allen_reply.c $K/svc/allen_notes.c \
19 $K/dev/gpt_add.c $K/dev/disk_part.c $K/tools/gpt_write.c $N/disk/disk.c $N/disk/disk_file.c \
20 $N/argus/sha256.c || fail "test does not build"
21"$W/test" "$W" || fail "memory checks"
22echo "AIENOS_ALLEN_MEMORY: PASS"