home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / XCdRoast / xcdroast-0.96d.tar.gz / xcdroast-0.96d.tar / xcdroast-0.96d / README.ATAPI < prev    next >
Text File  |  1998-03-08  |  8KB  |  259 lines

  1.  
  2. It is possible to use X-CD-Roast with ATAPI-Writers when you follow
  3. this instructions!
  4.  
  5. Thomas Niederreiter
  6. ----------------------------------------------------------------------------
  7. This was taken out of mails from From: Dave Cohen <dcohen@richmond.infi.net>
  8. and From: Gadi Oxman <gadio@netvision.net.il>
  9. (slightly modified marked ***JS *** execpt typo corrects)
  10.  
  11. It is only valid for Linux !
  12.  
  13. Please use cdrecord-1.6a5 or later, it includes the modifications
  14. needed for ATAPI drives and is still working with other SCSI drives.
  15. If you want to use older revisions of cdrecord (not recommended)
  16. you need to apply some patches as described below.
  17.  
  18. If you use Linux Kernel version 2.1.73 and later there are no
  19. kernel patches needed to run cdrecord. If you are using a Linux
  20. kernel prior to 2.1.73 you need to apply some patches to 
  21. the  kernel souces ide.h and ide-scsi.c (see below).
  22.  
  23. In any case, you need to disable generic IDE support in order to make
  24. ATAPI SCSI emulation working.
  25.  
  26. Many people ask why I use ATAPI-SCSI emulation.
  27.  
  28.     The use of the naming convention "ATAPI-SCSI emulation" is a
  29.     litle bit missleading. It should rather be called:
  30.         "SCSI host adapter emulation"
  31.  
  32.     The ATAPI standard describes method of sending SCSI commands over IDE
  33.     with some small limitations to the "real" SCSI standard.
  34.     For this reason ATAPI-SCSI emulation is the native method of
  35.     supporting ATAPI devices.
  36.  
  37. If you have problems to talk to the device when it is jumpered as "slave"
  38. try to use it as "master".
  39.  
  40.  
  41. J÷rg Schilling <schilling@fokus.gmd.de>
  42.  
  43. --------------------------------------------------
  44. Hope that the following  is helpful to you.
  45.  
  46. I recently purchased a HP-7110i CD-RW, which is the U.S. only version of
  47. what you have. The HP 7100 and 7110  CD rewritables use the ATAPI
  48. standard. Originally, the drives were not supported under Linux (due to
  49. some inconsistencies with SCSI translations between the kernel and the
  50. CD), but that problem has just recently been fixed. There are some kernel
  51. and cdrecord patches that have been made to support this device that have
  52. yet to be officially incorporated into cdwrite and the kernel. In order to
  53. get your drive supported under Linux, you will have to do the following:
  54.  
  55. 1. Get the proper version of cdrecord.
  56.  
  57. As of this writing, I am just getting ready to test Joerg's new cdrecord.
  58. I am currently operational on cdrecord-1.5, so I know that works, and I
  59. have attached patches for that version. 
  60.  
  61. If you are in a hurry, you can download ver. 1.5, apply patches, and
  62. rock-n-roll. You may want to wait, though.  Up to you ;). The version with
  63. ATAPI support is cdrecord-1.6alpha5. I'm not sure if the current kernel
  64. patches are valid for this version, but i'll know soon enough.
  65. **** They are valid **** JS
  66.  
  67. BTW, the new version of xcdroast now supports cdrecord - this version
  68. is in beta testing, too (currently uses cdrecord-1.5 but cdrecord-1.6a5
  69. should work with the actual xcdroast too).  
  70.  
  71. 2. Upgrade to kernel version 2.0.31
  72.  
  73. IDE/SCSI translation was first added in this kernel. Because your CD-RW is
  74. an ATAPI device, it will support SCSI command sets.  The translation
  75. allows you to map the device as a SCSI generic device. This will allow
  76. cdrecord to recognize it as a SCSI device.
  77.  
  78. 3. Get the patches and apply them
  79.  
  80. Attached find kernel patches for kernel souces ide.h and ide-scsi.c, and
  81. cdrecord source scsi_cdr.c (version 1.5 only). 
  82.  
  83. 3. Recompile kernel with SCSI emulation support
  84.  
  85. If you do a "make menuconfig" or "make xconfig", select SCSI emulation
  86. under the category "Floppy, IDE, and other block devices".
  87.  
  88. WARNING:
  89. Do not install SCSI support as a module - there is a bug in the makefile
  90. structure that will cause the compile to fail.  Compile directly into the
  91. kernel.   
  92.  
  93. 4. WARNING: Disable generic IDE/ATAPI support        *** JS ***
  94.  
  95. If you don't do this, the SCSI emulation will not work  *** JS ***
  96.  
  97. Dave Cohen
  98. dcohen@richmond.infi.net 
  99. (Patch instructions below)
  100.  
  101. -----------------------------------------------------------------
  102. From: Danilo Fiorenzano <shade@juliet.gppsd.ab.ca>
  103.  
  104. Anyway, here's what I did, using kernel version 2.0.33  I believe this
  105. is the proper way to get an HP-7100i to work (and as far as I can tell,
  106. any other IDE CD-writer unit):
  107.  
  108. 1) patch the kernel as described by README.ATAPI
  109.  
  110. 2) save your current kernel config to an alternate file, then run
  111.    "make mrproper"
  112.  
  113. 3) run 'make menuconfig' or 'make xconfig', then choose "load config
  114.    from alternate file" to restore the original configuration
  115.  
  116. 4) In "Floppy, IDE and other block devices", disable "IDE/ATAPI CD-ROM
  117.    support" and enable instead "scsi emulation"
  118.  
  119. 5) in "SCSI support" enable "SCSI support", "SCSI CD-ROM support" and
  120.    "SCSI generic support", everything directly in the kernel.
  121.  
  122. 6) compile, install kernel/modules, reboot.  Now, if everything went
  123.    fine, your CDROM units should show up with a message like:
  124.  "hdb: HP CD-Writer+ 7100, ATAPI CDROM drive - enabling SCSI emulation"
  125.  
  126. 7) run "cdrecord -scanbus" to make sure cdrecord can see the unit and
  127.    talk to it.  The end.
  128.  
  129. Don't forget that now -all- of your CD drives are seen as -SCSI- units
  130. by all programs (/dev/scd0 etc.), so you might want to relink
  131. /dev/cdrom to the proper scd<n> in order to get xcdplay or whatever to
  132. work again.
  133.  
  134.  
  135.  
  136.  
  137. ----------------linux/drivers/block/ide.h----------------------
  138. 159c159
  139. < #define WAIT_CMD    (10*HZ)    /* 10sec  - maximum wait for an IRQ to happen */
  140. ---
  141. > #define WAIT_CMD    (1000*HZ)    /* 1000sec  - maximum wait for an IRQ to happen */
  142.  
  143.  
  144. ******* 400 seconds seems to be enough JS *****
  145.  
  146. ----------------linux/drivers/scsi/ide-scsi.c------------------
  147.  
  148. 162a163
  149. > #if 0
  150. 170a172
  151. > #endif
  152. 180a183
  153. > #if 0
  154. 186a190
  155. > #endif
  156. 433a438,439
  157. >     printk ("ATAPI overlap supported: %s\n",
  158. >         drive->id->capability & 0x20 ? "Yes" : "No");    
  159.  
  160.  
  161.  
  162.  
  163. -----------------------cdrecord-1.5/cdrecord/scsi_cdr----------------
  164.  
  165. If you want to use cdrecord-1.5 relpace the old functions by the following
  166. if you use cdrecord-1.6a5 you don't need this *** JS ***
  167.  
  168. EXPORT int
  169. mode_select(dp, cnt, smp, pf)
  170.     u_char    *dp;
  171.     int    cnt;
  172.     int    smp;
  173.     int    pf;
  174. {
  175.     u_char    xmode[256+4];
  176.  
  177.     movebytes(&dp[4], &xmode[8], cnt-4);
  178.     xmode[0] = 0;
  179.     xmode[1] = 0;
  180.     xmode[2] = dp[1];
  181.     xmode[3] = dp[2];
  182.     xmode[4] = 0;
  183.     xmode[5] = 0;
  184.     i_to_short(&xmode[6], dp[3]);
  185.  
  186.     fillbytes((caddr_t)&scmd, sizeof(scmd), '\0');
  187.     scmd.addr = (caddr_t)xmode;
  188.     scmd.size = cnt+4;
  189.     scmd.flags = SCG_DISRE_ENA;
  190.     scmd.cdb_len = SC_G1_CDBLEN;
  191.     scmd.sense_len = CCS_SENSE_LEN;
  192.     scmd.target = target;
  193.     scmd.cdb.g1_cdb.cmd = 0x55;
  194.     scmd.cdb.g1_cdb.lun = lun;
  195.     scmd.cdb.g0_cdb.high_addr = smp ? 1 : 0 | pf ? 0x10 : 0;
  196.     g1_cdblen(&scmd.cdb.g1_cdb, cnt+4);
  197.  
  198.     if (verbose) {
  199.         printf("%s ", smp?"Save":"Set ");
  200.         scsiprbytes("Mode Parameters", dp, cnt);
  201.     }
  202.  
  203.     return (scsicmd("mode select g1"));
  204. }
  205.  
  206. EXPORT int
  207. mode_sense(dp, cnt, page, pcf)
  208.     u_char    *dp;
  209.     int    cnt;
  210.     int    page;
  211.     int    pcf;
  212. {
  213.     u_char    xmode[256+4];
  214.     int    amt = cnt;
  215.     int    len;
  216.  
  217.     fillbytes((caddr_t)xmode, sizeof(scmd), '\0');
  218.     if (amt < 4) {
  219.         amt += 1;
  220.     } else if (amt == 4) {
  221.         amt += 3;
  222.     } else {
  223.         amt += 4;
  224.     }
  225.     fillbytes((caddr_t)&scmd, sizeof(scmd), '\0');
  226.     scmd.addr = (caddr_t)xmode;
  227.     scmd.size = 0xFF;
  228.     scmd.size = amt;
  229.     scmd.flags = SCG_RECV_DATA|SCG_DISRE_ENA;
  230.     scmd.cdb_len = SC_G1_CDBLEN;
  231.     scmd.sense_len = CCS_SENSE_LEN;
  232.     scmd.target = target;
  233.     scmd.cdb.g1_cdb.cmd = 0x5A;
  234.     scmd.cdb.g1_cdb.lun = lun;
  235. #ifdef    nonono
  236.     scmd.cdb.g0_cdb.high_addr = 1<<4;    /* DBD Disable Block desc. */
  237. #endif
  238.     scmd.cdb.g1_cdb.addr[0] = (page&0x3F) | ((pcf<<6)&0xC0);
  239.     g1_cdblen(&scmd.cdb.g1_cdb, amt);
  240.  
  241.     if (scsicmd("mode sense g1") < 0)
  242.         return (-1);
  243.  
  244.     if (verbose) scsiprbytes("Mode Sense Data", xmode, amt - scmd.resid);
  245.     amt -= scsigetresid();
  246.     movebytes(&xmode[8], &dp[4], amt-4);
  247.     len = a_to_u_short(xmode);
  248.     dp[0] = len - 3;
  249.     dp[1] = xmode[2];
  250.     dp[2] = xmode[3];
  251.     len = a_to_u_short(&xmode[6]);
  252.     dp[3] = len;
  253.  
  254.     if (verbose) scsiprbytes("Mode Sense Data", dp, cnt - scmd.resid);
  255.     return (0);
  256. }
  257.  
  258.  
  259.