home *** CD-ROM | disk | FTP | other *** search
/ Plex 6 / Plex6.mdf / u_linux / aztech05.rea < prev    next >
Encoding:
Text File  |  1994-12-28  |  16.6 KB  |  327 lines

  1. Readme-File for Aztech CD-ROM268A and ORCHID CD-3110 Driver ALPHA-Version 0.50
  2.       (for OKANO and WEARNES drives see 10.) 
  3.  
  4. 1. NOTE
  5. This software is ALPHA, thus it may contain many bugs and may even hang your
  6. machine or crash files. Therefore only real hackers, who know, what they are
  7. doing, should install it !!!
  8.  
  9. 2. INSTALLATION
  10. - Unzip/untar the file AZTECH.CDROM.Vxx.tgz (xx=version number) in the 
  11.   tmp-directory.
  12. - Rename your Mitsumi-CDROM-Driver Files mcd.c and mcd.h, they should reside 
  13.   in /usr/src/linux/drivers/block and /usr/include/linux, respectively:
  14.       cd /usr/include/linux
  15.       mv mcd.h mcd.h.MITSUMI
  16.       cd /usr/src/linux/drivers/block
  17.       mv mcd.c mcd.c.MITSUMI
  18. - Move the files azt.c and azt.h from the tmp-directory to these directories 
  19.   and create symlinks to mcd.c and mcd.h:
  20.       cd /usr/include/linux
  21.       mv /tmp/azt.h /usr/include/linux/azt.h
  22.       ln -s azt.h mcd.h
  23.       cd /usr/src/linux/drivers/block
  24.       mv /tmp/azt.c /usr/src/linux/drivers/block/azt.c
  25.       ln -s azt.c mcd.c
  26.   The AZTECH.DRIVER simply substitutes the Mitsumi-Driver, thus it is not
  27.   possible in the moment, to have both the AZTECH and the Mitsumi-Driver in
  28.   the same kernel.
  29. - Edit azt.h to set the I/O-adress to your I/O-Base adress (AZT_BASE_ADDR), 
  30.   the driver does not use interrupts or DMA, so if you are using an AZTECH
  31.   CD268 or an ORCHID CD-3110 that's the only item you have to set up. 
  32.   Users of other drives should read chapter 10. of this readme-file.
  33.   You also can configure that address by LILO boot parameter mcd=... (note:
  34.   here it is still mcd and not yet azt)
  35. - Build a new kernel, configure it for 'Mitsumi support' and include the
  36.   iso9660 filesystem. 
  37. - Activate the new kernel, normally this is done by running lilo (don't for-
  38.   get to configure it before and to keep a copy of your old kernel in case
  39.   something goes wrong!).
  40. - Reboot
  41. - You should see during boot some messages like
  42.     Aztech CD-ROM Init: DriverVersion=<version number> BaseAddress=<baseaddress>
  43.     Aztech CD-ROM Init: FirmwareVersion=<firmware version id of your I/O-card>
  44.     Aztech CD-ROM Init: End
  45.   If these messages look different, there may either be a problem with the
  46.   base adress or with the drive recognition (look in file azt.c in function
  47.   azt_init(), how I check this by issuing a ACMD_GET_VERSION command).
  48. - If you're lucky, as root you should be able to mount the drive by
  49.           mount -t iso9660 -r /dev/mcd0 /mnt
  50.   and use it as any other filesystem.
  51.  
  52. 3. MODIFICATIONS TO THE DRIVER
  53. The AZTECH-Driver is a rework of the Mitsumi-Driver. Four major items had to
  54. be reworked:
  55.  
  56. a) The Mitsumi drive does issue complete status informations acknowleding
  57. each command, the Aztech drive does only signal that the command was
  58. processed. So whenever the complete status information is needed, an extra
  59. ACMD_GET_STATUS command is issued. The handshake procedure for the drive
  60. can be found in the functions sendCmd(), sendAztCmd() and getAztStatus().
  61.  
  62. b) The Aztech Drive does not have a ACMD_GET_DISK_INFO command, so the
  63. necessary info about the number of tracks (firstTrack, lastTrack), disk
  64. length etc. has to be read from the TOC in the lead in track (see function
  65. getDiskInfo()).
  66.  
  67. c) Whenever data is read from the drive, the Mitsumi drive is started with a
  68. command to read an indefinite (0xffffff) number of sectors. When the appropriate 
  69. number of sectors is read, the drive is stopped by a ACDM_STOP command. This
  70. does not work with the Aztech drive. I did not find a way to stop it. The
  71. stop and pause commands do only work in AUDIO mode but not in DATA mode.
  72. Therefore I had to modify the 'finite state machine' in function azt_poll to
  73. only read a certain number of sectors and then start a new read on demand. As I 
  74. have not completely understood, how the buffer/caching scheme of the Mitsumi 
  75. driver was implemented, I am not sure, if I have covered all cases correctly, 
  76. whenever you get timeout messages, the bug is most likely to be in that
  77. function azt_poll() around switch(cmd) .... case ACD_S_DATA. 
  78.  
  79. d) I did not get information about changing drive mode. So I doubt, that the
  80. code around function azt_poll() case AZT_S_MODE does work. In my test I have
  81. not been able to switch to reading in raw mode. For reading raw mode, Aztech
  82. uses a different command than for cooked mode, which I haven't yet implemen-
  83. ted. On the other hand, until now I have not found a reason, why anybody should 
  84. need reading in raw mode.
  85.  
  86. 4. PROBLEMS
  87. The drive status recognition does not work correctly in all cases. Changing
  88. a disk or having the door open, when a drive is already mounted, is
  89. detected by the Aztech driver itself, but nevertheless causes multiple read
  90. attempts, which finally timeout, so you have to wait quite a little... But
  91. isn't it bad style to change a disk in a mounted drive, anyhow ?!
  92.  
  93. The driver uses busy wait in most cases for the drive handshake (macros
  94. STEN_LOW and DTEN_LOW). I tested with a 486/DX2 at 66MHz and a Pentium at
  95. 60MHz. Whenever you use a much faster machine you are likely to get timeout 
  96. messages. In that case edit azt.h and increase the timeout value AZT_TIMEOUT. 
  97.  
  98. For some 'slow' drive commands I implemented waiting with a timer waitqueue
  99. (macro STEN_LOW_WAIT). If you get this timeout message, you may also edit
  100. azt.h and increase the timeout value AZT_STATUS_DELAY. The waitqueue has
  101. shown to be a little critical. If you get kernel panic messages, edit azt.c
  102. and substitute STEN_LOW_WAIT by STEN_LOW. Busy waiting with STEN_LOW is more
  103. stable.
  104.  
  105. Note: When you compare the code of the Mitsumi and the Aztech driver,
  106. remember that variable and commands have been renamed from mcd... to azt...
  107.  
  108. 5. TEST STATUS
  109. This software has only be tested for quite a short time in some different
  110. machines. Especially the support for drives other than AZTECH CD268 V1.3 is
  111. not tested appropiately. So I'm quite sure I'll see some bug reports (see 8
  112. aand 10).
  113.  
  114. Points, where I feel that possible problems might be and all points where I 
  115. did not completely understand the drives behaviour or trust my own code are 
  116. marked with /*???*/ in the source code. There are also some points, where I 
  117. definitely did not understand the code in the Mitsumi driver. And after all, 
  118. already the Mitsumi driver is not a good example for structured software 
  119. (who uses goto-statements in C software?). This has now been fixed by Joe
  120. Nardone, who rewrote the azt_poll routine.
  121.  
  122. 6. TEST ENVIRONMENT
  123. My Aztech CD-ROM DRIVE says, that it has Firmware Version AZT26801A1.3. It
  124. came with a ISA-bus interface card and works with polled I/O without DMA and
  125. without interrupts.
  126. I tested on an AST PC with Intel 486/DX2, 8MB RAM, 340MB IDE hard disk and
  127. on an AST PC with Intel Pentium 60MHz, 16MB RAM, 520MB IDE running Linux 
  128. kernel version 1.0.9 from the LST 1.8 Distribution. The kernel was compiled 
  129. with gcc.2.5.8.
  130.  
  131. 7. ACKNOWLEDGMENTS
  132. Without the help of P.Bush, Aztech, who delivered technical information
  133. about the Aztech Drive and without the help of E.Moenkeberg, GWDG, who did a
  134. great job in disassembling and analyzing the Aztech DOS-driver, this work
  135. would not have been possible. Thanks also to Ruediger Helsch, Unifix, and to
  136. all the unknown guys, who delivered valuable technical information about
  137. CDROMs. 
  138.  
  139. Joe Nardone (nardone@clark.net) was a patient tester even for my first
  140. trial, which was more than slow, and made suggestions for code improvement.
  141. Especially the 'finite state machine' azt_poll() was rewritten by Joe to get
  142. clean C code and avoid the ugly 'gotos'.
  143.  
  144. Robby Schirmer (schirmer@fmi.uni-passau.de) tested the audio stuff (ioctls) 
  145. and suggested a lot of patches for them.
  146.  
  147. Joseph Piskor and Peter Nugent were the first users with the ORCHID CD3110
  148. and also were very patient with the problems, which occured.
  149.  
  150. Anybody, who is interested in these items should have a look at 'ftp.gwdg.de',
  151. directory 'pub/linux/cdrom' and at 'ftp.cdrom.com', directory 'pub/cdrom'.
  152.  
  153. 8. BUG REPORTS
  154. Please send detailed bug reports and bug fixes via EMail to
  155.  
  156.                   zimmerma@rz.fht-esslingen.de
  157.  
  158. I also would like to get positive feedback. Please inform me, if you have
  159. positive test results. Please include a description of the version number of
  160. the AZTECH.CDROM-driver, of your hardware and of the Linux kernel version 
  161. and tell me, with which applications you tried it.
  162.  
  163. I will try to collect the reports and make the necessary modifications from 
  164. time to time. But please note, that due to my equipment here I will not be 
  165. able to test functions in depth concerning AUDIO MODE, CD-I etc..
  166.  
  167. 9. ADD ONs
  168. You will find a tiny CD Player for audio CDs named "cdplay". It allows you
  169. to play audio CDs. You can play a specified track, pause and resume or skip 
  170. tracks forward and backwards. If you quit the program without stopping the 
  171. drive, playing is continued. You can also (mis)use cdplay to read and hexdump 
  172. data disks in raw and cooked mode.
  173.  
  174. To compile it and make it executable, do
  175.       gcc -s -O6 -L/usr/lib cdplay.c -o /usr/local/bin/cdplay  # compiles it
  176.       chmod +755 /usr/local/bin/cdplay                         # makes it executable
  177.       ln -s /dev/mcd0 /dev/cdrom                   # creates a link
  178.    (for /usr/lib substitute the top level directory, where your include files 
  179.     reside,  and for /usr/local/bin the directory, where you want the executable 
  180.     binary to reside )
  181.  
  182. You have to be ROOT in order to use it. Remember, that you should not have 
  183. /dev/mcd0 mounted, when you're playing audio CDs. 
  184.  
  185. This program is just a hack for testing the ioctl-functions in azt.c, I will 
  186. not maintain it, so if you run into problems, discard it or have a look into 
  187. the source code cdplay.c. If you get STEN_LOW or STEN_LOW error messages
  188. when using cdplay, after that, the system might not be stable any more, so
  189. you'd better reboot.
  190.  
  191. 10. OTHER DRIVES
  192. The DOS drivers of the following drives ORCHID CDS3110, OKANO CDD110 and
  193. WEARNES nearly look the same as the DOS driver for AZTECH, especially they
  194. seem to use the same command codes. So it should be simple to make the
  195. AZTECH driver work with these drives. 
  196.  
  197. Unfortuntately I do not have any of these drives available, so I can't test
  198. it. I've got some reports, that it works with ORCHID CDS3110 and a Game-Wave32
  199. sound card. In some installations, it seems necessary to initialize the
  200. drive with the DOS driver before and then do a warm boot (CTRL-ALT-RESET) or
  201. start Linux from DOS, e.g. with 'loadlin'.
  202.  
  203. Please give me positive or negative feedback, if you have tried it.
  204. Especially you should tell me, how the version string reads during
  205. initialization. If you don't succeed, read chapter 11. Thanks in advance!
  206.  
  207. Sorry for the inconvenience, but it is difficult to develop for hardware, 
  208. which you don't have available for testing. So if you like, please help me
  209. and look at 11.!
  210.  
  211. 11. IF YOU DON'T SUCCEED ... DEBUGGING
  212. Try the following
  213. -reread points 2 and 10!
  214. -make sure, that your drive is hardware configured for 
  215.     transfer mode: polled
  216.     IRQ:           not used
  217.     DMA:           not used
  218.     Base Address:  something like 300, 320 ...
  219.  You can check this, when you start the DOS driver, which came with your
  220.  drive. By appropiately configuring the drive and the DOS driver you can
  221.  check, whether your drive does operate in this mode correctly under DOS. If
  222.  it does not operate under DOS, it won't under Linux.
  223.  Make sure the Base Address is configured correctly in azt.h.
  224. -insert a CD-ROM and close the tray
  225. -cold boot your PC (i.e. via the power on switch or the reset knob)
  226. -if your start Linux via DOS, e.g. using loadlin, make sure, that the DOS
  227.  driver for the CD-ROM drive is not loaded (comment out the calling lines 
  228.  in DOS' config.sys!)
  229. -look for the azt: init message during Linux init and note them exactly
  230. -log in as root and do a mount -t iso9660 /dev/mcd0 /mnt
  231. -if you don't succeed in the first time, try several times. Try also to open
  232.  and close the tray, then mount again. Please note carefully all commands
  233.  you typed in and the azt-messages, which you get.
  234. -if you get an 'Aztech CD-ROM init: aborted' message, read the remarks about
  235.  the version string below.
  236.  
  237. If this does not help, do the same with the following differences 
  238. -start DOS before; make now sure, that the DOS driver for the CD-ROM is 
  239.  loaded under DOS (i.e. uncomment it again in config.sys)
  240. -warm boot your PC (i.e. via CTRL-ALT-DEL)
  241.  if you have it, you can also start from via loadlin (try both).
  242.  ...
  243.  Again note all commands and the azt-messages.
  244.  
  245. If you see STEN_LOW or STEN_LOW_WAIT error messages, increase the timeout
  246. values.
  247.  
  248. If this still does not help, 
  249. -look in azt.c for the lines  #if 0
  250.                               #define TEST1
  251.                               ...
  252.                               #ENDIF
  253.  and substitute '#ifdef 0' by '#if 1'.
  254. -recompile your kernel and repeat the above two procedures. You will now get 
  255.  a bundle of debugging messages from the driver. Again note your commands
  256.  and the appropriate messages. If you have syslogd running, these messages
  257.  may also be found in syslogd's kernel log file. Nevertheless in some
  258.  installations syslogd does not yet run, when Init is called, thus look for
  259.  the azt-messages during init, before the login-prompt appears.
  260.  Then look in azt.c, to find out, what happened. The normal calling sequence 
  261.  is: azt_init() during Linux bootup procedure Init
  262.  after doing a 'mount -t iso9660 /dev/mcd0 /mnt' the normal calling sequence is
  263.      azt_open()    -> Status 2c after cold reboot with CDROM or audio CD inserted
  264.                    -> Status 8  after warm reboot with CDROM inserted          
  265.                    -> Status 2e after cold reboot with no disk, closed tray
  266.                    -> Status 6e after cold reboot, mount with door open
  267.      updateToc()
  268.      GetDiskInfo()
  269.      GetQChannelInfo()   repeated several times
  270.      GetToc()
  271.      GetQChannelInfo()   repeated several times
  272.      a list of track informations
  273.      do_azt_request()  }  
  274.      azt_transfer()    } repeated several times
  275.      azt_poll          }
  276.  Check, if there is a difference in the calling sequence or the status flags!
  277.  
  278.  There are a lot of other messages, eg. the ACMD-command code (defined in
  279.  azt.h), status info from the getAztStatus-command and the state sequence of
  280.  the finite state machine in azt_poll(). The most important are the status
  281.  messages, look how they are defined and try to understand, if they make
  282.  sense in the context where they appear. With a CD-ROM inserted the status 
  283.  should always be 8, except in azt_open(). Try to open the tray, insert a
  284.  audio disk, insert no disk or reinsert the CD-ROM and check, if the status
  285.  bits change accordingly. The status bits are the most likely point, where 
  286.  the drive manufacturers may implement changes.
  287.             
  288. If you still don't succeed, a good point to start is to look in azt.c in 
  289. function azt_init, where the drive should be detected during init. Do the
  290. following:
  291. -reboot the system with boot parameter 'mcd=<your base address>,0x79'. With
  292.  parameter 0x79 most of the drive version detection is bypassed. After that 
  293.  you should see the complete version string including leading and trailing 
  294.  blanks during init. 
  295.  Now adapt the statement
  296.       if ((result[1]=='A')&&(result[2]=='Z' ...)
  297.  in azt_inti() to exactly match the first 3 or 4 letters you have seen.
  298. -Another point is the 'smart' card detection feature in azt_init(). Normally
  299.  the CD-ROM drive is ready, when azt_init is trying to read the version
  300.  string and a time consuming ACMD_SOFT_RESET command can be avoided. This is
  301.  detected by looking, if AFL_OP_OK can be read correctly. If the CD-ROM drive 
  302.  hangs in some unknown state, e.g. because of an error before a warm start or 
  303.  because you first operated under DOS, even the version string may be correct, 
  304.  but the following commands will not. Then change the code in such a way, 
  305.  that the ACMD_SOFT_RESET is issued in any case, by substituting the
  306.  if-statement 'if ( ...=AFL_OP_OK)' by 'if (1)'.
  307.  
  308. If you succeed, please mail may the exact version string of your drive and
  309. the code modifications, you have made together with a short explanation.
  310. If you don't succeed, you may mail me the output of the debugging messages.
  311. But remember, they are only useful, if they are exact and complete and you
  312. describe in detail your hardware setup and what you did (cold/warm reboot,
  313. with/without DOS, DOS-driver started/not started, which Linux-commands etc.)
  314.  
  315. 11. KNOWN BUGS
  316. AZTECH firmware versions newer than 1.3, especially 1.6:
  317. The driver was developped and tested with Aztech Firmware version 1.3 (see
  318. the azt: init message during booting). I do not have access to newer versions,
  319. but I've got a report from one user of AZTECH firmware version 1.6, that the
  320. driver did not work. May be, AZTECH has changed commands or -more likely-
  321. status flags. We're looking after that. Anybody who has a newer version than
  322. 1.3 is asked to help us!
  323.  
  324. Werner Zimmermann
  325. Fachhochschule fuer Technik Esslingen
  326. Dez 14, 1994
  327.