Date : Tue, 09 Nov 1982 (Tues:00day) 1141-EDT
From : PLATTS@Wharton-10 (Steve Platt)
Subject: when to log-in a new disk?
When to (physically) log in a new disk? I've been using CP/M for
6 years now, and haven't seen a good answer. My new system, a US MICRO
XOR (S100-12) system [side-note: excellent system, literally "plug it
in and run", well worth the $$] has a BIOS which does disk format
selection as follows:
Upon warm-start, each disk is marked "unaccessed".
The first time a disk is used (from the BIOS's point of view),
a "format-check" operation is performed: track 0 sector 1 is read: this
will *always* have 128 bytes -- and the last byte is checked for format
information... E5 means SSSD 8", 1A means SSDD 8", etc.
Unfortunately, the log-in of a disk from the BDOS's (and hence the
program's) point of view is seperated completely from the BIOS login;
so if you insert a new disk and do a BDOS(RELOG_DISK), the BDOS will
note (for its use) that this is a new disk, the block-table must be
recomputed, etc. The BIOS never hears of this... if the disk formats
don't match (see program SWEEP, for instance), the system tends to
die when accessing is attempted. This is an inherent flaw in the
way *this particular BIOS* was designed -- I've seen BIOSs which
use the timeout-overflow standard to check for disk format change.
How did I get around this? I haven't, yet. I have planned out
a solution, and will implement it when time allows. The solution is
rather hacky, some of you out there may appreciate more than I:
I assume that when a new disk is inserted, the first operation will
be one which accesses the directory, starting at the beginning. This
may be a directory search, DIR, file-open, whatever. So every time I
go to do a READ, I check the TRACK/SECTOR combination to see if it is
the combination which means "beginning-of-directory". (This can be
precomputed for any and all disk formats based on the DPB.) If I
*am* seeking the begin-dir., I over-seek to track 0 sector 1, read it
in, and double-check the format.
If this seems overly gross to you, try instead this: trace out in
the BDOS to find the sequence of operations performed to login a disk...
at some point, it will mark the disk (in the BDOS logged-in vector)
as "unused" -- insert a call at this point to your routine in the BIOS
which will perform the same operation, keeping its own version of
the LOGIN_VECTOR. Then, when SELDSK is called, check it and....
Ain't CP/M wonderful? Isn't the concept of multiple-densities well
handled?
-Steve