UltraDMA Drivers for DOS, Version 2.3 ========================================= 1. General Description ------------------- This is a set of four DOS UltraDMA hard-disk drivers. All the drivers run UltraDMA disk(s) on PC mainboards using a "South Bridge" controller chip from Intel, VIA, SiS, ALi and other vendors. The drivers are NOT for "add-on" IDE adapter cards from Promise, SiiG, HighPoint or others, as such cards already handle UltraDMA in their own on-board BIOS logic. The intent of these drivers is to use the mainboard UltraDMA controller and so AVOID needing an "add-on" card! The following descriptions are for V2.3 UDMA2/UDMA2S and for V7.8 UDMA/UDMAJR only. Some options and features may not apply to earlier versions. The four UltraDMA drivers are as follows: A) UDMA2 is the most full-featured driver. It offers "output overlap" which buffers all output and does NOT await output end, so user work may overlap the DMA! Depending on the user's system and software, output overlap can yield a significant speed boost. For any output error or if a 400-msec timer expires, an error message will display. Output overlap must be enabled with a /O in the CONFIG.SYS line that loads UDMA2 (see below for switch options). UDMA2's resident size is 1344 bytes when overlap is enabled or 1088 bytes without overlap. UDMA2 output overlap requires that each IDE channel must NOT have an UltraDMA and a non-UltraDMA drive! Other drivers are unaware UDMA2 leaves output running, and such drivers may post a "controller busy" ERROR when using the same channel as UDMA2. If either channel MUST "share" an UltraDMA disk and an ATAPI or non-UltraDMA drive, overlap may NOT be used! UDMA2 is intended for the majority of "home user" systems that usually have their UltraDMA hard-disk(s) on the primary IDE channel, with non-UltraDMA or ATAPI drives (ZIP, CD-ROM etc.) on the secondary channel. Such systems can get more speed IMMEDIATELY by enabling UDMA2 output overlap. The "UMBPCI" upper-memory driver CAN BE USED with UDMA2 and UDMA2S!! See the /L notes in section 2, Switch Options. B) UDMA2S is the PREFERRED "small driver", for systems not using output overlap. It omits overlap and initialization "read tests", thus it achieves an object-file size of 3072 bytes. All other capabilities of the full UDMA2 (including an 80386 test) are retained. Starting with V2.2, the /S switch CAN be used to set a local-stack! UDMA2S has a normal resident size of 656 bytes, rising to 1024 bytes if its local-stack is used. C) UDMA is offered for those who wish to remain "compatible" with older versions of that driver. It uses the same 640 byte resident "core" as UDMAJR. As in previous versions, UDMA is the only driver in the set that displays the UltraDMA controller "name" and PCI-bus data at load-time, for those desiring to see what chip will be used. UDMA also offers the full set of load-time tests, same as UDMA2. D) UDMAJR is offered for "RAM disk" or "embedded" systems which require an absolute minimum-size UltraDMA driver. It has the same 640 byte resident "core" as UDMA and so offers identical run-time capability. UDMAJR omits an 80386 test, "read tests" and the controller and disk "names" at load-time (the controller I-O address IS shown!), thus it achieves an object-file size of 2048 bytes. For most users, the recommended drivers are UDMA2 where the performance of output-overlap is desired or UDMA2S when a smaller driver is needed. UDMA and UDMAJR are only for "compatibility" or "minimum" systems. But, NOTE that a local-stack is offered only by UDMA2 and UDMA2S. The older UDMA and UDMAJR take 96 bytes or more of USER stack space on each I-O request. If UDMA/UDMAJR cause unexplained trouble, or if any user program is KNOWN to set a "short" run-time stack (less than 256 bytes), UDMA2 or UDMA2S must be run instead! Their local-stack is active for disk I-O requests and avoids "short-stack" program problems. See the /S notes in section 2, Switch Options, regarding how the local-stack is enabled in both drivers. All the drivers run up to four disks of any size, including newer types over 128 gigabytes. Also, all drivers can be used in "DMA only" mode, for minimum DOS systems that do not load an XMS manager. Without XMS, the drivers have no I-O buffer and "pass back" to the BIOS any I-O that does not meet DMA requirements, noted below. As this is less than 50% of normal I-O, the drivers in "DMA only" mode are still useful on small systems. Using "DMA only" mode, the resident size of UDMA2 is reduced to 736 bytes, UDMA2S to 592 bytes and UDMA/UDMAJR to 576 bytes. UDMA2 saves memory and does not set a local-stack for "DMA only" mode, unless /S is used; then, UDMA2's resident size is 1024 bytes. Note that for UDMA2S, its size is always 1024 bytes when its local-stack is enabled. The drivers "intercept" I-O calls issued as Int 13h requests (Interrupt 13) to the BIOS. Only read or write requests are handled. All other Int 13h requests (seeks, I-O for other type devices, etc.) are "passed" back to the BIOS or other drivers for handling. Each disk must handle "logical block addressing" (LBA). The drivers accept 48-bit LBA mode I-O requests for FreeDOS, MS-DOS 7.xx, and other newer DOS systems that support LBA mode I-O. 24-bit CHS mode I-O requests are also accepted, for MS-DOS 6.xx, PC-DOS 7 or earlier. As CHS requests are limited to 24-bit addresses, all data accessed using CHS mode must be in the first 8 gigabytes of a disk. Other partitions may contain more data and may be accessed using operating systems which support LBA mode requests. If the buffer for an I-O request is not DWORD-aligned, fails a VDS lock or crosses a 64K physical memory boundary, the request shall go through the driver's local buffer in XMS memory, using Ultra DMA I-O to or from the local buffer (it DOES allow DMA). On minimum DOS systems that run the drivers in "DMA only" mode (no local buffer!), such I-O is "passed" back to the BIOS for execution. Not crossing over a 64K DMA boundary is required by the Bus Master IDE specification, and alignment to DWORD (4-byte) boundaries is required by some Intel "South Bridges". An I-O request for more than 64K bytes of data (over 128 sectors) will also be "passed" to the BIOS. DOS systems should never issue such requests. 2. Switch Options -------------- UDMA or UDMAJR use no switch options. UDMA2 or UDMA2S switch options, specified in the CONFIG.SYS line that loads the driver, are: /O For UDMA2 only, enables output overlap. This REQUIRES an XMS manager (HIMEM.SYS, etc.) and 128K of XMS memory. If /B is also specified, or if XMS is not available, overlap will NOT be enabled, as UDMA2 must then use "DMA only" mode. /L Limits DMA to "low memory" below 640K. /L is REQUIRED to use the UMBPCI upper-memory driver, or any similar drivers whose upper-memory areas do not support DMA. If /L is specified, UDMA2 or UDMA2S must reside in LOW memory (as their command- list is accessed via DMA), or the driver will ABORT loading! /L causes I-O requests past 640K to go thru the driver's XMS buffer. If /B is specified with /L or if XMS memory is not available, such I-O is "passed" to the BIOS for execution. /S For UDMA2, enables the driver local-stack for "DMA only" mode. For UDMA2S, enables the local-stack for all cases. NOTE that the two drivers handle /S differently! UDMA2S usually does not enable a stack (for compatiblity with old versions!) and requires /S whenever a stack is wanted. UDMA2 always sets a stack (and ignores /S) for normal or output-overlap usage, so it requires /S merely for "DMA only" mode. /S is meant for systems with one or more user programs which set "short" run-time stacks, as noted above! /S and /B are independent and both may be specified together. /B Causes XMS memory to be IGNORED, for "backward compatibility". /B forces UDMA2 or UDMA2S to use "DMA only" mode. Thus, /B cancels /O (UDMA2 output overlap is not enabled), causes the initialization "read tests" in UDMA2 to be omitted, and also affects /L as noted above. /Mn Specifies the MAXIMUM UltraDMA "mode" to be used by all disks, where n is a number between 0 and 7, as follows: 0 = ATA-16, 16 MB/sec. 4 = ATA-66, 66 MB/sec. 1 = ATA-25, 25 MB/sec. 5 = ATA-100, 100 MB/sec. 2 = ATA-33, 33 MB/sec. 6 = ATA-133, 133 MB/sec. 3 = ATA-44, 44 MB/sec. 7 = ATA-166, 166 MB/sec. Disks designed to a "mode" LESS than the given value will be limited to their own highest "mode". At present, "mode 7" ATA-166 is not yet implemented, but any driver CAN handle it if UltraDMA disks ever use it. /X For UDMA2 only, disables initialization "read tests". This switch is a LAST-chance "scheme" of forcing UDMA2 to load on "problem" systems! Any errors detected by the "read tests" should be CORRECTED, wherever possible! Most users need only /O to enable UDMA2 output overlap, /L where UMBPCI (or similar) may also be used, and /S if a local-stack is desired to be SAFE against "short-stack" user programs! The other switches are for "problem" systems or for "diagnostic" work. For all switches, a dash may replace the slash and "lower-case" letters may also be used. Note that when NO switches are given, UDMA2 or UDMA2S operate identically at run-time as the older UDMA or UDMAJR. 3. Setup and Configuration ----------------------- All drivers are loaded by the CONFIG.SYS file, after any memory-manager such as EMM386.EXE or UMBPCI.SYS, but BEFORE loading any "disk caching" program such as NCACHE2 or LBACACHE. Your CONFIG.SYS file should use a command-line similar to the following: DEVICE[HIGH] = [path]UDMA2.SYS [/O] [/L] [/S] [...] = [path]UDMA2S.SYS [/L] [/S] [...] = [path]UDMA.SYS = [path]UDMAJR.SYS For example: DEVICE=C:\DOS\UDMA2.SYS, DEVICEHIGH=C:\BIN\UDMA2S.SYS etc. Note that UDMA/UDMAJR use no command-line switches, and UDMA2 or UDMA2S use the switches described above. All four drivers detect which hard- disks to use automatically, and all will run in normal or upper-memory. Please be sure to set up the hard disk geometry in your BIOS correctly. Set it to "Auto", "LBA" or "LBA Assisted", but NOT to "None", "Normal", "CHS" or "ECHS". "User Cylinders/Heads/Sectors", "Revised ECHS" or "Bit Shift" should work but are NOT preferred. If a BIOS has settings like "UDMA Capable" for a disk, enable it. Power-saving features such as a "drive spin-down timeout" should be DISABLED or driver I-O requests may time out! Also, be sure to use an 80-connector cable for any UltraDMA disk operating in "mode 3" ATA-44 (44 MB/sec) or higher. When cabling a single disk to an IDE channel, note that you MUST use both "ends" of the cable, NOT one "end" and the middle connector! This avoids ERRORS as an unused cable-end CAN pick up "noise", like a RADIO antenna! 4. Error Reporting --------------- All four drivers include a full set of error return-codes, to indicate the exact cause of any error. UDMA2 and UDMA run initialization "read tests" and display diagnostic messages for any of these error codes, if errors occur during the driver v.s. BIOS "comparison reads" or during a "read speed" test of each UltraDMA disk. These tests are done only at load-time and only if XMS memory is available for an input buffer. If XMS is unavailable, UDMA2S or UDMAJR is being run, or /B or /X is given with UDMA2, the "read compare" and "read speed" tests shall be omitted. Users who may be having trouble can forego UDMA2S or UDMAJR and instead run UDMA2 or UDMA, as a "diagnostic aid". The return codes from all drivers (available after any I-O request) and the messages for UDMA2 or UDMA load-time errors are as follows: Code 08h - DMA timed out 0Fh - DMA error 20h - Controller busy before I-O 21h - Controller busy after I-O 80h - First DRQ timed out AAh - Disk not ready before I-O ABh - Disk not ready after I-O CCh - Disk FAULT before I-O CDh - Disk FAULT after I-O E0h - Hard error at I-O end FEh - BIOS/driver read MISMATCH (init only) FFh - XMS memory error If UDMA2 output overlap is enabled, a run-time output error shall cause the following message to be displayed: UDMA2: Output ERROR eeh Disk=d LBA=aaaaaaaaaaaah! where eeh is one of the return codes listed above, d is the disk number (0 for primary-master, 1 if primary-slave, 2 if secondary-master, and 3 if secondary-slave), and aaaaaaaaaaaah shows the beginning disk address expressed as a 12-digit "logical block address" (LBA). Because UDMA2 is a physical-level driver called by Int 13h (not a DOS "file driver"), the DOS "file" or "directory" for an output error cannot be shown. 5. Hardware and BIOS Issues ------------------------ The UltraDMA "mode", from "mode 0" ATA-16 thru "Mode 6" ATA-133, is set to the highest "common" mode handled by a disk and the controller chip. The BIOS should preset this value, even if the BIOS itself will not use UltraDMA in its own I-O. Note that the /M switch for UDMA2/UDMA2S can be used to set a LOWER UltraDMA "mode" for all disks, if necessary. All of the drivers are intended for systems using "legacy IDE" UltraDMA controller mode. They do NOT recognize Serial-ATA controllers nor any hard-disk controller set for "native PCI" mode, only "legacy IDE" mode! Also, the mainboard is expected to have a normal BIOS program, one that supports "EDD" BIOS calls and returns "DPTE" data for "legacy" UltraDMA disks, as described in the Phoenix EDD BIOS spec V1.1, 9-May-1995. It is through such BIOS logic that the drivers find which disks to use and what their physical parameters are. However, there are some "old" motherboards (pre-1998) that run UltraDMA but have no "EDD" BIOS. Also, there are new systems (Compaq and H/P) that offer both Serial-ATA and "legacy" IDE controllers, but their BIOS in fact does NOT give proper "DPTE" data for "legacy" disks. For such systems, all drivers will attempt a "hardware only" search for UltraDMA disks, if NO disks are found via normal BIOS logic. The drivers will recheck the system WITHOUT using "EDD" BIOS calls, and they will expect to find: BIOS unit 80h = Primary Master disk, UltraDMA disk #1. unit 81h = Primary Slave disk, UltraDMA disk #2, if present. unit 82h = Secondary Master disk, UltraDMA disk #3, if present. unit 83h = Secondary Slave disk, UltraDMA disk #4, if present. The hardware-only search REQUIRES that UltraDMA disk #1 be the primary- master, a second UltraDMA disk to be the primary-slave, etc. If ATAPI devices (ZIP, CD-ROM) are also present, they must use an IDE cable slot AFTER all UltraDMA disks, e.g. the secondary channel. Also, if a SCSI controller is present, its on-board BIOS (if any) must be set DISABLED! This is so the motherboard main BIOS will not "install" any SCSI drives ahead of the UltraDMA hard disks. This also requires that an UltraDMA disk (not a SCSI or CDROM) must be the system "boot" disk. On systems needing the hardware-only search, SCSI disks may still be accessed with a DOS SCSI driver that is appropriate for the controller and its disks. NOTE that such "rules" of attaching the UltraDMA disks first on the IDE controller apply ONLY for systems with a missing or invalid "EDD" BIOS. If a valid "EDD" BIOS is present as on most good "modern" systems, user IDE and SCSI disk drives may be configured in ANY desired order. 6. SPECIAL NOTES ------------- Some CD-ROM "boot" programs handle the CD-ROM as a "fake" hard disk and provide incorrect EDD BIOS data for it! The drivers no-longer "abort" if an EDD BIOS error occurs. They now display "EDD error! BIOS unit ignored" then go on searching for other useable UltraDMA disks. Users who are NOT "booting" from a CD-ROM should diagnose which hard disk was passed-over and why. Users who ARE "booting" from a CD-ROM, where all UltraDMA disks were detected properly, may ignore this message. It is caused by a design ERROR in the CD-ROM "boot" program, NOT a problem in the UltraDMA driver or its disks! Also, some CD-ROM "boot" programs may cause read errors when the driver load-time "read tests" are run. This may be because the CD-ROM "boot" creates a DOS environment which is INCOMPLETE while drivers are loaded, though the drivers often DO run correctly after the "boot" is finished! Users who get "read test" errors should first try UDMA2/UDMA2S with the /X switch, to DISABLE the "read tests", before assuming that a hardware problem exists. Finally, a few BIOS programs may NOT "configure" the mainboard UltraDMA controller if no IDE devices are found! Usually, if no UltraDMA disks are present, the drivers display "No disks to use; driver NOT loaded!", and they abort. But, since the drivers look for controllers first, an "unconfigured" controller might give the message "Bus-Master setup BAD; driver NOT loaded!", then the driver aborts. If the latter message is shown, users should first verify that all UltraDMA hard-disks have been made "active" via the BIOS setup routines, before assuming a Bus-Master problem exists.