home *** CD-ROM | disk | FTP | other *** search
/ Commodore Free 6 / Commodore_Free_Issue_06_2007_Commodore_Computer_Club.d64 / t.pres.2 < prev    next >
Text File  |  2023-02-26  |  15KB  |  435 lines

  1. u
  2.     Commodore Preservation Project
  3.       http://rittwage.com/c64pp
  4.  
  5. Part 2
  6.  
  7. Drive Internals The drive head, at
  8. it's lowest level, can only detect and
  9. create polarity changes in the
  10. magnetic flux on the surface of the
  11. disk, which is interpreted by the
  12. drive as a binary 0 (no change) or a 1
  13. (flux polarity change). Because of the
  14. specifics of the hardware used to
  15. access this magnetic flux, the bits
  16. stored on the disk have a couple of
  17. limitations (or "features"). This flux
  18. detection circuit feeds dual 4-bit
  19. "shifters" which convert the bits
  20. (detected from the flux changes) into
  21. a whole byte (8 bits), much like a
  22. serial port does. If this circuit
  23. detects ten '1' bits in a row, it
  24. knows that it has read a "sync". This
  25. sync is what tells the software that
  26. it's about to get a series of bytes
  27. representing either a sector header or
  28. sector data right after the sync ends.
  29. An anomaly of this circuit is that it
  30. if it runs across three or more '0'
  31. bits in a row, it will clock in an
  32. extra '1' bit on each 4-bit shifter
  33. that doesn't really exist on the disk.
  34. When this happens, the track loses
  35. framing, meaning the data is
  36. bitshifted after this due to our new
  37. phantom bit. It will shift a new
  38. phantom '1' into the LSB once in a
  39. while (and wrap it around) according
  40. to drive speed and other environmental
  41. factors until the next real '1' bit is
  42. seen. This data is "random" in the
  43. sense that the data is never the same
  44. twice due to drive speed (and
  45. humidity, temperature) fluctuations. A
  46. good example is when you try to read a
  47. new, unformatted disk. If you try
  48. this, you'll get "random" data caused
  49. by this anomaly in the drive hardware
  50. because there are no flux changes on a
  51. blank disk. To the 1541 hardware, this
  52. is all '0' bits. Because of this
  53. weakness of the hardware, all data is
  54. stored on the disk in an encoding
  55. system called "GCR". This encoding
  56. assures that there will never be more
  57. than two '0' or '1' bits in a row in
  58. the data itself. This "feature" of the
  59. '0' bits is of course taken advantage
  60. of in some later copy protection
  61. schemes. (Rapidlok, Mindscape, and
  62. Datasoft, for example) ;)
  63.  
  64. Differences between a "fast copier"
  65. and a "nibbler" Copy programs have
  66. been referred to by these two
  67. different types since the first
  68. nibblers came out on the Apple II. A
  69. little more background is required in
  70. how the disk is structured to explain
  71. the difference. A track is broken up
  72. into a number or sectors, which are
  73. further broken up into a header and
  74. data portion, and each of these has a
  75. filler "gap" at the end to give the
  76. drive software time to change modes.
  77. The actual GCR data is structured like
  78. this:  SYNC (at least 10 bits of '1'
  79. in a row)  header0 (8 bytes in DOS)
  80. header gap (usually 5 filler bytes,
  81. longer for nibbled copies) SYNC
  82. sector data 0 (CBM DOS uses 260 bytes)
  83.  tail gap (usually 5 filler bytes,
  84. longer for nibbled copies) SYNC
  85. header1... (and on until the end of
  86. the track)
  87.  
  88. Fast copiers A "fast copier" reads the
  89. source disk on a sector-by-sector,
  90. normal CBM DOS level, and recreates
  91. them onto a new formatted disk. This
  92. method produces a "clean" copy of the
  93. disk, but does not copy any protection
  94. since it will ignore any sectors with
  95. errors, or any sectors that don't
  96. conform to the format explained above.
  97. It was really only used when we
  98. weren't going to try to copy the disk
  99. protection, but rather apply a
  100. "parameter" to the disk. A "parameter"
  101. is nothing more than a patch program
  102. that was run on the backup disk to
  103. remove the check for copy protection.
  104. Fast Hack'em, Kracker Jax, and later
  105. Maverick were all very popular copy
  106. programs that utilized parameters.
  107.  
  108. Nibblers A "nibbler" works at a lower
  109. level and will duplicate the actual
  110. headers and data, whether or not they
  111. are in CBM DOS format. It does have
  112. limitations, though. First, they don't
  113. duplicate the header or tail gaps or
  114. the original sync length, but rather
  115. creates it's own, so protections that
  116. hide in the gaps or count sync lengths
  117. won't be duplicated. Secondly, the
  118. drive only only has 2k of RAM, but a
  119. whole track is up to 8k, so it must be
  120. broken down and read in several
  121. passes, then stitched together on the
  122. destination disk. Protections that
  123. exploited this would use a sector or
  124. track larger than would fit in RAM at
  125. once, making it impossible to copy.
  126. Later, there were hardware solutions
  127. to this, such as extra drive RAM and
  128. parallel ports.
  129.  
  130. Protection Methods Intentional Disk
  131. Errors This protection consists of a
  132. disk error purposefully placed on a
  133. sector or an entire track, then it's
  134. existence is checked for in the
  135. program. If the error isn't found,
  136. it's knows it's a copy. In the
  137. beginning, there were no copy programs
  138. except Jim Butterfield's "COPY/ALL"
  139. that came on the 1541 test/demo disk.
  140. This program could not reproduce these
  141. errors (and even if it could, it took
  142. *FOREVER* to copy even regular disks).
  143. Like most protection, though, it only
  144. foiled casual copiers. Early, clever
  145. crackers figured out how to scan an
  146. original disk for these and the
  147. methods for recreating the errors were
  148. not difficult. Soon after, programs
  149. like "Copy II/64" came out that could
  150. effortlessly detect and reproduce
  151. these errors which marked the end of
  152. this era. Most publishers of disk
  153. software used this method before late
  154. 1984.
  155.  
  156. Fat Tracks This protection involves
  157. placing a track on the disk that is
  158. actually 2 tracks (4 half-tracks)
  159. wide. This has two effects.
  160.  
  161. 1) The second track is invalid
  162. because Commodore DOS stores the
  163. track number as part of the track
  164. header, which is now for the wrong
  165. (previous) track.
  166.  
  167. 2) The tracks are perfectly aligned
  168. on the disk since they were written
  169. at the same time.
  170.  
  171. The protection is checked by the
  172. program by stepping the head up and
  173. down between these 2 tracks and the
  174. halftrack between them while reading
  175. the whole time. Normally, a half-track
  176. will contain a garbled combination of
  177. it's neighboring tracks. However,
  178. since these two tracks are now
  179. identical, this track should contain
  180. the same data as both of it's
  181. neighbors. If it doesn't, it knows
  182. it's a copy. Electronic Arts used this
  183. protection from about 1984-1985 and
  184. Activision used a tougher variant of
  185. it called "XEMAG 2.0" for many years.
  186. These protections stand out from most
  187. of the early protections because they
  188. could *not* be copied 100% reliably
  189. even with *any* nibbler. As mentioned
  190. earlier, the 1541 has no way to know
  191. where it is on a track. Therefore, it
  192. has no way to know where it is in
  193. comparison to any other tracks on the
  194. disk. For this reason, it is
  195. impossible to reliably write these
  196. tracks out perfectly aligned with a
  197. 1541 drive. This was an idea that was
  198. greatly expanded on in future
  199. protections, but it still stands the
  200. test of time and still can't be
  201. duplicated reliably with the best
  202. copiers that ever existed. It is of
  203. note that it *is* possible to
  204. "unreliably" copy these, as you can
  205. just try over and over again copying
  206. just these two tracks until you happen
  207. upon "close enough" alignment for it
  208. to work. The EA protection in
  209. particular relies less on the exact
  210. track alignment, so it is less
  211. difficult to copy this way. NOTE:
  212. Slowing your disk drive motor down to
  213. 298.5rpm or less seems to allow you
  214. to load a copy of any fat-track
  215. protected disk remastered with MNIB.
  216.  
  217. Half Tracks Along the same vein as
  218. fat-tracks, it was of course possible
  219. to read and write to the usually
  220. skipped "half-tracks" instead of the
  221. normal tracks, if you weren't worried
  222. about storing any data on the normal
  223. tracks. This foiled many copiers
  224. because they didn't search for and
  225. copy these half-tracks by default, so
  226. they instead got garbled, invalid
  227. mixes of the "real" data when trying
  228. to read the tracks as if they were
  229. normal. Copiers later came out that
  230. could scan for and detect these and
  231. copy them properly. I have not yet run
  232. into any disks which are known to
  233. use halftracks.
  234.  
  235. Extra Tracks This protection simply
  236. relies on using disk tracks beyond 35.
  237. Normally, copy programs default to
  238. copying only tracks 1-35, so these are
  239. missed. I am not sure why the
  240. programmers didn't extend this by
  241. default, except maybe some would lock
  242. up reading unformatted tracks, which
  243. these tracks usually are. Sometimes
  244. these tracks contained actual
  245. DOS-formatted data, but usually they
  246. were just "key" tracks, or the second
  247. part of a "fat" track from track 35.
  248. They could sometimes be nibbled, other
  249. times they could not, because they
  250. were combined with other protections.
  251.  
  252. Changed Bitrates As mentioned above,
  253. the bitrate is normally higher on the
  254. outer tracks and lower on the inner
  255. tracks. Some disks were protected by
  256. using a non-standard bitrate on
  257. different tracks. Copiers later came
  258. out that would scan for the correct
  259. density and these disks could be
  260. copied that way.
  261.  
  262. Header and Tail Gaps As mentioned
  263. above, when a disk is copied with
  264. either a fast copier or a nibbler, the
  265. gap data is not copied directly.
  266. Copiers would commonly just fill this
  267. space with 0x55 bytes. Gaps are
  268. "inert" bytes, meaning they aren't
  269. normally used as data, but just a
  270. space filler that is ignored by DOS.
  271. There are some protections that check
  272. for specific bytes here, or even the
  273. length of the gaps, and know they're a
  274. copy if it's different. This
  275. protection can be copied with hardware
  276. solutions that either extend the RAM
  277. in the drive to 8k or add a parallel
  278. port so it can read and write the
  279. entire track in one pass.
  280.  
  281. Long Sectors As mentioned above, the
  282. drive has only 2k and can't fit an
  283. entire track in RAM, so it must be
  284. broken down into 4 parts and stitched
  285. together on the destination disk. If
  286. you make a sector longer than will fit
  287. in RAM, it can't be copied with a
  288. normal 1541. This can be copied with
  289. hardware solutions that either extend
  290. the RAM in the drive to 8k or add a
  291. parallel port so it can read and
  292. write the entire track in one pass.
  293.  
  294. Custom Formats These usually depend
  295. on the long sectors trick above to be
  296. successful, but they also entail
  297. changing the way that GCR is
  298. interpreted in a custom DOS. If you
  299. write your own DOS, you can use your
  300. own disk format entirely, ignoring
  301. common sync, gap, header, and data
  302. conventions altogether and use
  303. whatever you want. You only have to
  304. adhere to the hardware limitations of
  305. sync and no more than two '0' bits in
  306. a row, but even that didn't stop later
  307. innovations. :)
  308.  
  309. Long Tracks Normal drives spin at
  310. {$fe}300rpm and can "write" data at the
  311. highest density up to about 7700 bytes
  312. per disk track. However, the drive can
  313. "read" more than that, within some
  314. margin of error depending on motor
  315. speed. Some protection took advantage
  316. of this and put more data on the track
  317. than could be written back out at the
  318. normal speed, making it difficult to
  319. copy. Some copiers would "trim" the
  320. data in as non-destructive way as
  321. possble (reducing sync length and
  322. gaps) and it was also possible to slow
  323. down the disk drive to foil this, but
  324. usually these disk relied on a
  325. combination of other protections as
  326. well. A good example of this is Harald
  327. Seeley's "V-MAX!".
  328.  
  329. Sync Counting A sync mark must be at
  330. least ten'1' bits long to signal the
  331. drive hardware that it's about to see
  332. GCR data. However, sync marks are
  333. usally much longer than this (40 bits)
  334. and have no limit to their length.
  335. When copying a disk with a software
  336. nibbler, sync has to be reproduced
  337. rather than copied, since it is more
  338. like a "signal" than actual data
  339. stored on the disk exactly. For this
  340. reason, the length of a sync is also
  341. somewhat dependent on drive speed and
  342. will vary a little. Some protections
  343. count on this and measure the lengths
  344. of the sync, or the occurances of sync
  345. on a track, to see if they match, and
  346. know they're a copy if they don't.
  347. Microprose used this method on some
  348. disks, and in fact "trimming" the sync
  349. will fail the protection checks. Track
  350. Synchronization We mentioned above
  351. that the drive doesn't use the index
  352. hole, so lining up the tracks on the
  353. disk is nearly impossible on the 1541.
  354. Since disks weren't usually mastered
  355. with a 1541, but rather with machines
  356. that could do track sync based on the
  357. index hole, protections took advantage
  358. of this in different ways. They would
  359. move to a halftrack or the next track
  360. in the middle of reading to see if the
  361. data that should be there exists. If
  362. it doesn't, it knows it's a copy.
  363.  
  364. Weak Bits/Unformatted We mentioned
  365. before that if the drive gets more
  366. than two '0' bits in a row, it clocks
  367. in a random '1' bit occasionally.
  368. Single occurances of this sequence
  369. won't always make it lose framing, it
  370. will return a "random" byte, but more
  371. than a couple in a row will result in
  372. the drive losing framing and reading
  373. these "random" bytes until it sees the
  374. next real '1' bit. Most nibblers can't
  375. duplicate this, so protections checked
  376. a byte purposefully on the disk
  377. somewhere and if it reads the same
  378. thing over and over, it knows it's a
  379. copy. Later copy programs did try to
  380. reproduce this-- Burst Nibbler detects
  381. and writes a 0x01 byte in their place,
  382. which is enough to fool most software
  383. into working. It is also worth noting
  384. that this is the same thing as
  385. unformatted tracks, so you'll see this
  386. a lot when imaging in new disks. Since
  387. the disks aren't usually duplicated on
  388. a 1541, and the tracks aren't always
  389. as long as they could be, the machine
  390. leaves unformatted data on the end of
  391. all the tracks, causing a lot of
  392. software to appear to have these on
  393. every track, and making it difficult
  394. to verify the tracks from disk to
  395. disk, since the bytes will be
  396. different from sample to sample. I
  397. have several disks from Synapse that
  398. have unformatted parts on all the
  399. tracks, and none of the tracks above
  400. 25 are formatted at all! I've seen
  401. this used in Rapidlok (all titles),
  402. later Microprose disks, and Datasoft
  403. (Bruce Lee, The Goonies, Mr. Do!)
  404.  
  405. Signature (key) Tracks This protection
  406. is seen from time to time and revolves
  407. around a track being mastered in a
  408. non-standard way. It can be all sync
  409. '1' bits (which we call a
  410. 'sync-killer' track), unformatted (or
  411. all '0' bits), filled completely with
  412. some other byte, or filled a special
  413. byte sequence like EA's PirateSlayer,
  414. or a combination of all of them. These
  415. tracks generally foil most all copy
  416. programs because they either cannot
  417. handle all or long sequences of '1' or
  418. all '0' bits, or they are just read
  419. incorrectly/out of framing. We can
  420. remaster most all of these with our
  421. development version of 'mnib'. ;)
  422.  
  423. No SYNC The meanest protection that
  424. came about used tracks on the disk
  425. that had *no* sync marks. Most copiers
  426. cannot read these tracks and most
  427. times think they're empty. The later
  428. Vorpal uses this. We believe there is
  429. a way to find the track cycle in these
  430. and reproduce them, as Maverick had
  431. custom copiers for these titles. It
  432. needs disassembled and examined.
  433.  
  434. ...end..
  435.  
  436.