Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

about to fix the "final" doslfn bug (Announce)

posted by Japheth Homepage, Germany (South), 29.03.2022, 05:45

> About doslfn: please hold off a new release! It's likely that there's still
> a bug in make_free_dirent_space, causing a "hang". I have no test case yet,
> but may be able to narrow the bug down.

Perhaps I was able to find that bug.

With the neweset doslfn, the bug shows as a "system hang" that requires a reboot. I guess that with older versions, one gets an "access denied" error instead.

The bug happens again in make_free_dirent_space. It's a bit difficult to make a test case, because the error occurs only if the disk is pretty "full". Once the error has occured - using a debugger to intercept and so avoiding the "hang" - one can see (using WDe) that the sub-directory's size has been increased to 2 clusters, although only the first sector of the first cluster is used so far.

The suspicious code IMO seems to be here:


proc Next_Sektor pascal         ;nur FAT
;liefert n?chsten Sektor der Clusterkette bzw. des Hauptverzeichnisses
;PE: [CurSector]=momentaner Sektor
;PA: [CurSector]=n?chster Sektor, bereits gelesen
;    BX=Zeiger auf Sektor-Anfang
;    [num_cluster] inkrementiert bei Cluster-Wechsel
;VR: alle
        mov     eax,[CurSector]
        inc     eax
if 1
; this seems to fix the bug.
; DPB_LastSec contains the size of the user area of the disk ( without FAT )
; and is originally compared with CurSector, which has the FAT "included".
        mov ebx,[DPB_LastSec]
        add ebx,[DPB_UsrSec]
        cmp     ebx,eax
else
        cmp     [DPB_LastSec],eax
endif
        jc      _nde_ret        ;war User-Bereich: Ende!
        sub     eax,[DPB_UsrSec];Hauptverzeichnis-Ende?

---
MS-DOS forever!

 

Complete thread:

Back to the forum
Board view  Mix view
22632 Postings in 2109 Threads, 402 registered users, 303 users online (0 registered, 303 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum