[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Microsoft Z80 Card
In article <e8qdnevMA_AW9YHZRVn-jw@comcast.com>,
Michael J. Mahon <mjmahon@aol.com> wrote:
> Paul Schlyter wrote:
...........
>> Formatting a new drive for CP/M is easy: just make sure all the
>> sectors are there, then fill them all with hex E5 bytes.
>
> Ouch--I had forgotten the need to write all sectors. This is an
> effort equivalent to a low-level format! Clearly designed at a
> time when that could be done quickly...
>
> Would it be possible to do this incrementally in the driver? For
> example, by clearing the remainder of every sector written to to $E5
> and by presenting any unused sector as filled? (I have a feeling
> that this would require writing to every sector allocated in a block--
> not a bad security measure in any case. ;-)
Actually, you don't need to fill the entire disk with hex E5 bytes.
All that needs to be filled with E5's is the directory area of the
disk, since the first byte of a directory entry (which contains the
user number when the directory entry is used) is hex E5 when the
directory entry is free.
And if you want to "format" the CP/M disk in a really minimalistic
way, only the first byte of each directory entry needs to be set to
hex E5 - the rest can contain garbage since it'll be overwritten
anyway when the directory entry is allocated for a new file. But
there are a number of CP/M "unerase" utilities which attempt to restore
deleted files (basically they look for directory entries with E5 in
the first byte where the remainder of the directory entry matches some
filename you've given - your filename could be *.* though - and then
it replaces the E5 with a user number of your choice, usually 00),
and these "unerase" utilities may produce funny effects if the remainder
of the directory entry contains garbage.
--
----------------------------------------------------------------
Paul Schlyter, Grev Turegatan 40, SE-114 38 Stockholm, SWEDEN
e-mail: pausch at stockholm dot bostream dot se
WWW: http://stjarnhimlen.se/