home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / linux / 9274 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  12.0 KB

  1. Path: sparky!uunet!gatech!darwin.sura.net!dtix!mimsy!ra!tantalus!eric
  2. From: eric@tantalus.dell.com (Eric Youngdale)
  3. Newsgroups: comp.os.linux
  4. Subject: cdrom-0.3.tar.Z uploaded.
  5. Message-ID: <3470@ra.nrl.navy.mil>
  6. Date: 28 Aug 92 14:38:00 GMT
  7. Sender: usenet@ra.nrl.navy.mil
  8. Organization: Naval Research Laboratory
  9. Lines: 260
  10.  
  11.  
  12.     I have just uploaded cdrom-0.3.tar.Z to the incoming directory of
  13. tsx-11.mit.edu, and I imagine that Ted will move it to it's proper location
  14. sometime today.
  15.  
  16.     The main new feature is that the filesystem now supports the older
  17. High Sierra format in addition to the iso9660 format.  There are also a couple
  18. of mount options which can be used to control filename mapping and text/binary
  19. conversion.
  20.  
  21.     There was one extremely minor scsi bug that was fixed, which caused the
  22. drive to hang if there was a timeout.
  23.  
  24.     I have tested the cdrom code with the 0.97pl1 kernel.  I have not tried
  25. using the 0.97pl2 kernel, since I have been travelling too much to worry about
  26. pl2.  Linus mentioned something about a change to the follow_link in the
  27. symlink.c which would be required for pl2, but I have not gotten around to
  28. doing anything about this yet.
  29.  
  30.     There has been one report of Linux not being able to read the partition
  31. table for an extended partition on a hard disk once the cdrom patches are
  32. installed.  The person who reported this has tried backing out most of the
  33. patches, and based upon these results my current guess is that there is
  34. a general SCSI bug of some kind (other people had have difficulties
  35. with partition tables on extended partitions under other circumstances).  I
  36. would love to get a few hours on a system that has these kinds of problems,
  37. since I could probably locate and fix the bug if I were to encounter it.
  38.  
  39.     I have enclosed the README file at the end of this message.
  40.  
  41.     I will be on vacation all next week, so if I do not answer mail
  42. messages, I am not being rude.
  43.  
  44. -Eric
  45.  
  46.         ANNOUNCING - CDROM support for linux (beta 0.3).
  47.  
  48.     You must have a CDROM drive, a SCSI adapter and either a ISO9660 format
  49. disc or a High Sierra disc before this will be of any use to you.  You will
  50. also need to have the source tree for linux 0.97 kernel sources available.
  51.  
  52.     This project was a team effort.  The SCSI work was done by
  53. David Giller rafetmad@cheshire.oxy.edu, and the filesystem was written
  54. by Eric Youngdale eric@tantalus.nrl.navy.mil.  So far, the code has been
  55. tested with an aha1542 SCSI card and both NEC and Sony CDROM drives.
  56. A number of different discs have been tested.
  57.  
  58.     To install, unpack the archive in your linux kernel directory 
  59. (usually /usr/src.  This will add a number of new files to the linux
  60. source tree).  You will then need to apply the patches found in cdrom.diff
  61. with the following command:
  62.  
  63. patch -p0 < cdrom.diff
  64.  
  65. and then build the kernel.  Once you have booted the system, you will need
  66. to add a device with major=11, minor=0 for the first cdrom drive, minor=1 for
  67. the second and so forth.  You can use a command something like:
  68.  
  69.     mknod -m 500 /dev/cdrom b 11 0
  70.  
  71. To mount a disc, use a command something like:
  72.  
  73.     mount -t iso9660 /dev/cdrom /mnt
  74.  
  75. I would be interested in hearing about any successes or failures with this
  76. code.
  77.  
  78. CHANGES SINCE 0.2:
  79.  
  80.     Support has been added for the older (and somewhat obsolete) variant
  81. of the iso9660 filesystem, which is known as High Sierra.  There are apparently
  82. a number of discs still out there that are in this format, and High Sierra
  83. is not that different from iso9660, so I added support.
  84.  
  85.     Mount options have been added which can disable filename mapping,
  86. and control the conversion of text files.  The options are
  87.  
  88.     map=off
  89.     map=normal
  90.     conv=binary
  91.     conv=text
  92.     conv=mtext
  93.  
  94. The effect that these options have is described later on in this document.
  95.  
  96.     One small scsi error was fixed which would result in the driver
  97. hanging if there were an unusual error of any kind.
  98.  
  99. CHANGES SINCE 0.1:
  100.  
  101.     Error detection/correction have been improved.  You should not
  102. get any more multiply queued commands, and I increased the timeout
  103. period such that the drive no longer times out.  My drive is fairly
  104. fast, so other drives may have timeout problems.  I need to know this
  105. so that I can increase the timeout period to a workable value for all
  106. drives.  The error detection/correction should be pretty solid now.
  107.  
  108.     Support for Rock Ridge extensions has been added to the filesystem.
  109. This means:
  110.  
  111.     * Longer filenames (My implementation limits it to 256 chars).
  112.     * Mixed case filenames, Normal unix syntax availible. 
  113.     * Files have correct modes, number of links, and uid/gid
  114.     * Separate times for atime, mtime, and ctime.
  115.     * Symbolic links.
  116.     * Block and Character devices (Untested).
  117.     * Deep directories (Untested).
  118.  
  119.     I was able to implement this because Adam Richter was kind
  120. enough to lend me the Andrew Toolkit disc, which has the Rock Ridge
  121. extensions.  I should point out that the block and character devices
  122. and the deep directories have not been tested, since they do not
  123. appear on the disc that I have.  If anyone has some pre-mastering software,
  124. and could throw together a *very* small volume (i.e. one floppy disc)
  125. that has some of these things, I could use the floppy to test and debug
  126. these features.
  127.  
  128.     A single element cache was added that sits between the readdir
  129. function and the lookup function.  Many programs that traverse the
  130. directory tree (i.e. ls) also need to know the inode number and find
  131. information about the file from the inode table.  For the CDROM this
  132. is kind of silly, since all of the information is in one place, but we
  133. have to make it look kind of like unix.  Thus the readdir function
  134. returns a name, and then we do a stat, given that name and have to
  135. search the same directory again for the file that we just extracted in
  136. readdir.  On the Andrew toolkit disc, there is one directory that
  137. contains about 700 files and is nearly 80kb long - doing an ls -l in
  138. that directory takes several minutes, because each lookup has to
  139. search the directory.  Since it turns out that we often call lookup
  140. just after we read the directory, I added a one element cache to save
  141. enough information so as to eliminate the need to search the directory
  142. again.
  143.  
  144.     Scatter-gather for the cdrom is now enabled.  This should lead
  145. to slightly faster I/O.
  146.  
  147.  
  148. KNOWN PROBLEMS:
  149.  
  150.     None.
  151.  
  152.              ********************************************
  153.  
  154. Some general comments are in order:
  155.  
  156.     On some drives, there is a feature where the drive can be
  157. locked under software control to essentially deactivate the eject
  158. button.  The iso9660 filesystem activates this feature on drives so
  159. equipt, so you may be unable to remove the disc while it is mounted.
  160. The eject button will be re-enabled once the disc is dismounted.
  161.  
  162.     Since it is impossible to corrupt a CDROM, it is unlikely that
  163. a bug in the iso9660 filesystem will lead to data corruption on your
  164. hard disk, with the possible exception of files copied from the CDROM
  165. to the hard disk.  Nonetheless, it is a good idea to have a backup or
  166. your hard disk, just in case.  Then again, I really did not need to
  167. say that, did I :-)
  168.  
  169.     There were several bugs in error handling in the scsi code.
  170. Previously when a command failed, the higher level drivers would not
  171. receive the correct sense data from the failed command, or would misinterpret
  172. the data that they did get.  These has been fixed.
  173.  
  174.     Up until now, SCSI devices were either discs or tapes (and the
  175. tapes have not been fully implemented).  CDROM drives are now a third
  176. category.  There are several reasons why we do not want to treat then
  177. the same as a regular hard disk, and it was cleaner to make a third
  178. type of device.  One reason was that.....
  179.  
  180.     The CDROM has a sector size of 2048 bytes, but the buffer
  181. cache has buffer sizes of 1024 bytes.  The SCSI high level driver for
  182. the cdrom must perform buffering of all of the I/O in order to satisfy
  183. the request.  At some point in the near future support will be present
  184. in the kernel for buffers in the buffer cache which are != 1024 bytes,
  185. at which time this code will be remove.
  186.  
  187.     Both the ISO 9660 filesystem and the High Sierra are
  188. supported.  The High Sierra format is just an earlier version of
  189. ISO9660, but there are minor differences between the two.  Sometimes
  190. people use the two names interchangably, but nearly all newer discs
  191. are the ISO9660 format.
  192.  
  193.     The inode numbers for files are essentially just the byte
  194. offset of the beginning of the directory record from the start of the
  195. disc.  A disc can only hold about 660 MB, so the inode numbers will
  196. be somewhere between about 60K and 660M.   Any tool that performs
  197. a stat() on the CDROM obviously needs to be recompiled if it was
  198. compiled before 32 bit inode support was in the kernel.
  199.  
  200.     A number of ioctl functions have been provided, some of which
  201. are only of use when trying to play an audio disc.  An attempt has
  202. been made to make the ioctls compatible with the ioctls on a Sun, but
  203. we have been unable to get any of the audio functions to work.  My
  204. NEC drive and David's Sony reject all of these commands, and we currently
  205. believe that both of these drives implement the audio functions using
  206. vendor-specific command codes rather than the universal ones specified
  207. in the SCSI-II specifications.
  208.  
  209.     The filesystem has been tested under a number of conditions,
  210. and has proved to be quite reliable so far.  This filesystem is
  211. considerably simpler than a read/write filesystem (Files are
  212. contiguous, so no file allocation tables need to be maintained, there
  213. is no free space map, and we do not need to know how to rename, create
  214. or delete files).
  215.  
  216.     Text files on a CDROM can have several types of line
  217. terminators.  Lines can be terminated by LF, CRLF, or a CR.  The
  218. filesystem scans the first 1024 bytes of the file, searching for out
  219. of band characters (i.e. > 0x80 or some control characters), and if it
  220. finds these it assumes the the file is a binary format.  If there are
  221. no out of band characters the filesystem will assume that the file is
  222. a text file (keeping track of whether the lines are terminated by a
  223. CR, CRLF, or LF), and automatically converts the line terminators to a
  224. LF, which is the unix standard.  In the case of CRLF termination, the
  225. CR is converted to a ' '.  The heuristic can be explicitly overridden
  226. with the conv= mount option, which tells the filesystem that *all* files
  227. on the volume are the specified type.
  228.  
  229.  
  230.                   ***************************************
  231.                   ***************************************
  232.  
  233. The remaining comments *only* apply to discs *without* the Rock Ridge
  234. extensions:
  235.  
  236.     The find command does not work without the -noleaf switch.
  237. The reason for this is that the number of links for each directory file
  238. is not easily obtainable, so it is set to 2.  The default behavior for
  239. the find program is to look for (i_links-2) subdirectories in each
  240. directory, and it then assumes that the rest are regular files.  The
  241. -noleaf switch disables this optimization.
  242.  
  243.     The filesystem currently has the execute permission set for
  244. any non-directory file that does not have a period in its name.  This
  245. is a crude assumption for now, but it kind of works.  There is not an
  246. easy way of telling whether a file should be executable or not.
  247. Theoretically it is possible to read the file itself and check for a
  248. magic number, but this would considerably degrade performance.
  249.  
  250.     The filesystem does not support block or character devices,
  251. fifos, or symbolic links.  Also, the setuid bit is never set for any
  252. program.  The main reason for this is that there is no information in
  253. the directory entry itself which could be used to indicate these
  254. special types of files.
  255.  
  256.     Filenames under ISO9660 are normally all upper case on the
  257. disc but the filesystem maps these to all lower case.  The filenames
  258. on the disc also have a version number (like VMS) which appears at the
  259. end of the filename, and is separated from the rest of the filename by
  260. a ';' character.  The filesystem strips the version numbers from the
  261. filename if the version number is 1, and replaces the ';' by a '.' if
  262. the version number is >1.  The mount option map=off will disable all
  263. of the name mapping, and when this is in effect, all filenames will be
  264. in upper case, and the semicolons and version numbers will always appear.
  265.  
  266. eric@tantalus.nrl.navy.mil
  267. ericy@gnu.ai.mit.edu
  268. --
  269. Eric Youngdale
  270. eric@tantalus.nrl.navy.mil
  271.