Replace the partial mechanics transcriptions with a separate, readable C11 reconstruction of the complete Win16 image while preserving the original raw Ghidra export as immutable evidence. Cover all ordinary and overlapping entry points, Borland runtime behavior, Win16 imports, segmented data, callbacks, resources, indirect control flow, physics, rendering, persistence, and startup/shutdown lifecycles. Add deterministic extraction and audit tooling plus address-linked ledgers for functions, imports, DGROUP ranges and objects, relocations, resources, and callbacks. The final gate records zero raw, partial, restored, unknown, blocked, or unclassified required units. Keep the semantic-fidelity boundary explicit: the portable C is not claimed to reproduce a byte-identical Borland NE build. Add strict focused harnesses for every reconstructed C unit, exact resource round-trip checks, and a 16-bit Borland Real48 reference probe. No Rust source or Cargo metadata is changed in this phase. Test Plan: - `bash original/tools/test_reconstructed_c.sh` -- passed - `bash original/tools/probe_real48_reference.sh` -- passed bit-for-bit - `python3 original/tools/audit_reconstruction.py --require-complete` -- passed - `git diff --cached --check` -- passed - `git diff HEAD -- '*.rs' Cargo.toml Cargo.lock` -- empty
23 lines
1.8 KiB
Bash
Executable File
23 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
workspace_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd -P)
|
|
probe_dir=$(mktemp -d /tmp/tdkpin-real48-probe.XXXXXX)
|
|
trap 'rm -f -- "$probe_dir/R48.COM" "$probe_dir/R48.OUT"; rmdir -- "$probe_dir"' EXIT
|
|
|
|
cd -- "$workspace_dir"
|
|
nasm -f bin tools/probes/real48_reference.asm -o "$probe_dir/R48.COM"
|
|
|
|
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy dosbox \
|
|
-c "mount c $probe_dir" \
|
|
-c 'c:' \
|
|
-c 'R48.COM' \
|
|
-c 'exit' >/dev/null 2>&1
|
|
|
|
test -f "$probe_dir/R48.OUT"
|
|
actual=$(od -An -v -tx1 "$probe_dir/R48.OUT" | tr -d ' \n')
|
|
expected=0000000000008100000000008100000000808200000000009f00feffff7fa000000000809b00a0a2796b9b00a0a279eb0100000000ffffffff0000000000000200000000010000000000000080010000008000ffffff7f01820000000000000000000000000081000000000000810000000000008200000000000081000000000000800000000040008200000000400081000000000000820000000000008000000000c0008200000000c0008000000000000080000000008000000000000000000200000000000000ffffffffff01000000000000007efeffffff7e0181000000000000820000000060008000000000800082000000004000800000000040000000000000008000000000008100000000008000000000408100000000808000000000c0000000000000010000000000a855aa55aa5500000000000000000000000081000000000081fa33f304358200000000008149a070c41c0000000000007eb6b6afdb7a7f0b0c35626d7f49e2c20f490000000000007d60d5d4ad7e7f0a2b38636d8021a2da0f49815f970cb70d8021a2da0fc980d0f71772b100000000000080d5f71772317fff651f994f82acdd8d5d137efc1d55950a7f67b1b15a3c807be397451b81000000000081f2704c095382a35854f82d83a7c625736c8fa87cee142c0000000000007ffeffffff7f80faffffff7f00000000000000000000000080f9ffffffff804878a46a5780faffffff7f80c242d7b35d00000000000080f9ffffffff80f9ffffff7f00000000000080a87d40510a
|
|
printf '%s' "$actual"
|
|
printf '\n'
|
|
test "$actual" = "$expected"
|