[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apple //+ floppy technical info
- Subject: Re: Apple //+ floppy technical info
- From: nparker@cie-2.uoregon.edu (Neil Parker)
- Date: 1997/01/08
- Newsgroups: comp.sys.apple2
- Organization: University of Oregon Campus Information Exchange
- References: <5aouuj$3kg@ren.cei.net> <5ap66p$3ba@darla.visi.com> <5apuls$sh4@login.freenet.columbus.oh.us>
In article <5apuls$sh4@login.freenet.columbus.oh.us>
dalloff@freenet.columbus.oh.us (Dave Althoff) writes:
>[...]
>According to either Beneath Apple DOS or the documentation for Bag of
>Tricks (I forget which), DOS 3.3 uses -2 sector interleave, which is
>optimized for a really quick boot cycle. The trouble with that is that it
>isn't particularly optimal for anything else. A -9 interleave allows DOS
>3.3 to access files significantly faster, but reduces the boot cycle to
>glacial slowness.
Actually, the sectors on a DOS 3.3 disk have a 1:1 interleave...that is,
as the disk spins the sectors pass by in sequential order.
But DOS 3.3 doesn't *use* them in sequential order...there's an internal
lookup table that says "If I want sector 1, access sector $D instead; if
I want sector 2, access sector $B instead; etc." _Beneath_Apple_DOS_ calls
this "logical interleaving." So DOS 3.3 disks have a physical interleave
of +1, and a logical interleave of -2.
>With the Bag Of Tricks INIT program, there is a neat compromise available
>that lets you have the best of both worlds. The sector interleave is
>physically encoded on the disk in the sector headers, so it is possible to
>re-INIT tracks 3-35 on the disk with a -9 interleave, while leaving tracks
>0-2 at -2. This way, you get the quick boot, and the improved file access
>times.
>
>What I have noticed, though, is that the speed advantage of the -9
>interleave seems to vanish if you use Pronto-DOS...so apart from some
>tinkering a number of years ago, I haven't done much with this, since I
>use Pronto-DOS wherever practical (except on my GS, of course, which is
>running GS/OS).
Yes, a -9 interleave helps, but it's possible to do *much* better by
patching DOS.
The problem is that DOS 3.3 does a lot of copying data around in memory,
which slows things down a lot. When DOS 3.3 reads a file, for example,
the DOS 3.3 file manager loads a sector of the file into an internal
buffer, and then copies the bytes out of that buffer, one byte at a time,
being very careful not to overflow the caller's memory. This careful
one-byte-at-a-time copying is really slow, so that by the the file manager
is read for the file's next sector, the desired sector has already spun
past, as have several other sectors as well.
The -9 interleave turns out to be just the right amount to put the next
sector under the read/write head exactly when it's wanted, but a major
speed bottleneck remains: DOS is still doing its careful
one-byte-at-a-time copying. With a little rewriting, DOS can be made to
load entire sectors directly into the caller's memory, which turns out to
be enough of a speed improvement to make the original -2 interleave work.
That's what ProntoDOS does. That's also why the -9 interleave is a *bad*
idea under ProntoDOS...ProntoDOS is ready for the next sector almost
immediately, but it has to wait half a disk revolution for the next sector
to become available on a -9-interleaved disk.
- Neil Parker
--
Neil Parker | Unsolicited commercial e-mail to my
nparker@cie-2.uoregon.edu | address is not welcome, and will be
nparker@cie.uoregon.edu | discarded unread.
http://cie-2.uoregon.edu/~nparker |