[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ewen Wannop's ProDOS Directory Info



In article <20040219034144.11576.00002170@mb-m12.aol.com>,
 mjmahon@aol.com (Michael J. Mahon) wrote:

> John B. Matthews wrote:
> 
> >In article <4033D78A.931F3ECB@swbell.net>,
> > Rubywand <rubywand@swbell.net> wrote:
> >
> >> Bill Garber writes ...
> >>>[perils of extending top level directory]
> >>      Interesting info. Wonder if Ewen tried moving the Volume Bit Map so
> >that
> >> he would have contiguous Volume Directory blocks. If he did, then the
> >failures
> >> may have been due to Appleworks's assumption that the VBM would start at
> >Block
> >> 6. It would be writing file entries to Block 6 _and_ marking the VBM at
> >Block
> >> 6-- sure to mess up the directory.
> >
> >It's possible, but the location of the pointer to the first VBM 
> >block was well documented in the ProDOS technical reference 
> >manual. For example, see procedure FreeCount in the code at
> >
> >http://www.wright.edu/~john.matthews/apple2.html#df
> >
> >I always speculated that the limit was a compromise to 
> >accomodate 140K floppies.
> 
> But why not fixed-allocate just the _first_ block of the
> Volume Directory, and let it be automatically extended
> as needed like any subdirectory?

Good point!

> This would provide an even lower limit on Volume Directory
> size (1 block) for small disks and accommodate any size
> appropriate for large ones.
> 
> Perhaps the designers were simply hinting at the maximum
> size they expected for _any_ directory, by enforcing it for
> the Volume Directory.  Linked-list searches on disk are not
> a very efficient data organization for directory lookups.
> 
> A fixed-size directory of four contiguous blocks allows for
> a lookup routine to read the entire directory in as a single I/0
> (or at least, without having to seek), then search in the buffer.

This may be crucial. The standard Volume Directory and a small 
Volume Bit Map fill out track zero, after the boot blocks. It 
can be operated on without a seek. The storage choices at the 
time were floppy (seek time 100s of ms?) or 5 MB hard disk (10s 
of ms?). Allocating more Voume Directory blocks after the first 
would have _guranteed_ a seek to traverse the root directory and 
operate on the VBM.

> On the other hand, the links allow for flexible directory size.
> 
> Perhaps the choice of a fixed-size, contiguous, but linked
> Volume Directory was just the designer's way to say, "You
> are free to make subdirectories of any size, but I think that
> a reasonable practical limit is four blocks worth."
> 
> This hybrid approach is actually more complex than simply
> making the Volume Directory the "root" subdirectory, so
> there must have been some motivation for it.
> 
> Whatever the reason, the assumption of fixed Volume Directory
> size has been made for so long that it would be impractical to
> change it now, except under special circumstances (like the
> Appleworks 5.25" disk  ;-).
> 
> -michael
> 
> Check out amazing quality sound for 8-bit Apples on my
> Home page:  http://members.aol.com/MJMahon/

John
----
jmatthews at wright dot edu
www dot wright dot edu/~john.matthews/