Skip to content

INT21,7305 only invalidates buffers on success #234

@boeckmann

Description

@boeckmann

I think the buffers should also invalidated in case of failure, as there may have been partial multi-sector writes despite failure is returned?!?

kernel/kernel/inthndlr.c

Lines 401 to 407 in 8535ddb

r->AX =
dskxfer(r->DL - 1, SectorBlock->blkno, SectorBlock->buf,
SectorBlock->nblks, mode);
if (mode == DSKWRITEINT26)
if (r->AX == 0)
setinvld(r->DL - 1);

Interestingly, for INT25,26 the logic is negated: buffers only invalidated on failure:

kernel/kernel/inthndlr.c

Lines 1858 to 1866 in 8535ddb

r->ax = dskxfer(drv, blkno, buf, nblks, mode);
CLEAR_CARRY_FLAG();
if (r->ax != 0)
{
SET_CARRY_FLAG();
if (mode == DSKWRITEINT26)
setinvld(drv);
}

Though there is a buffer invalidate a few lines above introduced by me:

kernel/kernel/inthndlr.c

Lines 1856 to 1857 in 8535ddb

if (mode == DSKWRITEINT26)
DeleteBlockInBufferCache(blkno, blkno, drv, XFR_WRITE);

but this contains an error by only invalidating the first buffer of a potential multi-sector write.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions