home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
- Documentation
-
-
- DCACHE
-
-
-
- by Atze Dijkstra
-
-
-
-
- DCACHE
-
-
- Notice: This software is shareware and may only be copied
- with all the files mentioned below together. Files
- may not be changed. Users of this package who like
- it and judge it to be worth the value of fl. 25.--
- (or equivalent, or more) and also like to see
- updates of the package, are kindly requested to send
- this amount of money to the author. Comments with
- respect to failures and possible enhancements can
- also be sent to the author and are most welcome.
-
- Disclaimer: "I make no warranty with respect to this manual,
- or the program it describes, and disclaim any
- implied/explicit suggestions of usefulness for any
- particular purpose. Use this program only if you
- are willing to assume all risks, and damages, if
- any, arising as a result, even if it is caused by
- negligence or other fault."
-
-
- DCACHE is a disk cache and as such keeps copies of
- transferred disk blocks in memory. Generally speaking, a
- cache can be a good and more flexible alternative for
- ramdisks. DCACHE is probably one of many disk caches
- available but can be configured in several ways. It's
- behaviour can also be influenced after the cache has been
- installed. In these respects it differs from other caches.
-
- When you are reading this, you should have the following
- files:
-
- DCACHE.TTP : disk cache
- DCACHA.ACC : disk cache manipulation accesory
- DCACHE.DOC : this file
-
- DCACHE executes commands when it is invoked. These commands
- may either be specified as arguments on a command line from
- a shell, or, if not specified in this way, they will be read
-
-
- DCACHE V1.0f - 1 - 19 June 1988
-
-
-
-
-
- from the file DCACHE.INF or \AUTO\DCACHE.INF. If DCACHE.TTP
- is renamed to DCACHE.PRG and put in the \AUTO folder the
- cache it will automatically be started and configured using
- the DCACHE.INF file. If DCACHE does not make a cache it
- will exit like a normal program, otherwise it will stay
- resident and consume some memory for the cache. After the
- caches have been created several commands may be applied to
- them. Commands which influence options do not have effect
- on the existence of the cache, but commands like 'remove'
- and 'quit' are irreversible.
-
-
- DCACHE.TTP accepts commands which follow the following
- syntax:
-
- /* SEQ: sequence, repetition. OPT: optional */
- <commands-sequence> :: <commands> LIST <blanks>
- <blanks> :: <blank> SEQ
- <blank> :: space, tab, newline
- <commands> :: <driveset> '=' <cmds>
- <driveset> :: <driveletter> SEQ OPT
- <driveletter> :: letter in the range 'a'..'p'
- <cmds> :: <cmd> SEQ OPT
- <cmd> :: <letter> <param> OPT
- <param> :: integer
-
- Commands have two parts: a sequence of single letter
- commands and a set of drives to which these commands apply.
- However, if the <driveset> is empty the commands will apply
- to all drives. The following commands are implemented:
-
- c<size>: Create cache of <size> Kb. Only allowed during
- initialization.
-
- m<size>: Only requests for contiguous blocks smaller
- than <size> are cached. Default is half the
- size of the cache. Smaller values prohibit the
- removal of small, more often used, pieces of
- cached disk (by large, contiguous blocks).
-
- w, W: Disable resp. enable writethrough of write
- requests to disk. Default is W. If W is invoked
- all entries are flushed.
-
- b<size>: <size> Kb. are reserved to optimize flushes to
- disk. This buffer is used for all caches and is
- not used for the specified driveset only. See
- also remarks on writethrough. Only allowed
- during initialization.
-
- f: Flush contents of unwritten cache entries.
-
-
-
- DCACHE V1.0f - 2 - 19 June 1988
-
-
-
-
-
- i: Invalidate, i.e. first flush, then remove all entries
- from the administration.
-
- r: Remove cache, i.e. first invalidate and then remove
- caching. If no cache is left, the caching
- routine will be removed from the system. All
- these actions are irreversible.
-
- q: Quit cache, i.e. remove all caches, regardless of
- which driveset is specified. Memory used for
- the cache is not returned to the system (due to
- the (non)structure of Atari ST's memory
- management).
-
- s, S: Stop resp. continue cache usage, first invalidate,
- then mark as out of use until continuation.
- Default is S.
-
-
- Some examples:
-
- a=c100: Create cache of 100Kb on drive a.
-
- ac=c100w: Create a cache of 100Kb for both a and c.
- Written entries are not immediately written
- through.
-
- a=c20 c=c200: Create seperate caches for a and c.
-
- =i: Invalidate caches for all drives.
-
-
- All the abovementioned commands, except 'c' and 'b' can also
- be executed from the desktop if the deskaccessory DCACHA.ACC
- is installed. Though the accessory provides the same set of
- commands, it is more convenient to use if one is using the
- desktop only. It also offers the possibility to get some
- information about the cache: is the drive mounted, cached
- and if so, what are the sizes (in Kb) and what are the
- number of cached and unflushed entries (in sectors). If it
- fails to access the installed cache handler for information
- the accessory will come with a message concerning the fact
- that the cache is not installed. Commands will be executed
- if selected and a set of drives has been specified and the OK
- button is selected.
-
- One is advised to invalidate a drive before putting another
- disk in it. See also the remarks on writethrough for the
- risks involved in using non-writethroug mode.
-
-
- IMPLEMENTATION
-
-
- DCACHE V1.0f - 3 - 19 June 1988
-
-
-
-
-
- In order to be able to cache, the vector which is used by
- the BIOS routine Rwabs (read/write sector from/to a disk) is
- replaced by DCACHE with a caching read/write routine, the
- old routine is used for requests which cannot be satisfied
- by the cache itself. Other packages might also do this
- (e.g. the shell I normally work with), so be aware of the
- possible interactions with other stuff running on your
- machine. Drives 'a' and 'b' can also be accessed via some
- other 'Extended BIOS' routines and circumvent the cache in
- this way. GEMDOS doesn't seem to use these routines, other
- packages (Disk copiers ?) may.
-
- Changes to the settings of the cache are accomplished by
- calling Rwabs with some parameters for a non-existing
- drive. This command acts as some kind of an escape
- mechanism or UNIX IOctrl call.
-
- The entries will be removed in a LRU order, searching takes
- place by hashing, so is reasonably fast.
-
- DCACHE has been tested on an Atari 1040ST with hard disk, I
- don't know if it will work on Mega ST's.
-
-
- TO WRITETHROUGH OR NOT TO WRITETHROUGH
-
-
- The possibility to delay writes can have some funny
- aspects. If you remove your floppy while unwritten entries
- are still in the cache, this can give you a corrupted disk.
- The nice thing however, is that copying and deletion to/from
- floppy can sometimes go fast. The catch in this case lies
- in the fact that if a file is copied to a disk configured
- for non-writethrough and deleted afterwards, still has
- entries in the cache which correspond to data once written
- to the disk. This facility is therefore the most useful if
- lots of copies en deletes take place and the sectors are
- re-used before flushed to disk.
-
- Flushed and unflushed entries are kept in seperate queues
- and entries which are dirty are only flushed when the queue
- containing unflushed entries is full. If this is the case,
- all unflushed entries are written to disk, just as if a
- flush command has been given. This writing can be speeded
- up a little by allocating a buffer with the 'b' command at
- initialization, which will be used to put consecutive
- unflushed sectors in and write them with one write command
- to disk.
-
- In any case: know the risks involved when you have turned
- off writethrough !!
-
-
-
- DCACHE V1.0f - 4 - 19 June 1988
-
-
-
-
-
- SPEED
-
-
- I ran several small tests on my harddisk (SH204), cache
- installed in writethrough mode, size 300Kb and achieved a
- speedup of approx. 1.5 with the startup of my shell and 1st
- wordplus compared to a situation without a cache at all. On
- a floppy drive only system speed up was far more and I think
- DCACHE to be a good alternative for a ramdisk.
-
-
- REMARKS & KNOWN BUGS
-
-
- If DCACHE is executed from the desktop, the desktop will
- convert all characters to uppercase, which will then be
- misinterpreted by DCACHE.
-
- DCACHE will only read the first 128 bytes from the file
- DCACHE.INF. Comments are not implemented.
-
- Non writethrough is not really supported. The cache should
- be reset-resistant and/or should flush now and then some
- unflushed entries.
-
- It is not taken into account whether a drive is mounted or
- not.
-
- If a floppy is write protected a possible mediachange is
- detected. This will cause the cache to try to find out if
- another floppy has been put in by reading from the floppy.
- This costs extra time, so if you want to have full profit,
- use your floppies without write protection.
-
- Disk changing while still having unwritten cacheentries
- should give some error messages or prompts.
-
- For reasons yet unclear the 'info' menu entry from the
- desktop reads from disk into a buffer with address 0 (yes,
- it's true !). A check on this situation is build in but ..?
- .
-
- DCACHE was written with Mark Williams C.
-
-
- AUTHOR
-
-
- Atze Dijkstra
- private: Pr. Irenelaan 37
- 3832 CA Leusden-Z
- The Netherlands
-
-
- DCACHE V1.0f - 5 - 19 June 1988
-
-
-
-
-
- work: Dept. of Computer Science
- State University of Utrecht
- P.O. Box 80.089
- 3508 TB Utrecht.
- UUCP: .. mcvax!ruuinf!atze
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DCACHE V1.0f - 6 - 19 June 1988
-
-