Date : Fri, 26 Sep 1986 10:15:18 EDT
From : SAGE@LL.ARPA
Subject: Automatic Disk Logging
I have not really thought through the question of how one would make
the disk operating system (DOS) perform automatic disk logging, but I do
not think that it is sufficient or necessary to simply check for which
disks are set to read-only status. First of all, the user may have set
a disk to R/O status (using STAT or another utility), and that diskette
may not have been changed. In fact, relogging that diskette would
defeat the purpose behind the user's setting it to R/O status, i.e., to
prevent any writing to that diskette. Secondly, after a diskette is
swapped without resetting with a control-c, the diskette is not yet
marked as read-only.
I think that what has to be done is the following. Whenever DOS is
asked to write to a disk, it must check the allocation table implied by
the directory on the diskette with the allocation table stored in the
BIOS. If the diskette has not been swapped, the two tables will agree;
if they have been swapped chances are very high that they will not
agree. The standard Digital Research BDOS does this, and if it finds
that the tables do not agree, it then sets the disk status to read-only,
which precipitates the "BDOS ERROR: DISK R/O" error message. If you
want the DOS to log in the swapped disk, you must take a more complex
action at this point.
I am sure that the required actions to handle this situation are
more complex than meets the eye. If you want to try hacking, have fun!
I would start by adding code to log in the new disk in such a way that
the write operation can then proceed. Good luck. If you simply want
this very nice capability in your system, I strongly recommend that you
look into purchasing ZRDOS from Echelon, Inc. (415-948-3820). Although
ZRDOS is the DOS used with the Echelon Z operating system, ZRDOS can be
used as the DOS in a standard CP/M2.2 system as well (it does require a
Z80 or compatible microprocessor). ZRDOS offers quite a few nice
features in addition to automatic disk logging, and I am sure that
Echelon will be happy to send you more detailed information. As good as
ZRDOS is, by the way, it still cannot handle all disk-swap situations.
I believe that it has trouble, at least on some systems that support
automatic recognition of multiple disk formats, when the swapped
diskette has a different format, such as when you remove a Kaypro SSDD
diskette and put in an Ampro DSDD diskette. I say all this as an
indication that automatic disk logging is not as easy as one might think
at first. ZRDOS has gone through a lot of development to get to the
point it is at now.
Jay Sage