Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!rochester!cornell!batcomputer!braner
From: braner@batcomputer.tn.cornell.edu (braner)
Newsgroups: comp.sys.atari.st
Subject: A simple disk cache
Message-ID: <1928@batcomputer.tn.cornell.edu>
Date: Thu, 1-Jan-87 20:30:25 EST
Article-I.D.: batcompu.1928
Posted: Thu Jan 1 20:30:25 1987
Date-Received: Fri, 2-Jan-87 05:40:34 EST
Reply-To: braner@batcomputer.UUCP (braner)
Organization: Theory Center, Cornell University, Ithaca NY
Lines: 102
Summary: description, and working binary
[]
WARNING: USE AT YOU OWN RISK!
~~~~~~~ ~~~~~~~~~~~~~~~~~~~
This program seems to work, but if it ends up trashing your
disk don't blame me! Treat it for now as EXPERIMENTAL.
Here is a simple disk-cache program. It is rather conservative: it only
caches the FAT and the root directory for drives A and B. It also uses
the RAM cache for disk-reads only, all writes are done immediately.
Using it you will still need a RAM disk, but you gain 3 ways:
(1) Floppy-disk operations are slightly faster, especially when dealing
with many small files. For example, copying 11 files scattered over
a floppy (about 100K bytes) took 29 seconds, but only 21 with this
program installed - a 28% cut in the time, although still 4 times
the theoretical minimum time...
(2) Some nuisance disk-turning is avoided. For example, pressing
when a floppy's desktop window is open does not turn the disk. But
closing the window and reopening still does cause disk-turning, even
when the disk was NOT removed, due to the way TOS works and the
conservative nature of this program: it assumes the disk was removed
if the boot sector is accessed at all. Similarly, closing a folder's
window still turns the disk to reopen the underlying (root directory)
window. There is room for improvement... Things are brighter from
inside micro-C-Shell: No matter how many times you type "ls a:\"
and/or "cd a:\", interspersed with RAM-disk operations, the disk
does not turn (unless it's been removed).
(3) Most important: The FAT and the root directory are accessed very
often, and most disk-failures are in these sectors. Using this
program will avoid a lot of those accesses, and should lengthen
the life of your floppies.
To use SCACHE ('S' for simple) run it from the desktop or from the AUTO
folder. Due to the way TOS senses disk-removal, the diskette write-protect
tab has to be closed (not protected) for the cache to yield any gains.
Following is the binary (uuencoded), the source (mostly in AL) will be
e-mailed upon request.
I hope this will encourage somebody to write a REAL disk cache!
Happy New Year!!
- Moshe Braner
~~~~~~~~~~~~~~~~~~~~~~ cut here ~~~~~~~~~~~~~~~~~~~~~~~~~
begin 644 SCACHE.PRG
M8!H```B*````,@``!T@``````````````````$[Y````#$[Y```(%"I/*FT`
M!"`M``S0K0`4T*T`'-"\```A`"(`THW"O/____XN02\`+PU"9S\\`$I.0=_\
M````#"!M`!@B;0`8T^T`'"`M`!13@&\&$R!1R/_\(&T`$"`M`!Q3@$(84Y"@$YU`````````````````````````````````````")\
M```$=B!1("C_^`R`0T%#2&<*0?K^U"%1__PBB$YU3E;__$AZ_]H_/``F3KH#
M@%R/2&P``#\\``E.N@..7(]"KO_\8```!E*N__P,K@``PU#__&T`__)"9R\\
M```T`#\\`#%.N@-D4(].7DYU3G5.5@``/RX`"$ZZ`LI4CPQN@P``"&X&,#P`
M`&`>/RX`"#\\`#Y.N@,T6(\Y0/GT9P8P//__8`0P/```3EY.=4Y6```_+@`(
M/SP`3$ZZ`PY8CTY>3G5.5O_^+PM![/I")DA@%C`K``K`?``#9P@O"TZZ`"I8
MC];\`!0@"T'L^D(B"-*\```%M+"!;=@_+@`(3KK_KE2/)E].7DYU3E8``"\+
M)FX`""\+3KH`1%B/2D!G!C`\__]@,#`K``K`?``09PHO*P`&3KH!^%B/0FL`
M"C\K``Q.NO\L5(]*0&<&,#S__V`$,#P``"9?3EY.=4Y6``!(YP$0)FX`"#`K
M``K`?``#9@@P//__8```F"X3GJL`!C`K``K`?`"`9U8P*P`*P'P``F8&,#S_
M_V!V,"L`"L!\``1G$#\\``)"IS\K``Q.N@!H4(\_!R\K``8_*P`,3KH"S%"/
M#$#__V8&,#S__V!``FO_?P`*,`=(P-&K``Y@)`QK````#&\_``*+4#_]`QN``$`#F8.("[_^-"N``HM0``*8"0,
M;@`"``YF#B`N__30K@`*+4``"F`.,"X`#F<((#S_____8&(@+@`*L*[_]&\>
M2&[_\B`N``J0KO_T+P`_+@`(/SP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