home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d8xx / d803 / hackdisk.lha / Hackdisk / hackdisk.doc < prev    next >
Text File  |  1993-01-24  |  7KB  |  186 lines

  1. Hackdisk V2.00
  2.  
  3. By Dan Babcock
  4. Copyright (C) 1992 by Dan Babcock
  5.  
  6. ------------
  7. Distribution
  8. ------------
  9.  
  10. Hackdisk may be freely copied for non-commercial purposes (only).
  11.  
  12. -----------------
  13. What is Hackdisk?
  14. -----------------
  15.  
  16. Hackdisk is a complete trackdisk.device replacement (although
  17. note that the support code for 5.25 inch drives has not been
  18. tested). Support for 150RPM drives is new for V2. It works with
  19. any version of Kickstart (tested with 1.3, 2.04, and various 3.0
  20. betas).
  21.  
  22. ----------------------------
  23. What's wrong with trackdisk?
  24. ----------------------------
  25.  
  26. The standard trackdisk module works well, but it isn't perfect.
  27. My major gripe is that it doesn't offer a verify option. I used
  28. TrackSalve (a brilliant program by Dirk Reisig) before KS2.0 and
  29. received enough "verify error" messages to realize that this
  30. feature is very valuable. Hackdisk has a verify option that may
  31. be turned on or off at any time for any drive. The verify is very
  32. efficient and compares the raw MFM data bit-for-bit.
  33.  
  34. Hackdisk is faster than trackdisk 2.0. A DiskCopy to RAD: is 5
  35. seconds faster. A DiskCopy from RAD: with verify is only 1.6
  36. times slower than trackdisk, not 2 times slower like you might
  37. expect! Please note that this performance increase is gained by
  38. better programming, NOT by pushing the drive beyond its
  39. specifications.
  40.  
  41. Hackdisk requires more chip RAM for its verify buffer, but
  42. conserves memory by using one track buffer for all drives, rather
  43. than a track buffer for each drive. Experience shows that this
  44. does not hurt performance. Note: In V2, the size of chip RAM
  45. buffers has doubled to support high density drives. I decided not
  46. to dynamically adjust the buffer size for simplicity and to avoid
  47. dreaded memory fragmentation.
  48.  
  49. For programmers, Hackdisk eliminates the restrictions on
  50. read/write parameters. You can specify a read or write at any
  51. byte offset, any byte length, to/from any byte address.
  52.  
  53. -------------------
  54. Installing Hackdisk
  55. -------------------
  56.  
  57. This is where I'll probably lose most of my audience. :-)
  58.  
  59. Hackdisk is a true replacement for trackdisk.device (and is
  60. called trackdisk.device as well), not some kind of patch.
  61. (Contrary to its name, it isn't a hack at all!). This presents
  62. some difficulties, since you can't just run it from the CLI. Two
  63. major alternatives are available for installing Hackdisk:
  64.  
  65.  
  66. 1) Use the 'RamKick' utility. RamKick is a Commodore-written
  67. program to kick in an alternative OS module. It was distributed
  68. and used with V35 of the OS, which was designed to support the
  69. hires monochrome display (Hedley/Moniterm). Unfortunately, I
  70. can't distribute it with Hackdisk due to the unknown copyright
  71. status. (No copyright or author message is included in the code).
  72. Anyway, here are some hints for using RamKick:
  73.  
  74. Type "ramkick ?" to see the options. If you don't know what
  75. everything does, don't worry, because I don't either! Use the
  76. "Kick" script as an example. (Note: It doesn't matter where you
  77. put hackdisk.device, but DEVS: is a good place). The Kick script
  78. uses a tiny program called "HackDiskTest" to test whether
  79. Hackdisk is installed. It will also print out the version number
  80. and copyright. Therefore you can put this at the start of your
  81. startup-sequence to have Hackdisk loaded whenever needed. If you
  82. have an autobooting hard drive, it won't slow down booting much.
  83.  
  84. Sometimes after booting a game or demo the machine will enter a
  85. infinite reboot cycle. This is caused by RamKick or Hackdisk
  86. being partially (but not fully) corrupted. RamKick should perform
  87. more extensive checksums...
  88.  
  89. 68040 users: RamKick must be patched to call _LVOColdReboot
  90. rather than using its own (rather crude) reset method. This is
  91. quite simple to do. If you need help, email me.
  92.  
  93.  
  94. 2) Replace trackdisk.device directly in the ROM. There are many
  95. variations to this. The brute force method is to burn a new
  96. kickstart EPROM. A more viable option for those with 030/040
  97. cards is to use special software to boot up with an alternative
  98. kickstart ROM image (soft-kicked A3000s have this ability built-
  99. in). For '030 users, I believe SetCPU by Dave Haynie has such an
  100. option. I use SetFF, which is the all-purpose control utility
  101. supplied with the Fusion 40 (68040) card. OK, assuming you have
  102. the magic utility in hand that is compatible with your hardware,
  103. how does one modify the kickstart image appropriately?
  104. Unfortunately, this is going to take quite a bit of technical
  105. knowledge. I'll blithely assume you can handle it and continue:
  106.  
  107. a) Locate the starting address of trackdisk.device in the ROM.
  108. You should see "trackdisk" and some kind of date/version string.
  109. Look backwards from that for a $4AFC. That address in the very
  110. beginning of the trackdisk module. Note: An easier method is to
  111. use the E option of Xoper.
  112.  
  113. b) Either reassemble (use Macro68) Hackdisk at this absolute
  114. address or use the 'HunkWiz' utility by Christian A. Weber (you
  115. can find this utility in the BeerMon distribution) to generate
  116. the absolute-address version.
  117.  
  118. c) Insert the absolute-address Hackdisk at the proper place in
  119. the kickstart image (use the monitor of your choice...I like Mon
  120. by Timo Rossi).
  121.  
  122. d) Calculate the new ROM checksum. Sadly, I don't have a nice
  123. program prepared to do this. Here is roughly the code required
  124. (for 512K ROMs):
  125.  
  126.     MOVE.L    #$300000,A0    ;starting address of ROM image
  127. ;    MOVE.L    #$300008,A1    ;if you want to preserve old value
  128.     MOVE.L    #$37FFE8,A1    ;address of magic checksum longword
  129.     CLR.L     (A1)
  130.     MOVE.L    #$1ffff,D1
  131.     MOVEQ     #0,D0
  132. 1$:    ADD.L     (A0)+,D0
  133.     BCC.S     2$
  134.     ADDQ.L    #1,D0
  135. 2$:    DBRA        D1,1$
  136.     SUB.L    #$10000,D1
  137.     BPL.S    1$
  138.     NOT.L    D0
  139.     MOVE.L    D0,(A1)
  140.     RTS
  141.  
  142. e) If you've made it this far, congratulations. You're ready to
  143. boot with the custom kickstart.
  144.  
  145. -------------------------
  146. Turning Verify Off and On
  147. -------------------------
  148.  
  149. By default, verify is ON for all drives. You can use my QMouse
  150. utility (public domain, on a Fish disk) to change the verify
  151. state, if desired.
  152.  
  153. Programmers: The verify bit is bit 1 of TDU_PUBFLAGS.
  154.  
  155.  
  156. -----
  157. Bugs?
  158. -----
  159.  
  160. Hackdisk is 3,000 lines of assembly and a fairly intricate piece
  161. of code (see hackdisk.s) and pushes the hardware to the limit.
  162. Although I've tried my best, I only have three drives and one
  163. Amiga to test with. I can just hope it works as well for you as
  164. it does for me.
  165.  
  166. -------
  167. Credits
  168. -------
  169.  
  170. Special thanks go to the following genuine Amiga wizards:
  171.  
  172. Dirk Reisig        - for TrackSalve
  173. Sebastiano Vigna    - for SuperDuper
  174. Mike Schwartz        - for sharing his game kernel etc.
  175.  
  176. ----------
  177. My Address
  178. ----------
  179.  
  180. 6453 Sigler Road
  181. South Rockwood, MI  48179
  182. U.S.A.
  183.  
  184. I am reachable via Usenet as Dan_E_Babcock@cup.portal.com.
  185.  
  186.