Title [lDOS boot] Loading initial loader high would lead to reading wrong FAT12 sector
AuthorE. C. Masloch
Created2026-06-10 21:21:19 +0200 Jun Wed
State closed

The cwd to zero dx in FAT12 FAT load was made obsolete in hg e7ed19d7b7a6 and especially in hg dee85d7aee6b both on 2025-10-03.

Prepare test:

alias add lddfdatop boot protocol ldos cmdline=0 segment=dpr-(1 + #20*#1024/10 + #1536/10 + #8192/10 + 100) minpara=#1536/10 fda/lddebugu.com

Run test:

lddafdatop
e ss:bp-C as words (-1) (-1) 0
g

Returns disk error if this code calculates ax >= 8000h:

    mov ax, cs
    add ax, (payload.actual_end -$$+0 +15) >> 4
E. C. Masloch on 2026-06-10 21:32:03 +0200 Jun Wed

Fixed in hg d3e486ea6de2 on 2025-10-12. This used xor dx,dx instead. Further, in hg 861ae75792d1 on the same day cwd is used again, re-ordered to ensure DX is zeroed by it.