home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / compress / misc / compressdisk / compressdisk.doc.eng < prev    next >
Text File  |  1995-02-27  |  9KB  |  209 lines

  1.       Compressdisk.device 37.14 (release 1.0)
  2.  
  3.            by Antonio Schifano
  4.  
  5.  
  6.  1 - Introduction.
  7.  
  8. Data compression is not a novelty in the Amiga scene: since many years
  9. there are many commercial and public domain utilities that give to all
  10. Amiga users the possibility to save disk space. We can roughly divide data
  11. compressors in two main classes: the class of archivers (like ZOO, LHARC,
  12. etc.), and the class of "file oriented" compressors (like COMPRESS,
  13. POWERPACKER, IMPLODER, etc.). Archivers' main feature is their ability to
  14. preserve the files hierarchy; the price to pay is the impossibility to use
  15. archived files in the compressed form. On the contrary, file oriented
  16. compressors sacrifice this feature to achieve a better usability of
  17. compressed files: programs compressed by PowerPacker, for instance, remain
  18. executable; moreover, the package includes some useful tools (like PPMORE)
  19. that compensate for the versatility lost because of the compression (for
  20. instance, you can still read compressed text files, but you cannot edit
  21. them). Compressdisk.device tries to resolve the defects of both types of
  22. packers with a different approach to the problem.
  23.  
  24.  
  25.  
  26.  2 - What is compressdisk.device?
  27.  
  28. As its name probably suggests, it is an Exec device, similar in the way of
  29. operating to Matt Dillon's fmsdisk.device. Like that, in fact, it allows
  30. you to create virtual disks, whose tracks are saved on a file. Unlike that,
  31. however, it uses a different file for each track, and compresses the
  32. tracks. This allows you to create virtual partitions on your hard-disk,
  33. usable like normal partitions, but having the great advantage that every
  34. file you write is automatically compressed (and obviously, it is decompressed
  35. whenever you read it back).
  36.  
  37.  
  38.  
  39.  
  40.  3 -Installation.
  41.  
  42. The device can be installed only on Amigas with kickstart V37+. The
  43. installation is (almost) totally performed by the programs "CDInstall" and
  44. "CDPartition", who take care of copying all necessary files in the right
  45. directories:
  46.  
  47.  - The file "compressdisk.device" is copied in the DEVS: directory.
  48.  - For each virtual partition desired, an opportune entry is created in the
  49.    DEVS:mountlist file. If you are using Workbench V38+, all entries will
  50.    be created in the DEVS:DOSDrivers directory.
  51.  - The preference editor "CDPrefs" is copied in the SYS:Prefs directory.
  52.  
  53. For the device to work properly, you should add the following line to your
  54. s:user-startup file, just after the command SetPatch:
  55.  
  56.     assign CDISK: <directory>
  57.  
  58. where <directory> is the complete path of the directory in which you want
  59. the device to store the compressed tracks.
  60. Otherwise, the device will store the tracks in the root directory of the
  61. boot partition.
  62. Once mounted, each virtual partition must be initialized; this can be
  63. easily accomplished with the system command "format". Since the device
  64. stores only the tracks written at least once, it is advisable to use the
  65. QUICK option: this will let you save disk space and time (formatting a 40M
  66. partition can take more than thirty minutes on a standard Amiga 500).
  67. To speed up read/write operations, the device features a built-in cache in
  68. which it stores the most recently used tracks; the cache size can range
  69. from one to thirtytwo tracks. The default configuration is eight tracks per
  70. unit; from tests the device proved to be usable with four or, if you want
  71. to save your memory, even with two tracks, whereas with only one track the
  72. performance reduced significantly, expecially in writing.
  73.  
  74.  
  75.  
  76.  4 - How to use compressdisk.device.
  77.  
  78. You can use virtual partitions created with compressdisk.device like
  79. usual ones; nevertheless, it is better to follow some guidelines. First of
  80. all, it is recommendable not to write any files into any virtual partition
  81. if the device work disk (CDISK:) is full: if the device cannot store some
  82. tracks, you lose some data. Moreover, you should not use virtual partitions
  83. for storing temporary files; remember that deleting a file (on the standard
  84. file system), does not clear the blocks that it occupied (in fact, you can
  85. recover it using proper utilities), until the file system does not
  86. overwrite them. This means that when you delete a file you will NOT free
  87. any space on the device work disk. Virtual partitions created with
  88. CDPartition use the Fast File System; however you can use any file system
  89. you want. Since Standard File System and the correspondent International
  90. version reserve part of the data blocks for internal informations, they can
  91. reduce the tracks compression; for this reason their use is not
  92. recommended.
  93.  
  94.  
  95.  
  96.  5 - The compression algorithm.
  97.  
  98. The more decisive choice in the device realization was the selection of the
  99. compression algorithm: it is clear that the device performance depends
  100. tightly on the data compressor and decompressor ones. The algorithm had to
  101. be as fast as possible, to use little memory, and reasonably good at
  102. compressing. The used algorithm was ideated by Ross Williams, who named it
  103. LZRW3-A; it requires only 16K of work memory, and has an average
  104. compression of 54%. The version I wrote and optimized in assembler has a
  105. compression speed of 16K/sec and a decompression speed of 64K/sec (on a
  106. 68000 at 7.16MHz). The following table gives a rough idea of the
  107. performances, obtained by compressing two text files, an executable, a link
  108. library and a soundtracker module:
  109.  
  110.  -------------------+------------+-----------+--------+----------+----------
  111.   file            | dim. ante  | dim. post | % comp | K/sec c. | K/sec d.
  112.  -------------------+------------+-----------+--------+----------+----------
  113.   intuition.doc     |    237916     |     98950 |    58.4  |  19.07     |  84.80
  114.   dkbffp        |    144648     |     81606 |    44.6  |  13.17     |  60.36
  115.   dkb212.doc        |    157458     |     74523 |    52.7  |  17.43     |  76.12
  116.   amiga.lib        |    157880     |     43866 |    72.2  |  26.40     | 118.60
  117.   mod.trial        |    108946     |     86847 |    20.3  |   8.35     |  39.99
  118.  
  119.  
  120. For further informations about LZRW3-A refer to the original documentation
  121. given by Ross Williams (directory "pub/compression" on the FTP site
  122. sirius.itd.adelaide.edu.au [IP=129.127.40.3]).
  123.  
  124.  
  125.  
  126.  6 - Implementation.
  127.  
  128. From a technical viewpoint, compressdisk.device may look a bit strange,
  129. since it seems to break the hierarchy of the Amiga OS. In fact it is
  130. unusual for a device to use the DOS, since this one is at an higher level
  131. in the hierarchy. The hierarchy is purely functional: devices are used
  132. for management of physical resources (eventually virtual ones) and
  133. handlers for O.S. logical resources. For this reason a device is allowed
  134. to implement its primitives using a logical resource, provided that the
  135. tasks which use the device are not aware of the implementation of the
  136. primitives.
  137. The device core is a process which satisfies all I/O requests: whenever it
  138. receives a CMD_READ command, it loads and decompresses all the needed
  139. tracks; in a similar way, whenever it receives a CMD_WRITE or CMD_FORMAT
  140. command, it compresses and stores the tracks. If possible, the process uses
  141. the cache both in reading and writing: in reading, if a track is already in
  142. the cache, there is no need to reload and decompress it; in writing, tracks
  143. are compressed and stored only if there is no space left in the cache.
  144. Tracks are updated upon receiving a CMD_UPDATE command; data consistency is
  145. thus ensured. The track buffers can range from 1 to 32. Every track has 64
  146. sectors of 512 bytes each, for a total of 32K. The device needs about 60K
  147. of working memory, plus about 32K for each track buffer.
  148.  
  149. The highest cylinder number supported by the device is 65000. The largest
  150. size of a virtual partition is thus 2031.25M.
  151.  
  152.  
  153.  
  154.  7 - Acknowledgements.
  155.  
  156. I wish to thank the following people, in no particular order:
  157.  
  158.  - Raffaele Dell'Aversana, for the academic discussions prior to the
  159.    realization of the device, as well as for testing my brand new 2MB chip
  160.    ram expansion on his A500+ (still frightened of seeing your caps lock
  161.    key flashing? );
  162.  
  163.  - Ross N. Williams, for the data compression algorithm;
  164.  
  165.  - Jan van den Baard, for the (useful!) utility "GadToolsBox";
  166.  
  167.  - Giuseppe Sacco, for the utility "ZeroUno" (see the DISCLAIMER!! ;-);
  168.  
  169.  - The organizers of I.P.I.S.A. '92;
  170.  
  171.  - my sister Letizia, for no particular reason.
  172.  
  173.  
  174.  
  175.  8 - Copyright/distribution.
  176.  
  177. Compressdisk.device,  Copyright © 1992 Antonio Schifano.
  178. All rights reserved. This program is SHAREWARE; if you use it, send
  179. Lit. 15000 if you live in Italy, 20DM if you live in the European
  180. Community, or 20USD if you live somewhere else.
  181. The program can be distributed in its original archive format; can be
  182. included in collection disks of public domain software. It can also be
  183. distributed in electronic form via BBS, FTP, and similar. You may not
  184. charge more than Fred Fish does for a single library disk. Also no profit
  185. is to be made by selling this program. The commercial use and distribution
  186. of this program is NOT allowed without written permission from the author.
  187. The author cannot be held liable for any damage or data loss directly or
  188. indirectly caused by the use or misuse of this program; by deciding to use
  189. it the user assumes all the responsibilities.
  190. Suggestions, bug reports and comments are welcome.
  191.  
  192. Send the registration form to:
  193.  
  194.            Antonio Schifano
  195.            via Don Bosco, 3/28
  196.            56100 Pisa, Italy
  197. (until 31 January 1993);
  198.  
  199.            Antonio Schifano
  200.            via dell'Oca, 11
  201.            91100 Trapani, Italy
  202. (always);
  203.  
  204. The FidoNet address is: 2:332/607.666
  205.  
  206.  
  207.  
  208.  
  209.