At 07:01 PM 3/18/01 +0100, you wrote:

>>SET the disk change flag? Why do you need to do that?
>
>The behavior of my driver when a function call is made is the following:
>
>- Check if the disk has been changed via CALL #4013.
>- If not, read an internal table which contains the type of the drive. If
>FAT16, process function call. Else (FAT12) do not process and let DOS to do
>it.
>- If yes, read boot sector in order to determine the type of drive. If
>FAT16, build new DPB and process function call. Else, let DOS to do it.
>Update the drive type table in both cases.
>
>Well, suppose that disk was changed and it is FAT12 type. My driver must do
>nothing and let DOS to execute funtion call. But what will do DOS at first?
>To check if the disk was changed. But my driver did it already!! So DOS
>will obtain a "disk not changed" status, even if the disk was changed, and
>will not update the drive's work area. This is very dangerous...

What you could do, instead of setting the disk change flag, is to either
update or mark as invalidated any data that can change if a disk is changed.

What info does DOS keep of a disk? Is it only the disk buffers, or is there
more?

If it's only the disk buffers, the solution is simple: perform "invalidate
disk buffers" (standard DOS2 call) whenever disk change status is
"changed". If a FAT12 disk is accessed, DOS will read a "disk not changed"
status, but this doesn't matter as there is no info left about the disk
that was changed.

Bye,
                Maarten


****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****

Reply via email to