Repository navigation
dosforge 0.9.55
dosforge v0.9.55
Fix: _effective_size_cap_bytes drift -- COMPAQ3, DRDOS6, DRDOS7
User-reported follow-up to v0.9.54: same "16M means 16M" bug for
compaq3 (Microsoft MS-DOS 3.00 Compaq OEM) -- 16M is rejected,
15M works.
Root cause
v0.9.54 added branches in _effective_size_cap_bytes for PCDOS3
and COMPAQ2 to mirror formlogic's max_mb constraints, but
missed three other modes that formlogic also pins below the FAT
format hard cap:
| BootMode | formlogic max_mb | v0.9.54 disk-side cap | Bug? |
|---|---|---|---|
| COMPAQ3 | 16 | none (used FAT12 32 MiB cap) | yes -- same 16M-rejected as PCDOS3 |
| DRDOS6 | 32 | none (used FAT16 2 GiB cap) | yes -- bumps past 32 MiB on XT-IDE |
| DRDOS7 | 2048 | none (matches FAT16 cap) | no, but added for symmetry |
When formlogic's advertised cap is tighter than the FAT format
cap, the disk-side _effective_size_cap_bytes must mirror it or
_xtide_geometry will bump past the cap and the create gets
rejected by downstream validation.
Fix
Three new branches in _effective_size_cap_bytes:
COMPAQ3-> 16 MiB (same 1985-era partition cap as PCDOS3).DRDOS6-> 32 MiB (IBM-3.3-class BPB, no FAT16B in DR-DOS 6.0).DRDOS7-> 2 GiB (FAT16B BIGDOS; identical to FAT16 hard cap
but added explicitly for symmetry with formlogic's max_mb).
Drift-prevention test
New TestFormDiskCapParity.test_every_formlogic_max_mb_has_disk_side_mirror
iterates formlogic._BOOT_MODE_MEDIA_RULES, builds a probe request
for every rule with an explicit max_mb tighter than the FAT format
cap, and asserts that _effective_size_cap_bytes returns the same
number of bytes the form advertised. Going forward, adding a new
max_mb cap in formlogic without mirroring it in disk.py will
fail this test instead of silently breaking create.
Verified end-to-end on Windows
Direct repro of the COMPAQ3 bug:
$ dosforge create --path test.vhd --media-type vhd --format fat12 \
--size 16M --boot-mode compaq3 --disk-controller xtide
Created and prepared test.vhd
VHD size: 16,294,400 bytes (15.54 MiB)
(Picks the (306, 4, 26) whitelist geometry under the 16 MiB cap,
identical to PCDOS3 behavior after v0.9.54.)
Tests
16 tests in tests/test_size_cap_snap.py (up from 12 in v0.9.54):
- 3 new
_effective_size_cap_bytescases for COMPAQ3 / DRDOS6 / DRDOS7. - 1 new
TestFormDiskCapParitythat catches any future drift between
formlogic and disk.py automatically.
Files changed
src/dosforge/disk.py-- added COMPAQ3 / DRDOS6 / DRDOS7 branches
in_effective_size_cap_bytes.tests/test_size_cap_snap.py-- 3 new per-mode tests + 1 parity test.pyproject.toml+src/dosforge/__init__.py-- 0.9.54 -> 0.9.55.
Carried forward
- v0.9.54 16M means 16M (PCDOS3 / COMPAQ2 + XT-IDE)
- v0.9.53 Show log grows window
- v0.9.52 Windows-path ECHS-doubling fix