Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/vmsdcl/dcl_lexical.c
Original file line number Diff line number Diff line change
Expand Up @@ -1407,6 +1407,15 @@ static int lex_getsyi(struct dcl_context *ctx, const char *args,
ovmx_compat_version_field(field);
field[OVMX_VMS_VERSION_FIELD_LEN] = '\0';
strncpy(result, field, result_size - 1);
} else if (strcmp(s, "ARCH_NAME") == 0) {
/* Machine surface: the VMS-style architecture name (SYI$_ARCH_NAME),
* from the identity SSOT (INV-1) -- the SAME ovmx_hw_arch() the $GETSYI
* service (sys_misc.c SYI$_ARCH_NAME) returns, so the two surfaces never
* disagree. Was UNHANDLED here, so F$GETSYI("ARCH_NAME") fell through to
* "0"; real VMS returns the arch token ("VAX"/"Alpha"/"IA64"/"x86_64").
* NOT space-padded (byte-confirmed on the live oracle: "Alpha" exact, no
* padding -- unlike VERSION's fixed 8-char field). rd vms-76c3. */
strncpy(result, ovmx_hw_arch(), result_size - 1);
} else if (strcmp(s, "HW_NAME") == 0) {
strncpy(result, uts.machine, result_size - 1);
for (size_t i = 0; result[i]; i++)
Expand Down
2 changes: 2 additions & 0 deletions tests/lab-vax/test_dcl_acceptance_vax.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export EXPECTED_BOOT_BANNER="$PNAME $PVER"
CVER=$(idval OVMX_VMS_COMPAT_VERSION_VAX)
[ -n "$CVER" ] || die "could not read OVMX_VMS_COMPAT_VERSION_VAX from $IDENTITY (rd vms-10e)"
export EXPECTED_COMPAT_VERSION="$CVER"
# rd vms-76c3: F$GETSYI("ARCH_NAME") on a __vax__ build -> ovmx_hw_arch() = "VAX".
export EXPECTED_ARCH_NAME="VAX"

# VOLUME_LABEL tracks master_system_volume's vmsfs_master --ods2 label; verify.
export VOLUME_LABEL="OVMXSYS"
Expand Down
14 changes: 14 additions & 0 deletions tests/qemu/lib/dcl_acceptance_battery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
# EXPECTED_COMPAT_VERSION -- the version F$GETSYI("VERSION") must report,
# true-to-arch (ovmx_compat_version()): the real
# VSI version on a lineage arch, else OVMX's own.
# EXPECTED_ARCH_NAME -- the arch token F$GETSYI("ARCH_NAME") must report,
# the gate's own build arch (ovmx_hw_arch()):
# "X86_64" / "AARCH64" / "VAX" / "Alpha".
# VOLUME_LABEL -- the mastered ODS-2 system-disk label (OVMXSYS).
# CMD_TIMEOUT -- per-command bound run_cmd passes to wait_for.
# PASS / FAIL -- integer counters; ok/bad below increment them.
Expand Down Expand Up @@ -201,6 +204,17 @@ run_dcl_acceptance_battery() {
must_have "$SEG" "[${EXPECTED_COMPAT_FIELD}]" "WRITE F\$GETSYI [vms-28a]: F\$GETSYI(\"VERSION\") is the fixed 8-char space-padded VMS field '[${EXPECTED_COMPAT_FIELD}]' (not a trimmed token)"
negctl "$SEG" 'F$GETSYI' "WRITE F\$GETSYI field"

# --- F$GETSYI("ARCH_NAME") reports the VMS arch token (vms-76c3) ---------
# Was UNWIRED in the DCL lexical -> fell through to "0"; real VMS reports the
# arch name ("VAX"/"Alpha"/"X86_64"), the SAME ovmx_hw_arch() the $GETSYI
# service returns (SYI$_ARCH_NAME). Bracket it (robust; NOT space-padded --
# the oracle confirmed "Alpha" exact, no padding). EXPECTED_ARCH_NAME is
# caller-provided (the gate's own build arch), so each arch asserts its own.
run_cmd 'WRITE SYS$OUTPUT "[" + F$GETSYI("ARCH_NAME") + "]"'
must_have "$SEG" "[${EXPECTED_ARCH_NAME}]" "WRITE F\$GETSYI [vms-76c3]: F\$GETSYI(\"ARCH_NAME\") reports the VMS arch token '[${EXPECTED_ARCH_NAME}]'"
must_not_have "$SEG" '[0]' "WRITE F\$GETSYI [vms-76c3]: F\$GETSYI(\"ARCH_NAME\") is NOT the unwired '[0]' fall-through"
negctl "$SEG" 'F$GETSYI' "WRITE F\$GETSYI ARCH_NAME"

# --- SHOW QUOTA (vms-73c4: fabricated "[200,1]") ------------------------
run_cmd 'SHOW QUOTA'
# VMS-faithful: either the real current UIC ([1,4] for SYSTEM) OR an honest
Expand Down
4 changes: 4 additions & 0 deletions tests/qemu/test_dcl_acceptance_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,14 @@ if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
QEMU=qemu-system-aarch64
MACHINE="-machine virt -cpu cortex-a57"
CONSOLE="console=ttyAMA0"
# rd vms-76c3: F$GETSYI("ARCH_NAME") on an __aarch64__ build -> ovmx_hw_arch() = "AARCH64".
EXPECTED_ARCH_NAME="AARCH64"
else
QEMU=qemu-system-x86_64
MACHINE=""
CONSOLE="console=ttyS0"
# rd vms-76c3: F$GETSYI("ARCH_NAME") on an __x86_64__ build -> ovmx_hw_arch() = "X86_64".
EXPECTED_ARCH_NAME="X86_64"
fi

for f in "$KERNEL" "$SLIM_INITRD" "$DISTRIB_IMG"; do
Expand Down
4 changes: 4 additions & 0 deletions tools/cross-alpha/run-boot-alpha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ derive_expected_identity() {
cver=$(idval OVMX_VMS_COMPAT_VERSION_ALPHA)
[ -n "$cver" ] || die "could not read OVMX_VMS_COMPAT_VERSION_ALPHA from $IDENTITY (rd vms-10e)"
EXPECTED_COMPAT_VERSION="$cver"
# rd vms-76c3: F$GETSYI("ARCH_NAME") on an __alpha__ build -> ovmx_hw_arch() =
# "Alpha" (mixed case, byte-confirmed on the live lab-Alpha oracle).
EXPECTED_ARCH_NAME="Alpha"
# VOLUME_LABEL tracks build-alpha-bootimage.sh's master step; verify the source
# still uses it so a relabel there cannot silently desync this gate.
VOLUME_LABEL="OVMXSYS"
Expand Down Expand Up @@ -324,6 +327,7 @@ run_acceptance_boot() {
LOGIN_USER="'"${LOGIN_USER:-SYSTEM}"'"; LOGIN_PASS="'"${LOGIN_PASS:-MANAGER}"'"
export EXPECTED_BOOT_BANNER="'"$EXPECTED_BOOT_BANNER"'"
export EXPECTED_COMPAT_VERSION="'"$EXPECTED_COMPAT_VERSION"'"
export EXPECTED_ARCH_NAME="'"$EXPECTED_ARCH_NAME"'"
export VOLUME_LABEL="'"$VOLUME_LABEL"'"
# qemu-system-alpha -M clipper RTC reads ~20 years off (emulator epoch
# quirk); OVMX faithfully reports that guest clock, so the SHOW TIME battery
Expand Down