home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / amiga utilities / disk utilities / compression / imploderv4.0 / imploder / docs / manual < prev    next >
Encoding:
Text File  |  1997-11-21  |  13.3 KB  |  291 lines

  1. How to operate the Imploder should be fairly obvious to the average Amiga
  2. user. So I'll try to highlight only those aspects of the user interface
  3. that aren't immediately obvious, and of course this document will explain
  4. how certain selections influence the processing behaviour.
  5.  
  6.  
  7. ------------------
  8. The User Interface
  9. ------------------
  10.  
  11. ** Configuring the Imploder **
  12.  
  13. When you run the Imploder, either from the CLI or WorkBench, you'll notice
  14. the music and NTSC size screen. This setup is configurable by way of
  15. commandline switches or tooltypes. Note that, under Kick 1.3 or less, when
  16. one sets a tooltype using the WorkBench's info option, the appended "=" is
  17. required for proper recognition.
  18. The default setting is enabled music without modifications to the filter or
  19. NTSC/PAL mode. However, you can disable the music using the "NOMUSIC"
  20. commandline switch, or the "NOMUSIC=" tooltype. The lowpass filter can be
  21. disabled for less muffled sound by specifying "NOFILTER/NOFILTER=".
  22. To people with PAL Amigas, the shrunken NTSC screen might look ugly, however
  23. if there is a fat Agnus chip in your machine, it can be toggled from a 50Hz
  24. to 60Hz display refresh rate. Setting "NTSC/NTSC=" will cause the Imploder to
  25. do this whenever its screen gets upfront.
  26.  
  27. In addition to this, there's the SHORTROOT configuration switch. This
  28. option is related to using the library. See the "library" document for
  29. further information on this.
  30.  
  31.  
  32. ** The File Requester **
  33.  
  34. Whenever there exists the need to specify a filename, a directory window will
  35. appear in front of the message window. Only a few of its options need
  36. clarification:
  37. -Switching on the ID toggle gadget causes the directory window to display
  38.  the type ID's of all files. This is useful, for example, to check if files
  39.  have already been imploded. This option will increase the time needed to
  40.  access a directory though.
  41. -Clicking on the proportional scroll gadget on the left will cause the list
  42.  of filenames to be sorted.
  43. -Switching off the .INFO toggle gadget causes the directory window not to
  44.  display the *.info files used by the WorkBench's icon system. 
  45. -Selecting a file is done by placing the mouse pointer on top of its name and
  46.  clicking the left mouse button. In addition to the normal ways of confirming
  47.  your selection, you can double-click on a filename.
  48. -Next to the immediately obvious ways of scrolling through a long directory,
  49.  one can place the pointer within the filename window, press the left button,
  50.  and while holding it down move the mouse above or below the filename window,
  51.  try it; it works great once you get used to it.
  52. -One does not have to wait for the entire directory to load before selecting
  53.  a file or entering a sub directory.
  54.  
  55.  
  56. ** Keyboard Equivalents **
  57.  
  58. Many functions selectable by mouse also react to keys. The menu options have
  59. the usual right-amiga+key shortcuts. In addition to this;
  60. - Hitting any key removes the about requester displayed during startup.
  61. - Use the escape key to exit the Imploder.
  62. - The "S" key starts processing.
  63. - When the merge/compression parameter window is present, you can select
  64.   the compression mode using numeric keys, and increase/decrease the merge
  65.   threshold using the "+" and "-" keys. You can cancel using ESC and proceed
  66.   by hitting RETURN.
  67. - The deplode query requester reacts to the "Y" and "N" keys.
  68.  
  69.  
  70. ** Loading / Saving **
  71.  
  72. When you have specified a file for the Imploder to load, processing will
  73. commence (detailed below), and once finished the file requester pops up
  74. to query you for the destination.
  75.  
  76. The source and destination paths are maintained in a special way that
  77. minimizes the chance of the destination not being what one wants. You
  78. could e.g. implode files from one directory and store them in another,
  79. or overwrite them in the source directory.
  80. In the first case it would be annoying if the destination directory defaults
  81. back to the source; you'd have to change it every time you want to write an
  82. imploded file. In the latter case, it'd be annoying to change to a different
  83. source directory and find out that the destination still points somewhere
  84. else.
  85.  
  86. So the logic the Imploder uses is as follows; if you change to a different
  87. source directory, the destination directory will follow the source directory
  88. only if the destination is equal to the source.
  89.  
  90.  
  91. ** Batch Mode **
  92.  
  93. The Imploder can compress a series of executables by allowing you to specify
  94. multiple files by way of ?,#,* wildcards. All non-imploded executables
  95. matching the pattern will be processed. After entering the wildcards, the
  96. "merge and compression" parameter window will appear. The options present
  97. there will be explained below. The important thing to note here is that
  98. these selections will be global to all files processed during batch mode.
  99. Next, you'll be asked to specify a destination directory. This is were all
  100. batched executables will be saved after implosion.
  101.  
  102.  
  103. ----------
  104. Processing
  105. ----------
  106.  
  107. Now you're familiar with the user interface, let me get on with explaining
  108. how the Imploder processes programs. The implosion processing sequence
  109. consists of four steps;
  110. -Loading & Format Verification.
  111. -Hunk Merging & Reloc Table Cleanup.
  112. -Implosion.
  113. -Decompression code installation, Overlay table adjustment and Saving.
  114.  
  115.  
  116. ** The Loader **
  117.  
  118. The loader reads the selected file. During this process, the executable
  119. file is analyzed. Format defects cause the loader to either report an
  120. error, and abort processing, or to give a warning while ignoring or
  121. repairing the defect.
  122.  
  123. After having loaded a file, the "merge and compression" parameter window
  124. will appear. You can click the topright icon to collapse this window and
  125. review the status information produced by the loader.
  126.  
  127.  
  128. ** The Merger **
  129.  
  130. The merger is disabled by default. Most executables produced by modern
  131. compilers/linkers don't require this option, so if you're impatient
  132. you can skip to the next section.
  133.  
  134. If selected, the merger will try to coalesce the hunks in a program to hunks
  135. of upto the merge threshold in size. If used in a constrained manner, this
  136. will reduce the size of the program, and the chance of memory fragmentation.
  137. If you specify a large merge threshold however, the resulting file will need
  138. large contiguous regions of memory in order to load, thus reducing the chance
  139. of it being able to be loaded into a fragmented system.
  140.  
  141. Merging an executable file might break it. This is because certain programs
  142. make assumptions about the format of their segment list. The most notable
  143. members of this group are BCPL programs and a few libraries and devices.
  144. Hunk merging is therefore automatically disallowed for these. Still, some
  145. other programs, especially selfdetaching programs might dislike being merged.
  146.  
  147. Regardless of whether a program has been merged or not, a reloc table
  148. cleanup routine is executed upon the file. This deletes empty reloc tables,
  149. coalesces matching reloc tables, and finally sorts the relocation offsets.
  150. This is of no consequence to how the program will look after it has been
  151. decompressed and relocated.
  152.  
  153.  
  154. ** Compression **
  155.  
  156. The compression algorithm can operate either in turbo mode or in normal mode.
  157. The normal mode requires no additional memory, whereas the turbo mode needs
  158. some 300K of additional hashing buffers. The turbo mode kicks-in automatically
  159. whenever the required amount of additional memory can be allocated. It is
  160. about ten to twenty times faster than the normal implosion mode.
  161. Note that the parameter window will report whether or not the current memory
  162. configuration allows the turbo to be enabled or not. You might try to free a
  163. few resources in order to make the target. Whenever you select a compression
  164. mode (gadgets 0-8), the turbo capability will be reevaluated.
  165.  
  166. Various compression modes can be specified. These modes vary from zero
  167. (range  = 128 bytes) to eight (range = 18K). The range related to each
  168. compression mode determines the maximum distance searched while looking for
  169. redundant data. The higher compression modes therefore have a better chance of
  170. compressing data.
  171.  
  172. The time required to compress a program increases proportionally to the
  173. maximum distance in case of non-turbo operation. The processing speed during
  174. turbo operation however, is only slightly affected by varying the compression
  175. mode.
  176.  
  177. So it only makes sense to fiddle with the compression mode if you don't have
  178. enough memory to have the Imploder run in turbo mode, and therefore want
  179. to speed things up (at the expense of a the compression efficiency).
  180.  
  181. For all other instances it suffices to leave the compression mode at its
  182. maximum value (eight); for small executables the mode will automatically
  183. be scaled down to what the Imploder thinks is probably the most efficient
  184. one for the file at hand.
  185.  
  186. During compression, the level meters to the right will display various
  187. relevant parameters. Going from left to right these are:
  188.  
  189. 1. Percentage of program data still to be compressed.
  190. 2. New size of executable in % of the former size. Reevaluated continuously.
  191. 3. Skip. If a large chunk of non-compressable dat is encountered within
  192.    a program, its level will start to rise. When it hits the top, the
  193.    encoding limit has been exceeded. This is a rare occurance.
  194. 4. Length. Gives a measure of the redundancy of the data currently being
  195.    processed. High levels indicate good compression.
  196. 5. Distance. Gives a measure of the non-locality of current redundancy.
  197.  
  198.  
  199. ** Decompression Code Installation **
  200.  
  201. All imploded executables require some additional memory in order to be
  202. able to decompress. The additional amount of memory required is about 50%
  203. of the original program size plus a constant amount of buffer space depending
  204. on the compression mode, and never larger than 20K.
  205. After decompression this memory is freed without causing memory fragmentation.
  206. Furthermore, the normal distribution of program-data across hunks is retained.
  207. This allows for the loading of imploded files into fragmented memory, and
  208. the proper distribution of hunks across chip and fast memory.
  209.  
  210. The Imploder is able to install 3 different decompression algorithms into
  211. imploded executables;
  212. Library, Normal and Overlayed.
  213.  
  214.  
  215. LIBRARY IMPLODED files are the default, they are generated when;
  216. -The "Compress" gadget is enabled.
  217. -The "Library" gadget is enabled.
  218. -The processed executable isn't overlayed.
  219.  
  220. To be able to use library Imploded files, copy the explode.library to your
  221. LIBS: directory. When you run a library imploded program, the decompression
  222. code in this library will be called. The library code is fast and removes
  223. the need of appending decompression code to every imploded file.
  224.  
  225. The library has several special useful properties discussed in the "Library"
  226. document, but for simple use it suffices to make sure the library is in LIBS:.
  227.  
  228. Pure programs may be library imploded.
  229.  
  230.  
  231. NORMAL IMPLODED files are generated when;
  232. -The "Compress" gadget is enabled.
  233. -The "Library" gadget is disabled (this is NOT the default).
  234. -The program being processed isn't overlayed.
  235.  
  236. Normal imploded files have decompression code appended to them. A normal
  237. imploded program will run just like the original, and is independent; in
  238. contrast with library imploded files, normal imploded files don't require
  239. libraries or other special files to be present in your system.
  240.  
  241. Disadvantages of normal Imploded files are that they are a couple of hundred
  242. bytes larger than library Imploded files, and their decompression speed is
  243. significantly slower. This is due to need for space optimizations in the
  244. decompression code.
  245.  
  246. Once you normal-implode a pure program it's no longer pure.
  247.  
  248.  
  249. OVERLAYED IMPLODED files are generated when;
  250. -The "Compress" gadget is enabled.
  251. -the processed executable is overlayed.
  252.  
  253. Overlayed programs are executables with additional appended hunks that are
  254. loaded during runtime. The Imploder will automatically recognize whether a
  255. program is overlayed.
  256.  
  257. Overlayed files are rather loosely defined; basically the program is passed
  258. a bit of information that allows it to get at the appended hunks, but the
  259. means of doing so is left up to the programmer, though there is a standard
  260. technique specified by CBM which is used by the majority of overlayed
  261. executables.
  262.  
  263. Because the Imploder decreases the size of the file, the offset of the
  264. overlay data also changes, and this must be corrected for. The Imploder
  265. knows how to do this for the standard overlay format. You'll be notified
  266. when the format isn't as the Imploder expects.
  267.  
  268. Thus imploding overlayed files is not something which is guaranteed to
  269. succeed, so take heed; you should only implode overlayed files when you
  270. know what you are doing, and are willing to verify the results.
  271.  
  272.  
  273. ---------
  274. Deplosion
  275. ---------
  276.  
  277. If you select an already imploded executable for processing (the ID gadget
  278. in the directory window allows you to see if files have already been imploded,
  279. at the cost of slower listing), you will be asked if you want to deplode it.
  280. If you confirm this query, the executable will be restored to a normal
  281. non-imploded format. Note that this format isn't necessarily bitwise
  282. identical to the original; the reloc tables are sorted, and you might
  283. have applied hunk merging (which is irreversible). Also, any symbol or
  284. debug hunks present in the original will have been stripped.
  285. Still, if you run the program, things will look the same to it, and
  286. this is ofcourse what counts.
  287.  
  288. Note that there is a CLI based "Deplode" command available in the Tools
  289. directory which does basically the same thing. This is purely a matter of
  290. convenience ment for people that think of the CLI as convenient.
  291.