During testing for #241 and the list, it appears that the kernel doesn't perform writes when a file takes up all clusters on a given file system. The file is still extended to the expected cluster size, but 21.40 returns AX = 0000h and no data sectors appear to be written.
nasm -I ~/proj/lmacros/ ~/proj/bootimg/bootimg.asm -
D_PAYLOADFILE=::empty -o diskempt.img
cp -ia diskempt.img diskempt.clean
dosemu -I "floppy { device diskempt.img }"
ldebug
y testfull.sld
This is the Script for lDebug:
e 200 "A:\test.dat" 0
f 400 l 400 38
a
mov ah, 3C
mov cx, 0
mov dx, 200
int 21
xchg bx, ax
mov ax, 4200
mov cx, ((#1424 * #1024 - 1) >> 10)
mov dx, ((#1424 * #1024 - 1) & FFFF)
int 21
mov ah, 40
mov dx, 400
mov cx, 1
int 21
mov ax, 4202
mov cx, -1
mov dx, -10
int 21
mov ah, 40
mov dx, 400
mov cx, 10
int 21
nop
int3
nop
.
This is what we get running this:
Welcome to dosemu2!
Build 2.0pre9-dev-20250926-3823-g59b19ff26
C:\>ldebug
-y testfull.sld
-e 200 "A:\test.dat" 0
-f 400 l 400 38
-a
29B2:0100 mov ah, 3C
29B2:0102 mov cx, 0
29B2:0105 mov dx, 200
29B2:0108 int 21
29B2:010A xchg bx, ax
29B2:010B mov ax, 4200
29B2:010E mov cx, ((#1424 * #1024 - 1) >> 10)
29B2:0111 mov dx, ((#1424 * #1024 - 1) & FFFF)
29B2:0114 int 21
29B2:0116 mov ah, 40
29B2:0118 mov dx, 400
29B2:011B mov cx, 1
29B2:011E int 21
29B2:0120 mov ax, 4202
29B2:0123 mov cx, -1
29B2:0126 mov dx, -10
29B2:0129 int 21
29B2:012B mov ah, 40
29B2:012D mov dx, 400
29B2:0130 mov cx, 10
29B2:0133 int 21
29B2:0135 nop
29B2:0136 int3
29B2:0137 nop
29B2:0138 .
-t
AX=3C00 BX=0000 CX=0000 DX=0000 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0102 NV UP EI PL ZR NA PE NC
29B2:0102 B90000 mov cx, 0000
-
AX=3C00 BX=0000 CX=0000 DX=0000 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0105 NV UP EI PL ZR NA PE NC
29B2:0105 BA0002 mov dx, 0200
-
AX=3C00 BX=0000 CX=0000 DX=0200 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0108 NV UP EI PL ZR NA PE NC
29B2:0108 CD21 int 21
-
AX=0005 BX=0000 CX=0000 DX=0200 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=010A NV UP EI PL ZR NA PE NC
29B2:010A 93 xchg ax, bx
-
AX=0000 BX=0005 CX=0000 DX=0200 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=010B NV UP EI PL ZR NA PE NC
29B2:010B B80042 mov ax, 4200
-
AX=4200 BX=0005 CX=0000 DX=0200 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=010E NV UP EI PL ZR NA PE NC
29B2:010E B91600 mov cx, 0016
-
AX=4200 BX=0005 CX=0016 DX=0200 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0111 NV UP EI PL ZR NA PE NC
29B2:0111 BAFF3F mov dx, 3FFF
-
AX=4200 BX=0005 CX=0016 DX=3FFF SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0114 NV UP EI PL ZR NA PE NC
29B2:0114 CD21 int 21
-
AX=3FFF BX=0005 CX=0016 DX=0016 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0116 NV UP EI PL ZR NA PE NC
29B2:0116 B440 mov ah, 40
-
AX=40FF BX=0005 CX=0016 DX=0016 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0118 NV UP EI PL ZR NA PE NC
29B2:0118 BA0004 mov dx, 0400
-
AX=40FF BX=0005 CX=0016 DX=0400 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=011B NV UP EI PL ZR NA PE NC
29B2:011B B90100 mov cx, 0001
-
AX=40FF BX=0005 CX=0001 DX=0400 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=011E NV UP EI PL ZR NA PE NC
29B2:011E CD21 int 21
-
AX=0000 BX=0005 CX=0001 DX=0400 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0120 NV UP EI PL ZR NA PE NC
29B2:0120 B80242 mov ax, 4202
-
AX=4202 BX=0005 CX=0001 DX=0400 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0123 NV UP EI PL ZR NA PE NC
29B2:0123 B9FFFF mov cx, FFFF
-
AX=4202 BX=0005 CX=FFFF DX=0400 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0126 NV UP EI PL ZR NA PE NC
29B2:0126 BAF0FF mov dx, FFF0
-
AX=4202 BX=0005 CX=FFFF DX=FFF0 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0129 NV UP EI PL ZR NA PE NC
29B2:0129 CD21 int 21
-
AX=3FF0 BX=0005 CX=FFFF DX=0016 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=012B NV UP EI PL ZR NA PE NC
29B2:012B B440 mov ah, 40
-
AX=40F0 BX=0005 CX=FFFF DX=0016 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=012D NV UP EI PL ZR NA PE NC
29B2:012D BA0004 mov dx, 0400
-
AX=40F0 BX=0005 CX=FFFF DX=0400 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0130 NV UP EI PL ZR NA PE NC
29B2:0130 B91000 mov cx, 0010
-
AX=40F0 BX=0005 CX=0010 DX=0400 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0133 NV UP EI PL ZR NA PE NC
29B2:0133 CD21 int 21
-
AX=0000 BX=0005 CX=0010 DX=0400 SP=FFFE BP=0000 SI=0000 DI=0000
DS=29B2 ES=29B2 SS=29B2 CS=29B2 IP=0135 NV UP EI PL ZR NA PE NC
29B2:0135 90 nop
-q
C:\>dir a:
Volume in drive A has no label
Volume Serial Number is 0000-0000
Directory of A:\
TEST DAT 1,458,176 04-21-26 7:22p
1 file(s) 1,458,176 bytes
0 dir(s) 0 bytes free
C:\>ldebug
-h #1_458_176
00164000 decimal: 1458176
-q
C:\>callver show
FreeDOS kernel, OEM ID FDh, reports DOS version: 7.10
Internal revision and version: 44 7.10
FreeDOS kernel - GIT (build 2044 OEM:0xfd) [compiled Apr 21 2026]
C:\>
Both 21.40 calls return NC, AX = 0000h. Both should succeed. After the test, the file occupies 1_458_176 Bytes in the data area, exactly 16_4000h Bytes, so both writes should succeed fully.
During testing for #241 and the list, it appears that the kernel doesn't perform writes when a file takes up all clusters on a given file system. The file is still extended to the expected cluster size, but 21.40 returns AX = 0000h and no data sectors appear to be written.
This is the Script for lDebug:
This is what we get running this:
Both 21.40 calls return NC, AX = 0000h. Both should succeed. After the test, the file occupies 1_458_176 Bytes in the data area, exactly 16_4000h Bytes, so both writes should succeed fully.