Files
vt1200/harness/mame/fontwork/run_ramdump.sh
T
arti 3a51b95317 harness/fontwork: reproduction scripts for the TFTP Disk-full investigation
Isolated-netns test setup (a private tap-mess-0-0 so a second MAME can run
without holding the owner's tap), the one-file/one-index TFTP servers, the
trace/probe run wrappers, and the two server logs quoted in
FONT_STORAGE_REPORT.md.
2026-10-16 22:03:49 +03:00

39 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# One-off: boot with the baseline-as-every-name server and dump main RAM at
# frames 390/391/392 so the TFTP client's own globals and buffers can be read
# directly from the dump.
set -euo pipefail
NS=vt1test
ROOT=/home/arti/code/k-space/vt1200
WORK=$ROOT/harness/mame/fontwork
FILE="${1:-$ROOT/reference/fonts/baseline.pcf}"
SECS="${2:-25}"
sudo -n ip netns exec "$NS" pkill -x vt1200 2>/dev/null || true
sudo -n ip netns exec "$NS" pkill -x python3 2>/dev/null || true
sleep 0.3
rm -rf "$WORK/nvram-ram3" "$WORK/ram3"
mkdir -p "$WORK/nvram-ram3/vt1200" "$WORK/ram3"
cp "$WORK/nvram_pristine.bin" "$WORK/nvram-ram3/vt1200/nvram"
sudo -n ip netns exec "$NS" python3 -u "$WORK/custom_serve5.py" 192.168.99.1 \
>"$WORK/custom_serve_ram.log" 2>&1 &
SRV=$!
sleep 1.2
timeout $((SECS+10)) sudo -n ip netns exec "$NS" env -u DISPLAY \
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy \
XDG_RUNTIME_DIR="$WORK" VT1200_SKIP_LEVEL1=1 \
VT1200_DUMP_RAM_FRAMES=394,395,396 VT1200_DUMP_DIR="$WORK/ram3" \
/home/arti/code/k-space/mame0289/vt1200 vt1200 \
-rompath "$ROOT/harness/mame/roms" -video none -sound none -nothrottle \
-skip_gameinfo -cfg_directory "$ROOT/harness/mame/cfg-net" \
-nvram_directory "$WORK/nvram-ram3" -networkprovider taptun \
-seconds_to_run "$SECS" >"$WORK/mame_ram.log" 2>&1 || true
kill $SRV 2>/dev/null || true
sudo -n ip netns exec "$NS" pkill -x python3 2>/dev/null || true
ls -la "$WORK/ram/"
grep -E 'dumped' "$WORK/mame_ram.log" || true
echo "--- server log ---"; cat "$WORK/custom_serve_ram.log"