home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / misc / sumkick.lzh / MULTIBOOT.DOC next >
Encoding:
Text File  |  1990-05-13  |  11.1 KB  |  347 lines

  1.             __________
  2.             Multi-Boot
  3.             ~~~~~~~~~~
  4.  
  5.  
  6. This document describes how to transform your KickStart disk into a
  7. "multi-booting" disk, that is, after loading the KickStart it will
  8. go on and boot from it like from any normal installed DOS disk.
  9.  
  10. There is already a patch available (called KickBench) that does this,
  11. but it relies on toggling your disk's ID back and forth between 'KICK'
  12. and 'DOS0'. Thus you'll have to keep a KickBench write-enabled, and
  13. write back the 'KICK' ID before switching off.
  14.  
  15. The technique described here is more convenient; After applying the
  16. patches the OS will recognize a KickStart disk as being a DOS disk.
  17. Thus, if it has a valid boot-block, a KickStart disk can be booted
  18. from, and if it has a valid root-block/bit-map files can be written
  19. to, or read from it.
  20.  
  21.  
  22.  
  23. Required:
  24. ~~~~~~~~~
  25. - Amiga 1000
  26.  
  27. - KickStart 1.3 (V 34.5)
  28.     Eventhough the absolute locations mentioned in this document
  29.     are specific to this KickStart version, similar modifications
  30.     are likely to work on other KickStarts. This is why I've made
  31.     this an in-depth discussion instead of just listing the patch
  32.     bytes.
  33.  
  34. - Mon 1.24 (by Timo Rossi, on Fish 310 or comp.bin.amiga)
  35.     This program provides us with a means of reading and writing
  36.     blocks to and from disks. It's also useful for recomputing the
  37.     checksum of the boot-block.
  38.     There are probably lots of other programs/disk-editors that
  39.     allow you to similar things, Mon however contains almost all
  40.     the options we will need in order to apply the patch.
  41.  
  42. - SumKick (by Benjamin Fuller, also on Fish 179 in the KickFont package)
  43.     This program will recompute the KickStart checksum after
  44.     you've applied the patches.
  45.     USAGE:  SumKick [DF0:|DF1:|DF2:|DF3:] [-f(ixit)]
  46.     It's included in this archive.
  47.  
  48. - TFile (by Eddy Carrol on comp.bin.amiga, also on Fish 350)
  49.     This program can be used to create a pseudo file that occupies,
  50.     and thus protects the tracks containing the KickStart data.
  51.     This program is no absolute requirement; you might hack the
  52.     bitmap yourself, or, if your boot disk only needs to mount a
  53.     network driver or harddrive, the KickStart area probably won't
  54.     even be endangered.
  55.  
  56.  
  57.  
  58. The Patches
  59. ~~~~~~~~~~~
  60.  
  61. Format an empty disk, this installs the rootblock and bitmap, required
  62. for writing files. Subsequently copy tracks 0-23 from your KickStart
  63. disk onto it. You can use TCopy (distributed together with TFile) to
  64. do this, there are, however, zillions of other utilities that can
  65. perform the same task.
  66.  
  67. Now we need to apply the patches. At six locations in the KickStart,
  68. data is compared to the 'DOS0' ID. The patches make sure that these
  69. comparisons match the 'KICK' ID as well. To do this, a few subroutines
  70. must be patched-in. Space for these subroutines can made by shortening
  71. Commodore's copyright message at the start of the KickStart code.
  72.  
  73.  
  74.  
  75. Load Mon (or whatever program you use to modify disks), and allocate
  76. some memory for disk blocks at a convenient location.
  77.  
  78. -------------------------------
  79.  
  80. Patch 1:
  81. (block 394($18A), byte $142) FF1342: 0CAD 444F5300 FFFC => 4EB9 00FC0058 4E71
  82. (block 394($18A), byte $16A) FF136A: 0CAD 444F5300 FFFC => 4EB9 00FC0058 4E71
  83.                              ^^^^^^      ^^^^^^^^^             ^^^^^^^^^
  84.                              Address     Old Bytes             New Bytes
  85.  
  86. This replaces
  87.     cmp.l    #$444F5300,-4(A5)    ; 'DOS0' ID
  88. with
  89.     jsr    $FC0058            ; Subroutine to be patched in later
  90.     nop
  91.  
  92. Note that this is a reference to an absolute location. Remapping the
  93. KickStart into RAM without a MMU won't be possible. (68010s '20s etc.
  94. do have MMUs though). Besides, I noticed some absolute references in
  95. the original KickStart, so they were there anyway.
  96.  
  97. -------------------------------
  98.  
  99. Patch 2 & 3:
  100. (block 493($1ED), byte $66) FFD866: 0CAA 444F5300 0428 => 4EB9 00FC006C 4E71
  101.  
  102. This replaces
  103.     cmp.l    #$444F5300,$428(A2)    ; 'DOS0' ID
  104. with
  105.     jsr    $FC006C            ; Subroutine to be patched in later
  106.     nop
  107.  
  108. -------------------------------
  109.  
  110. Patch 4:
  111. (block 507($1FB), byte $68) FFF468: 0CAA 444F5300 033C => 4EB9 00FC0080 4E71
  112. (block 508($1FC), byte $20) FFF620: 0CAA 444F5300 033C => 4EB9 00FC0080 4E71
  113.  
  114. This replaces
  115.     cmp.l    #$444F5300,$33C(A2)    ; 'DOS0' ID
  116. with
  117.     jsr    $FC0080            ; Subroutine to be patched in later
  118.     nop
  119.  
  120. -------------------------------
  121.  
  122. Patch 5 & 6:
  123. (block 323,($143) byte $1A4) FE85A4: 2014 B0BA FE74 => 4EB9 00FC0094
  124.  
  125. This replaces
  126.     move.l    (A4),D0            ; PC relative reference to
  127.     cmp.l    -396(PC),D0        ; 'DOS0' ID. Was hard to find.
  128. with
  129.     jsr    $FC0094            ; Subroutine to be patched in later
  130.  
  131. This one is in the boot code (the bootstrap I believe).
  132.  
  133. -------------------------------
  134.  
  135. Patch 7:
  136. (block 1, byte $55) FC0055: 20 61 6E => 0D 0A 00
  137.  
  138. This replaces
  139. "Amiga ROM Operating System and Libraries Copyright (C) 1985 etc......"
  140. with
  141. "Amiga ROM Operating System CR+LF+NULL"
  142.  
  143. Thus creating some space for our subroutines while keeping the
  144. Copyright string properly terminated.
  145.  
  146. -------------------------------
  147.  
  148. Patch 8:
  149. (block 1, byte $58) FC0058:
  150.  
  151. < 00FC0058: 64204C69 62726172 6965730D 0A436F70  'd Libraries..Cop'
  152. < 00FC0068: 79726967 68742028 43292031 3938352C  'yright (C) 1985,'
  153. < 00FC0078: 20436F6D 6D6F646F 72652D41 6D696761  ' Commodore-Amiga'
  154. < 00FC0088: 2C20496E 632E0D0A 416C6C20 52696768  ', Inc...All Righ'
  155. < 00FC0098: 74732052 65736572 7665642E 0D0A0000  'ts Reserved.....'
  156.  
  157. > 00FC0058: 0CAD444F 5300FFFC 67080CAD 4B49434B  '.¡DOS. ⁿg..¡KICK'
  158. > 00FC0068: FFFC4E75 0CAA444F 53000428 67080CAA  ' ⁿNu.¬DOS..(g..¬'
  159. > 00FC0078: 4B49434B 04284E75 0CAA444F 5300033C  'KICK.(Nu.¬DOS..<'
  160. > 00FC0088: 67080CAA 4B49434B 033C4E75 20140C80  'g..¬KICK.<Nu ...'
  161. > 00FC0098: 444F5300 67060C80 4B49434B 4E750000  'DOS.g...KICKNu..'
  162.  
  163. This patch installs the subroutines referenced in previous patches.
  164.  
  165. FC0058    cmp.l    #$444F5300,-4(A5)        ; 'DOS0' ID
  166.     beq.s    Exit1
  167.     cmp.l    #'KICK',-4(A5)
  168. Exit1    rts
  169.  
  170. FC0064    cmp.l    #$444F5300,$428(A2)        ; 'DOS0' ID
  171.     beq.s    Exit2
  172.     cmp.l    #'KICK',$428(A2)
  173. Exit2    rts
  174.  
  175. FC0080    cmp.l    #$444F5300,$33C(A2)        ; 'DOS0' ID
  176.     beq.s    Exit3
  177.     cmp.l    #'KICK',$33C(A2)
  178. Exit3    rts
  179.  
  180. FC0094    move.l    (a4),d0
  181.     cmp.l    #$444F5300,d0            ; 'DOS0' ID
  182.     beq.s    Exit4
  183.     cmp.l    #'KICK',d0
  184. Exit4    rts
  185.  
  186. -------------------------------
  187.  
  188.  
  189.  
  190.  
  191. While you're at it, you might consider patching a few other things
  192. in your KickStart.
  193.  
  194. -------------------------------
  195.  
  196. < 00FFFAE0: 113A4C2F 4469736B 2D56616C 69646174  '.:L/Disk-Validat'
  197. < 00FFFAF0: 6F720000                             'or..'
  198.  
  199. > 00FFFAE0: 104C3A44 69736B2D 56616C69 6461746F  '.L:Disk-Validato'
  200. > 00FFFAF0: 72000000                             'r...'
  201.  
  202. This one prevents the disk-validator virus from entering your system.
  203. Note that this is a BCPL string; the preceding length byte has to be
  204. modified as well.
  205.  
  206. -------------------------------
  207.  
  208. FE9668: 086B 0001 0041 => 08EB 0001 0041
  209.  
  210. This replaces
  211.     bchg    #1,$41(A3)            ; Reverse step direction
  212. with
  213.     bset    #1,$41(A3)            ; Fix step direction
  214.  
  215. The trackdisk device steps the drive head from 0 to 1 to 0 etc.
  216. This is required for sensing disk changes (don't ask me why).
  217. Modern disk drives know when the software tries to step the drive
  218. head below track 0, and will prevent it. Thus this patch will cause
  219. these drives to stop clicking.
  220. In A1000s, the internal drives are mostly very old, so this patch is
  221. unlikely to work for your internal drive. Though I haven't had any
  222. problems so far, I wonder if it is harmful; if you apply this patch,
  223. the internal drive's head will bounce (try to move below track 0).
  224.  
  225. -------------------------------
  226.  
  227. FEAF9C: B0B9 0000 8000 => 0C80 0000 8000
  228.  
  229. This replaces
  230.     cmp.l    $8000,D0            ; Obvious bug
  231. with
  232.     cmp.l    #$8000,D0            ; Added omitted #
  233.  
  234. Fixes a bug in the trackdisk device code.
  235.  
  236. -------------------------------
  237.  
  238.  
  239. Summing your KickStart
  240. ~~~~~~~~~~~~~~~~~~~~~~
  241.  
  242. Now that all patches have been installed, your KickStart's checksum
  243. needs to be recomputed. Use SumKick for this;
  244. SumKick DF?: -f
  245.  
  246. I think SumKick requires a continuous 256K Chip RAM buffer, so you'd
  247. better not be fragmented.
  248.  
  249. Perhaps now is a fine time for making a backup of your work in case
  250. something goes wrong with it later on.
  251.  
  252.  
  253.  
  254. Installing your files:
  255. ~~~~~~~~~~~~~~~~~~~~~~
  256.  
  257. You are (almost) ready to copy your files onto the shared kick/boot
  258. disk. Note though that the ID in the boot-block reads 'KICK'. Thus the
  259. KickStart currently in your A1000 won't recognize your Multi-Boot disk
  260. as being a valid writable DOS disk.
  261. You must therefore switch off your A1000, and kick from your Multi-Boot.
  262. After booting the KickStart the "Insert Workbench Disk" hand will pop
  263. into view. This is still the case because no valid boot-block has been
  264. installed yet.
  265.  
  266. Anyway, your A1000 now has the patched KickStart in its WORAM, so
  267. boot from your old boot disk to get yourself into operational mode.
  268.  
  269. If you now insert the Multi-Boot disk, DOS should recognize it as a
  270. DOS disk. You are now able to write files to it. Experiment indicates
  271. that the OFS starts writing files from track 40 downwards. The KickStart
  272. data runs from track 0 to 23, thus, if you need to copy more than say
  273. 100K of files onto the Multi-Boot disk, the first 24 tracks must be
  274. protected. TFile (mentioned in the requirements list) is perfect for this
  275. job, though there are alternatives.
  276.  
  277.  
  278.  
  279. Fixing up the boot block
  280. ~~~~~~~~~~~~~~~~~~~~~~~~
  281.  
  282. You'll need to load your disk block hacking tool again (Mon for me),
  283. and read block 0 and 1 of your MultiBoot disk into a buffer (The first
  284. 1024 bytes).
  285.  
  286. Next, put a copy of the "standard installed DOS disk" boot-block code in
  287. the buffer. This runs from location $8 to $31. You may copy it from any
  288. normal installed disk instead of typing it.
  289.  
  290. 0008: 00000370 43FA0018 4EAEFFA0 4A80670A  '...pC·..N« áJ.g.'
  291. 0018: 20402068 00167000 4E7570FF 60FA646F  ' @ h..p.Nup `·do'
  292. 0028: 732E6C69 62726172 79000000 00000000  's.library.......'
  293.  
  294. The only thing left to do is fixing the checksum of the boot-block.
  295. If you're using Mon, type:
  296. # <BootBlockBufferBaseAddres>
  297.  
  298. Now write out the boot-block to the disk.
  299.  
  300. Note that byte 512 to 1024 of the boot-block contains the first 512
  301. bytes of the KickStart data. If you've the same KickStart version
  302. I have, and have installed the patches at $FC0058 in an appropriate
  303. manner, then your boot-block's checksum should be $8BABD775.
  304.  
  305. 0000: 4B49434B 8BABD775 00000370 43FA0018  'KICK.......pC·..'
  306.         ^^^^   ^^^^^^^^
  307.          ID    CheckSum
  308.  
  309.  
  310.  
  311. Conclusion
  312. ~~~~~~~~~~
  313.  
  314. If you think this was a tedious exercise, just wait until Kick 2.0
  315. becomes available. Since it will be 512K, you'll require some fast
  316. RAM to load it. A worst case scenario might be:
  317.  
  318. - Essential libraries distributed across both 256K halves, so no
  319.   possibility of booting a lean 2.0 into your 256K WORAM and using
  320.   it to boot the additional 256K bytes. I.o.w. old KickStart needed
  321.   to boot 2,0.
  322. - 512K continuous fast RAM needed.
  323. - MMU required to map it at $F80000
  324.  
  325. This awakens visions of a Mega-Multi-Boot disk, one that first kicks
  326. 1.3, boots on into a startup-sequence which reads the kick 2.0 image
  327. into fastram, changes some vectors, and resets. Next, OS 2.0 awakens,
  328. boots from your Mega-Multi-Boot disk (because it has also been patched),
  329. and enters the same startup sequence which recognizes it is now running
  330. under OS 2.0, and therefore boots your network or hardisk driver. Yep,
  331. four boot phases from one disk :-).
  332.  
  333.  
  334. Feedback? here's me:
  335.  
  336.  
  337. UUCP:    hp4nl!neabbs!ajbrouw
  338.  
  339. or
  340.  
  341. SMAIL:    Albert-Jan Brouwer
  342.     St-Eustatiusstr. 2
  343.     2612 HA   Delft
  344.     The Netherlands
  345.  
  346. Enjoy
  347.