Skip to content

Prepare tested ASPAS5 source promotion #1

Prepare tested ASPAS5 source promotion

Prepare tested ASPAS5 source promotion #1

Workflow file for this run

name: Promote tested ASPAS5 sources
on:
push:
branches:
- chatgpt-promote-aspas5
permissions:
contents: write
jobs:
promote:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Apply exact tested source patch
shell: bash
run: |
set -euo pipefail
git checkout -B promote-target origin/main
test "$(git rev-parse HEAD)" = "6e0d7d4692916269dc7c6c60a4ae31e7f4b0266c"
python3 - <<'PY'
from pathlib import Path
import hashlib
def replace_once(path, old, new):
p = Path(path)
s = p.read_text()
if s.count(old) != 1:
raise SystemExit(f"expected exactly one match in {path}: {old[:100]!r}")
p.write_text(s.replace(old, new, 1))
a = 'TOOLS/ASPECT/ASPECT/ASPECT.ASM'
d = 'TOOLS/ASPECT/ASPECTD/ASPECTD.ASM'
replace_once(a,
"; /A and /C retain their existing POS/SIZE behavior. /AS and /S additionally use the\n"
"; hardware-verified Ivy Bridge PF0 programmable-coefficient interface at\n"
"; 680A0h/680A4h and 680B0h/680B4h and selects PF_CTRL filter 00b.\n",
"; /A and /C retain their existing POS/SIZE behavior. /AS and /S are\n"
"; intentionally enabled only on Ivy Bridge and additionally use the hardware-\n"
"; verified PF0 programmable-coefficient interface at 680A0h/680A4h and\n"
"; 680B0h/680B4h and select PF_CTRL filter 00b.\n")
replace_once(a,
"CommandParsed:\n"
" cmp al,ARG_DEFAULT\n",
"CommandParsed:\n"
" ; The FIR-91 programmable-filter path is hardware-verified only on\n"
" ; Ivy Bridge (CPUID family 6, model 3Ah). Reject /AS and /S here in\n"
" ; transient code, before any resident control or MMIO access.\n"
" cmp al,ARG_ASPECT_SHARP\n"
" je CheckSharpCpu\n"
" cmp al,ARG_SHARP_ONLY\n"
" jne CommandHardwareChecked\n"
"CheckSharpCpu:\n"
" mov eax,1\n"
" db 0Fh,0A2h ; CPUID (keep source at .386p)\n"
" shr eax,4 ; discard stepping; AX = extmodel/family/model\n"
" cmp ax,306Ah ; family 6, model 3Ah (Ivy Bridge client)\n"
" jne SharpUnsupported\n"
" mov al,byte ptr [StartupCommand] ; CPUID destroyed AL\n"
"CommandHardwareChecked:\n"
" cmp al,ARG_DEFAULT\n")
replace_once(a,
"ShowHelp:\n"
" mov dx,offset MsgHelp\n"
" call PrintZ\n"
" mov ax,4C00h\n"
" int 21h\n\n"
"InstallDefault:\n",
"ShowHelp:\n"
" mov dx,offset MsgHelp\n"
" call PrintZ\n"
" mov ax,4C00h\n"
" int 21h\n\n"
"SharpUnsupported:\n"
" mov dx,offset MsgSharpUnsupported\n"
" call PrintZ\n"
" mov ax,4C01h\n"
" int 21h\n\n"
"InstallDefault:\n")
replace_once(a,
"MsgModeCenter:\n"
" db 'ASPECT: centered mode.',13,10,0\n"
"MsgUsage:\n",
"MsgModeCenter:\n"
" db 'ASPECT: centered mode.',13,10,0\n"
"MsgSharpUnsupported:\n"
" db 'ASPECT: FIR-91 /AS and /S require Ivy Bridge; command ignored.',13,10,0\n"
"MsgUsage:\n")
replace_once(d,
"; /AS uses the hardware-verified Ivy Bridge programmable-filter mechanism with\n"
"; the selected FIR-91 kernel while preserving /A and /C geometry. /S applies only that\n"
"; filter and keeps the current fitter geometry unchanged.\n",
"; /AS and /S are intentionally enabled only on Ivy Bridge. /AS uses the\n"
"; hardware-verified programmable-filter mechanism with the selected FIR-91\n"
"; kernel while preserving /A geometry. /S applies only that filter and keeps\n"
"; the current fitter geometry unchanged.\n")
replace_once(d,
"CommandParsed:\n"
" cmp byte ptr [StartupCommand],ARG_HELP\n"
" je ShowHelp\n\n"
" ; Check for an already resident ASPECTD before doing any DPMI work.\n",
"CommandParsed:\n"
" cmp byte ptr [StartupCommand],ARG_HELP\n"
" je ShowHelp\n\n"
" ; The FIR-91 programmable-filter path is hardware-verified only on\n"
" ; Ivy Bridge (CPUID family 6, model 3Ah). Reject /AS and /S here in\n"
" ; transient code, before resident control or any DPMI/MMIO setup.\n"
" cmp byte ptr [StartupCommand],ARG_ASPECT_SHARP\n"
" je CheckSharpCpu\n"
" cmp byte ptr [StartupCommand],ARG_SHARP_ONLY\n"
" jne CommandHardwareChecked\n"
"CheckSharpCpu:\n"
" mov eax,1\n"
" db 0Fh,0A2h ; CPUID (keep source at .386p)\n"
" shr eax,4 ; discard stepping; AX = extmodel/family/model\n"
" cmp ax,306Ah ; family 6, model 3Ah (Ivy Bridge client)\n"
" jne SharpUnsupported\n"
"CommandHardwareChecked:\n\n"
" ; Check for an already resident ASPECTD before doing any DPMI work.\n")
replace_once(d,
"ShowHelp:\n"
" mov dx,offset MsgHelp\n"
" call PrintZ\n"
" mov ax,4C00h\n"
" int 21h\n\n"
"SendDisable:\n",
"ShowHelp:\n"
" mov dx,offset MsgHelp\n"
" call PrintZ\n"
" mov ax,4C00h\n"
" int 21h\n\n"
"SharpUnsupported:\n"
" mov dx,offset MsgSharpUnsupported\n"
" call PrintZ\n"
" mov ax,4C01h\n"
" int 21h\n\n"
"SendDisable:\n")
replace_once(d,
"MsgModeCenter:\n"
" db 'ASPECTD: centered mode.',13,10,0\n"
"MsgUsage:\n",
"MsgModeCenter:\n"
" db 'ASPECTD: centered mode.',13,10,0\n"
"MsgSharpUnsupported:\n"
" db 'ASPECTD: FIR-91 /AS and /S require Ivy Bridge; command ignored.',13,10,0\n"
"MsgUsage:\n")
expected = {
a: 'b97fe9eeea992d53b719e912ecd7643074b55192132ff9bc6ab0866bc549de02',
d: '7a3f268a3dba0dc126086257afa02f2d5089afdd3a867d43e50b40eccbd397c9',
}
for path, want in expected.items():
got = hashlib.sha256(Path(path).read_bytes()).hexdigest()
if got != want:
raise SystemExit(f'{path}: SHA256 {got} != tested {want}')
PY
git diff --check
mapfile -t changed < <(git diff --name-only)
printf 'Changed files:\n%s\n' "${changed[*]}"
test "${#changed[@]}" -eq 2
test "${changed[0]}" = "TOOLS/ASPECT/ASPECT/ASPECT.ASM"
test "${changed[1]}" = "TOOLS/ASPECT/ASPECTD/ASPECTD.ASM"
git config user.name "Zoltán Bacskó"
git config user.email "40074203+Falcosoft@users.noreply.github.com"
git add TOOLS/ASPECT/ASPECT/ASPECT.ASM TOOLS/ASPECT/ASPECTD/ASPECTD.ASM
git commit -m "Guard Ivy Bridge-only sharp modes"
git push origin HEAD:main