Skip to content

ecm fix 4 dos extend map fail#248

Open
ecm-pushbx wants to merge 3 commits intoFDOS:masterfrom
ecm-pushbx:ecm-fix-4-dos-extend-map-fail
Open

ecm fix 4 dos extend map fail#248
ecm-pushbx wants to merge 3 commits intoFDOS:masterfrom
ecm-pushbx:ecm-fix-4-dos-extend-map-fail

Conversation

@ecm-pushbx
Copy link
Copy Markdown
Contributor

Another take on #241 and a related question in #245 which reads:

I also added two comments on unexpected corner cases around writes of length 0 trying to extend more than actually needed. There is possibly a fragmentation source if a file is extended to fall exactly on a cluster boundary with 0-length write

Original issue: FDOS#241

Test cases as Script for lDebug files:

test$ cat testw1b.sld
e 200 "A:\test.dat" 0
f 300 l 400 26
a
 mov ah, 3C
 mov cx, 0
 mov dx, 200
 int 21
 xchg bx, ax
 mov dx, 300
 mov cx, 1
 mov ah, 40
 int 21
 mov ah, 68
 int 21
 int3
 int3
 jmp 100
 .

test$ cat testwp1b.sld
e 200 "A:\test.dat" 0
f 300 l 400 26
a
 mov ah, 3C
 mov cx, 0
 mov dx, 200
 int 21
 xchg bx, ax
 mov ax, 4200
 xor cx, cx
 mov dx, 200
 int 21
 mov dx, 300
 mov cx, 1
 mov ah, 40
 int 21
 mov ah, 68
 int 21
 int3
 int3
 jmp 100
 .

test$ cat testwpp1.sld
e 200 "A:\test.dat" 0
f 300 l 400 26
a
 mov ah, 3C
 mov cx, 0
 mov dx, 200
 int 21
 xchg bx, ax
 mov ax, 4200
 xor cx, cx
 mov dx, 201
 int 21
 mov dx, 300
 mov cx, 1
 mov ah, 40
 int 21
 mov ah, 68
 int 21
 int3
 int3
 jmp 100
 .

test$ cat testw1c.sld
e 200 "A:\test.dat" 0
f 300 l 400 26
a
 mov ah, 3C
 mov cx, 0
 mov dx, 200
 int 21
 xchg bx, ax
 mov dx, 300
 mov cx, 201
 mov ah, 40
 int 21
 mov ah, 68
 int 21
 int3
 int3
 jmp 100
 .

test$ cat testwp1c.sld
e 200 "A:\test.dat" 0
f 300 l 400 26
a
 mov ah, 3C
 mov cx, 0
 mov dx, 200
 int 21
 xchg bx, ax
 mov ax, 4200
 xor cx, cx
 mov dx, 200
 int 21
 mov dx, 300
 mov cx, 201
 mov ah, 40
 int 21
 mov ah, 68
 int 21
 int3
 int3
 jmp 100
 .

test$
The possibility of fragmentation due to this misbehaviour was mentioned
in FDOS#245 And it's also just slower to
allocate the unneeded cluster just to free it again truncating the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant