home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 2 / CD ACTUAL VOL 2.iso / docs / kernel.13 / readme.ide < prev    next >
Encoding:
Text File  |  1995-09-10  |  16.9 KB  |  362 lines

  1. README.ide -- Information regarding ide.c and ide-cd.c (IDE driver in 1.3.x)
  2. ================================================================================
  3. Supported by:  mlord@bnr.ca           -- disks, interfaces, probing
  4.                snyder@fnald0.fnal.gov -- cdroms, ATAPI, audio
  5.  
  6. (see description later on below for handling BIG IDE drives with >1024 cyls).
  7.  
  8. Major features of ide.c & ide-cd.c:
  9.  
  10. NEW!    - support for up to *four* IDE interfaces on one or more IRQs
  11. NEW!    - support for any mix of up to *eight* disk and/or cdrom drives
  12.     - support for reading IDE ATAPI cdrom drives (NEC,MITSUMI,VERTOS,SONY)
  13.     - support for audio functions
  14.     - auto-detection of interfaces, drives, IRQs, and disk geometries
  15.         - "single" drives should be jumpered as "master", not "slave"
  16. NEW!          (both are now probed for)
  17.     - support for BIOSs which report "more than 16 heads" on disk drives
  18.     - uses LBA (slightly faster) on disk drives which support it
  19.     - support for lots of fancy (E)IDE drive functions with hdparm utility
  20.     - optional (compile time) support for 32-bit VLB data transfers
  21.     - support for IDE multiple (block) mode (same as hd.c)
  22.     - support for interrupt unmasking during I/O (better than hd.c)
  23.     - improved handshaking and error detection/recovery
  24.     - can co-exist with hd.c controlling the first interface
  25.     - support for reliable operation of buggy CMD-640 interfaces
  26. NEW!        - use kernel command line option:   ide1=serialize
  27.     - experimental support for DTC-2278D interfaces
  28. NEW!        - use kernel command line option:   ide1=dtc2278
  29.     - run-time selectable 32bit interface support (using hdparm-2.3)
  30.  
  31. NEW!    - support for drives with a stuck WRERR_STAT bit
  32. NEW!    - support for removeable devices, including door lock/unlock
  33.  
  34. NEW!    - transparent support for DiskManager 6.0x and "Dynamic Disk Overlay"
  35. NEW!        - should work for for EZ-Drive disks as well (not verified)
  36.         - works with Linux fdisk, LILO, loadlin, bootln, etc..
  37. NEW!    - ide-cd.c now compiles separate from ide.c
  38.  
  39. For a list of work underway, see the comments near the top of ide.c and ide-cd.c
  40.  
  41. ***
  42.  
  43. IMPORTANT NOTICE:  "CMD" EIDE Interfaces will not (by default) work *reliably*
  44. when drives are attached to the second interface.  To "fix" this, supply the
  45. special kernel "command line" parameter to LILO:    ide1=serialize
  46. Failure to do so can cause severe data corruption!
  47.  
  48. ***
  49.  
  50. To access devices on the 2nd/3rd/4th interfaces, device entries must first be
  51. created in /dev for them.  To create such entries, simply run the included
  52. shell script:   MAKEDEV.ide
  53.  
  54. Apparently many releases of Slackware 2.2/2.3 have incorrect entries
  55. in /dev for hdc* and hdd* -- this can also be corrected by running MAKEDEV.ide
  56.  
  57. ide.c automatically probes for the primary and secondary interfaces,
  58. for the drives/geometries attached to those interfaces, and for the
  59. IRQ numbers being used by the interfaces (normally IRQ14 & IRQ15).
  60.  
  61. Interfaces beyond the first two are not normally probed for, but may be
  62. specified using kernel "command line" options.  For example,
  63.  
  64.     ide3=0x1e8,0x3f0,11    /* ioports 0x1e8-0x1ef,0x3f0, irq 11 */
  65.  
  66. Normally the irq number need not be specified, as ide.c will probe for it:
  67.  
  68.     ide3=0x1e8,0x3f0    /* ioports 0x1e8-0x1ef,0x3f0 */
  69.  
  70. Any number of interfaces may share a single IRQ if necessary, at a slight
  71. performance penalty, whether on separate cards or a single VLB card.
  72. The IDE driver automatically detects and handles this.  However, this may
  73. or may not be harmful to your hardware.. two or more cards driving the same IRQ
  74. can potentially burn each other's bus driver, though in practice this
  75. seldom occurs.  Be careful, and if in doubt, don't do it!
  76.  
  77. Drives are normally found by auto-probing and/or examining the CMOS/BIOS data.
  78. For really weird situations, the apparent (fdisk) geometry can also be specified
  79. on the kernel "command line" using LILO.  The format of such lines is:   
  80.  
  81.     hdx=cyls,heads,sects,wpcom,irq
  82. or    hdx=cdrom
  83.  
  84. where hdx can be any of hda through hdh, Three values are required
  85. (cyls,heads,sects).  For example:
  86.  
  87.     hdc=1050,32,64  hdd=cdrom
  88.  
  89. either {hda,hdb} or {hdc,hdd}.  The results of successful auto-probing may
  90. override the physical geometry/irq specified, though the "original" geometry
  91. may be retained as the "logical" geometry for partitioning purposes (fdisk).
  92.  
  93. If the auto-probing during boot time confuses a drive (ie. the drive works
  94. with hd.c but not with ide.c), then an command line option may be specified
  95. for each drive for which you'd like the drive to skip the hardware
  96. probe/identification sequence.  For example:
  97.  
  98.     hdb=noprobe
  99. or
  100.     hdc=768,16,32
  101.     hdc=noprobe
  102.  
  103. Note that when only one IDE device is attached to an interface,
  104. it should be jumpered as "single" or "master", *not* "slave".
  105. Many folks have had "trouble" with cdroms because of this requirement,
  106. so ide.c now probes for both units, though success is more likely
  107. when the drive is jumpered correctly.
  108.  
  109. Courtesy of Scott Snyder, the driver supports ATAPI cdrom drives
  110. such as the NEC-260 and the new MITSUMI triple/quad speed drives.
  111. Such drives will be identified at boot time, just like a harddisk.
  112.  
  113. If for some reason your cdrom drive is *not* found at boot time, you can force
  114. the probe to look harder by supplying a kernel command line parameter
  115. via LILO, such as:
  116.  
  117.     hdc=cdrom    /* hdc = "master" on second interface */
  118. or
  119.     hdd=cdrom    /* hdd = "slave" on second interface */
  120.  
  121. For example, a GW2000 system might have a harddrive on the primary
  122. interface (/dev/hda) and an IDE cdrom drive on the secondary interface
  123. (/dev/hdc).  To mount a CD in the cdrom drive, one would use something like:
  124.  
  125.     ln -sf /dev/hdc /dev/cdrom
  126.     mkdir /cd
  127.     mount /dev/cdrom /cd -t iso9660 -o ro
  128.  
  129. The kernel is able to execute binaries directly off of the cdrom,
  130. provided it is mounted with the default block size of 1024 (as above).
  131.  
  132. Please pass on any feedback on the cdrom stuff to the author & maintainer,
  133. Scott Snyder (snyder@fnald0.fnal.gov).
  134.  
  135. Note that if BOTH hd.c and ide.c are configured into the kernel,
  136. hd.c will normally be allowed to control the primary IDE interface.
  137. This is useful for older hardware that may be incompatible with ide.c,
  138. and still allows newer hardware to run on the 2nd/3rd/4th IDE ports
  139. under control of ide.c.   To have ide.c also "take over" the primary
  140. IDE port in this situation, use the "command line" parameter:  ide0=0x1f0
  141.  
  142. The hdparm.c program for controlling various IDE features is now packaged
  143. separately.  Look for it on popular linux FTP sites.
  144.  
  145. mlord@bnr.ca
  146. snyder@fnald0.fnal.gov
  147. ================================================================================
  148.  
  149. Summary of ide driver parameters for kernel "command line":
  150. ----------------------------------------------------------
  151.  
  152.   "hdx="  is recognized for all "x" from "a" to "h", such as "hdc".
  153.   "idex=" is recognized for all "x" from "0" to "3", such as "ide1".
  154.  
  155.   "hdx=noprobe"        : drive may be present, but do not probe for it
  156.   "hdx=nowerr"        : ignore the WRERR_STAT bit on this drive
  157.   "hdx=cdrom"        : drive is present, and is a cdrom drive
  158.   "hdx=cyl,head,sect"    : disk drive is present, with specified geometry
  159.  
  160.   "idex=noprobe"    : do not attempt to access/use this interface
  161.   "idex=base"        : probe for an interface at the addr specified,
  162.                                 where "base" is usually 0x1f0 or 0x170
  163.                                 and "ctl" is assumed to be "base"+0x206
  164.                 and "irq" will be probed for
  165.   "idex=base,ctl"    : specify both base and ctl
  166.   "idex=base,ctl,irq"    : specify base, ctl, and irq number
  167.  
  168. The following two are valid ONLY on ide0 or ide1:
  169.  
  170.   "idex=dtc2278"    : look for and try to initialize a dtc2278
  171.   "idex=serialize"    : do not overlap operations on ide0 and ide1.
  172.  
  173. Everything else is rejected with a "BAD OPTION" message.
  174.  
  175. ================================================================================
  176.  
  177. Some Terminology
  178. ----------------
  179. IDE = Integrated Drive Electronics, meaning that each drive has a built-in
  180. controller, which is why an "IDE interface card" is not a "controller card".
  181.  
  182. IDE drives are designed to attach almost directly to the ISA bus of an AT-style
  183. computer.  The typical IDE interface card merely provides I/O port address
  184. decoding and tri-state buffers, although several newer localbus cards go much
  185. beyond the basics.  When purchasing a localbus IDE interface, avoid cards with
  186. an onboard BIOS and those which require special drivers.  Instead, look for a
  187. card which uses hardware switches/jumpers to select the interface timing speed,
  188. to allow much faster data transfers than the original 8Mhz ISA bus allows.
  189.  
  190. ATA = AT (the old IBM 286 computer) Attachment Interface, a draft American
  191. National Standard for connecting hard drives to PCs.  This is the official
  192. name for "IDE".
  193.  
  194. The latest standards define some enhancements, known as the ATA-2 spec,
  195. which grew out of vendor-specific "Enhanced IDE" (EIDE) implementations.
  196.  
  197. ATAPI = ATA Packet Interface, a new protocol for controlling the drives,
  198. similar to SCSI protocols, created at the same time as the ATA2 standard.
  199. ATAPI is currently used for controlling CDROM and TAPE devices, and will
  200. likely also soon be used for Floppy drives, removable R/W cartridges,
  201. and for high capacity hard disk drives.
  202.  
  203. How To Use *Big* ATA/IDE drives with Linux
  204. ------------------------------------------
  205. The ATA Interface spec for IDE disk drives allows a total of 28 bits
  206. (8 bits for sector, 16 bits for cylinder, and 4 bits for head) for addressing
  207. individual disk sectors of 512 bytes each (in "Linear Block Address" (LBA)
  208. mode, there is still only a total of 28 bits available in the hardware).
  209. This "limits" the capacity of an IDE drive to no more than 128GB (Giga-bytes).
  210. All current day IDE drives are somewhat smaller than this upper limit, and
  211. within a few years, ATAPI disk drives will raise the limit considerably.
  212.  
  213. All IDE disk drives "suffer" from a "16-heads" limitation:  the hardware has
  214. only a four bit field for head selection, restricting the number of "physical"
  215. heads to 16 or less.  Since the BIOS usually has a 63 sectors/track limit,
  216. this means that all IDE drivers larger than 504MB (528Meg) must use a "physical"
  217. geometry with more than 1024 cylinders.
  218.  
  219.    (1024cyls * 16heads * 63sects * 512bytes/sector) / (1024 * 1024) == 504MB
  220.  
  221. (Some BIOSs (and controllers with onboard BIOS) pretend to allow "32" or "64"
  222.  heads per drive (discussed below), but can only do so by playing games with
  223.  the real (hidden) geometry, which is always limited to 16 or fewer heads).
  224.  
  225. This presents two problems to most systems:
  226.  
  227.     1. The INT13 interface to the BIOS only allows 10-bits for cylinder
  228.     addresses, giving a limit of 1024cyls for programs which use it.
  229.  
  230.     2. The physical geometry fields of the disk partition table only
  231.     allow 10-bits for cylinder addresses, giving a similar limit of 1024
  232.     cyls for operating systems that do not use the "sector count" fields
  233.     instead of the physical Cyl/Head/Sect (CHS) geometry fields.
  234.  
  235. Neither of these limitations affects Linux itself, as it (1) does not use the
  236. BIOS for disk access, and it (2) is clever enough to use the "sector count"
  237. fields of the partition table instead of the physical CHS geometry fields.
  238.  
  239.     a) Most folks use LILO to load linux.  LILO uses the INT13 interface
  240.     to the BIOS to load the kernel at boot time.  Therefore, LILO can only
  241.     load linux if the files it needs (usually just the kernel images) are
  242.     located below the magic 1024 cylinder "boundary" (more on this later).
  243.  
  244.     b) Many folks also like to have bootable DOS partitions on their
  245.     drive(s).  DOS also uses the INT13 interface to the BIOS, not only
  246.     for booting, but also for operation after booting.  Therefore, DOS
  247.     can normally only access partitions which are contained entirely below
  248.     the magic 1024 cylinder "boundary".
  249.  
  250. There are at least seven commonly used schemes for kludging DOS to work
  251. around this "limitation".  In the long term, the problem is being solved
  252. by introduction of an alternative BIOS interface that does not have the
  253. same limitations as the INT13 interface.  New versions of DOS are expected
  254. to detect and use this interface in systems whose BIOS provides it.
  255.  
  256. But in the present day, alternative solutions are necessary.
  257.  
  258. The most popular solution in newer systems is to have the BIOS shift bits
  259. between the cylinder and head number fields.  This is activated by entering
  260. a translated logical geometry into the BIOS/CMOS setup for the drive.
  261. Thus, if the drive has a geometry of 2100/16/63 (CHS), then the BIOS could
  262. present a "logical" geometry of 525/64/63 by "shifting" two bits from the
  263. cylinder number into the head number field for purposes of the partition table,
  264. CMOS setup, and INT13 interfaces.  Linux kernels 1.1.39 and higher detect and
  265. "handle" this translation automatically, making this a rather painless solution
  266. for the 1024 cyls problem.  If for some reason Linux gets confused (unlikely),
  267. then use the kernel command line parameters to pass the *logical* geometry,
  268. as in:  hda=525,64,63
  269.  
  270. If the BIOS does not support this form of drive translation, then several
  271. options remain, listed below in inverse order of popularity:
  272.  
  273.     - boot from a floppy disk instead of the hard drive (takes 10 seconds).
  274.     - use a partition below the 1024 cyl boundary to hold the linux
  275.     boot files (kernel images and /boot directory), and place the rest
  276.     of linux anywhere else on the drive.  These files can reside in a DOS
  277.     partition, or in a tailor-made linux boot partition.
  278.  
  279. If you cannot use drive translation, *and* your BIOS also restricts you to
  280. entering no more than 1024 cylinders in the geometry field in the CMOS setup,
  281. then just set it to 1024.  As of v3.5 of this driver, Linux automatically
  282. determines the *real* number of cylinders for fdisk to use, allowing easy
  283. access to the full disk capacity without having to fiddle around.
  284.  
  285. Regardless of what you do, all DOS partitions *must* be contained entirely
  286. within the first 1024 logical cylinders.  For a 1Gig WD disk drive, here's
  287. a good "half and half" partitioning scheme to start with:
  288.  
  289.     geometry = 2100/16/63
  290.     /dev/hda1 from cyl    1 to  992        dos
  291.     /dev/hda2 from cyl  993 to 1023        swap
  292.     /dev/hda3 from cyl 1024 to 2100        linux
  293.  
  294. To ensure that LILO can boot linux, the boot files (kernel and /boot/*)
  295. must reside within the first 1024 cylinders of the drive.  If your linux
  296. root partition is *not* completely within the first 1024 cyls (quite common),
  297. then you can use LILO to boot linux from files on your DOS partition
  298. by doing the following after installing slackware (or whatever):
  299.  
  300.     0. Boot from the "boot floppy" created during the installation
  301.         1. Mount your DOS partition as /dos (and stick it in /etc/fstab)
  302.         2. Move your kernel (/vmlinuz) to /dos/vmlinuz with:  mv /vmlinuz /dos
  303.         3. Edit /etc/lilo.conf to change /vmlinuz to /dos/vmlinuz 
  304.         4. Move /boot to /dos/boot with:  cp -a /boot /dos ; rm -r /boot
  305.         5. Create a symlink for LILO to use with:  ln -s /dos/boot /boot
  306.         6. Re-run LILO with:  lilo
  307.  
  308.     A danger with this approach is that whenever an MS-DOS "defragmentation"
  309.     program is run (like Norton "speeddisk"), it may move the Linux boot
  310.     files around, confusing LILO and making the (Linux) system unbootable.
  311.     Be sure to keep a kernel "boot floppy" at hand for such circumstances.
  312.  
  313. If you "don't do DOS", then partition as you please, but remember to create
  314. a small partition to hold the /boot directory (and vmlinuz) as described above
  315. such that they stay within the first 1024 cylinders.
  316.  
  317. Note that when creating partitions that span beyond cylinder 1024,
  318. Linux fdisk will complain about "Partition X has different physical/logical
  319. endings" and emit messages such as "This is larger than 1024, and may cause
  320. problems with some software".   Ignore this for linux partitions.  The "some
  321. software" refers to DOS, the BIOS, and LILO, as described previously.
  322.  
  323. Western Digital ships a "DiskManager 6.03" diskette with all of their big
  324. hard drives.  Use BIOS translation instead of this if possible, as it is a
  325. more generally compatible method of achieving the same results (DOS access
  326. to the entire disk).  However, if you must use DiskManager, it now works
  327. with Linux 1.3.x in most cases.  Let me know if you still have trouble.
  328.  
  329. mlord@bnr.ca
  330.  
  331. ================================================================================
  332. EIDE card compatibility reports:
  333. ================================================================================
  334.  
  335. comp.os.linux.hardware #18483 (7 + 0 more)                            (1)--[1]
  336. From: test <a>
  337. [1] Re: Promise EIDEMAX
  338. Date: Fri Aug 11 23:17:39 EDT 1995
  339. Organization: Technical University of Brno, Czech Republic
  340. Lines: 14
  341. Mime-Version: 1.0
  342. Content-Type: text/plain; charset=us-ascii
  343. Content-Transfer-Encoding: 7bit
  344. X-Mailer: Mozilla 1.1N (X11; I; Linux 1.2.11 i486)
  345. To: rmorton@VNET.IBM.COM
  346. X-URL: news:19950806.154256.872@almaden.ibm.com
  347.  
  348. I have a Promise <sth>2300 board with DX2/80 w/ 32Mb ram.
  349.  
  350. This one is a bit schizophrenic - half (2 drives) at VLBUS and
  351. the rest 2 on ISA.
  352.  
  353. Works quite well, Linux works with it (4 HDDs), it
  354. also supports its dual irq mechanism (14 & 15).
  355. In the documentation I've found that there are certain things made about this
  356. controller(in kernel).
  357. My current kernel is 1.2.11 and Promise should be supported in all 1.2.xx
  358. kernels I think.
  359.  
  360.    Vladimir Myslik
  361.  
  362.