XMGR, RDISK, XHDD/XHDD1 and XDVD2 -- DOS Device Drivers =========================================================== 1. Description ----------- XMGR, RDISK, XHDD/XHDD1, and XDVD2 are Closed-Source DOS device drivers for PCs with 80386+ CPUs and using MS-DOS V5.0+ or compatible variants. XMGR is an "XMS manager" for up to 4-GB of XMS memory, with support for V3.70+ UMBPCI by Uwe Sieber. XMGR can load directly to UMBPCI "Shadow RAM" upper memory, and it can "boot" into regular upper memory if using JEMM386. See the example CONFIG.SYS files in Section 5 below. RDISK is a RAM-disk driver. It creates a "fast" disk using up to 2-GB of XMS memory. Files can be uploaded via AUTOEXEC to the RAM-disk and accessed at memory speeds. RDISK is a simple RAM-disk driver with no resizing or other options. XHDD is a disk caching driver. It traps BIOS "Int 13h" I-O and caches data for up to 20 BIOS disks of any size on up to 9 "Legacy" and Native PCI SATA/IDE controllers. It calls the BIOS to run A: or B: diskettes and caches data for other Int 13h drivers. The XDVD2 driver will call XHDD to cache CD/DVD files. XHDD "overlaps" UltraDMA with caching and uses Read-Ahead for UltraDMA disks with 10-MB+ caches. Its cache uses XMS memory and holds up to 4-GB of data. XHDD's /B switch also sets a basic UltraDMA disk driver (no cache), taking 128K of XMS to buffer I-O unsuited to UltraDMA. The basic XHDD is for tests or non-cached work. XHDD1 is a smaller XHDD variant which handles up to 12 BIOS disks on up to 5 "Legacy" and Native-PCI SATA/IDE controllers. XHDD1 is for "home user" systems and saves 96 bytes of "free HMA" space versus XHDD, which may help V7.0+ MS-DOS systems (short of "free HMA" since FAT32 and long filename logic are inside the V7.0+ kernel). Otherwise, XHDD1 has all the same features, switch options, and cache speed as the larger XHDD. In the remainder of this README file, all references to XHDD also apply equally to the smaller XHDD1 driver. XDVD2 is a CD/DVD driver for up to 4 SATA, IDE, or old PIO-mode drives. It reads CD/DVD data files, plays audio CDs, and can read "raw" (track- writer) data. XDVD2 can work alone; or when XHDD is used, XDVD2 calls it to cache CD/DVD data. XDVD2 buffers input unsuited to UltraDMA in 128K of XMS. It "shares" XHDD's buffer, set its own buffer if XHDD is absent, or it will do PIO-mode input if XMS memory is unavailable. The small RDISKON.COM program will re-enable an RDISK drive if a format command is issued to it by mistake! Entering RDISKON L at a command prompt, where L is the drive letter (A to Z), re-enables the drive. The small CC.COM "Clear Cache" program can help verify files written by XHDD. Entering CC at a DOS prompt causes XHDD to flush its cache. Disk data (NOT cache data) can then be compared to the original output. 2. NO Warranty ----------- XMGR, RDISK, XHDD/XHDD1, and XDVD2 are offered for no cost, as-is, "Use at your own risk" and with NO warranty, not even the implied warranties of MERCHANTABILITY nor of FITNESS for any particular purpose! 3. Revision Summary ---------------- 18-Oct-20 Smaller 12-disk XHDD1 driver added, identical in performance to the 20-disk XHDD, for "home user" PCs. Minor changes to XMGR/XDVD2. Other drivers unchanged, re-dated only. 10-Oct-20 XHDD2 dropped (no user interest). Minor XHDD size changes. 7-Jul-20 XHDD/XHDD2 corrected for 4-bit controller numbers (not 3-bit as before)! PCs with <= 8 controllers were unaffected. 30-Jun-20 XHDD2/XDVD2 code corrected for over 10 SATA/IDE controllers. 23-Jun-20 XHDD back to 20 disks/diskettes and 9 controllers for "user" systems. New XHDD2 now runs up to 32 disks/diskettes on up to 15 SATA/IDE controllers, for PC/104 and other large DOS systems. XMGR's I-O Catcher handles up to 32 disks. 18-Jun-20 XMGR/XHDD again handle up to 24 disks/diskettes on up to 10 SATA/IDE controllers, and XDVD2 again handles up to 4 CD/ DVD drives, for industrial DOS systems. 26-May-20 XMGR and XHDD now do XMS moves in 8K blocks with 486+ CPUs, 4K blocks on slow 386 CPUs. 10-May-20 XHDD 2.5-MB cache size and support for 80386 CPUs re-added. See the README Section 6 for info on the 2.5/5-MB caches. 24-Apr-20 Minor XMGR and XHDD code changes. Minor update re: "cheap BIOS" mainboard use; see the README file Section 6. 22-Nov-19 XHDD search buffer and /P switch deleted; of no value, with /O "overlap". 26-Oct-19 XHDD resident search table deleted. 15-Oct-19 XHDD now requires an 80486+ CPU. 25-Sep-19 XHDD 2.5-MB cache is deleted. 15-Sep-19 Smaller README file. XHDD2 driver deleted. 21-Apr-19 Small XHDD2 driver added, minor XMGR message problem fixed. 10-Mar-19 XHDD uses Read-Ahead for a 10-MB+ cache and sets all 10-MB+ cache sizes. 24-Feb-19 XMGR error on only old 386 CPUs is fixed. 16-Feb-19 XHDD /B error (bad return codes) is fixed. 2-Feb-19 XHDD now runs 128-GB+ disks with LBA48 I-O opcodes to avoid errors "crossing 128-GB"! Disks under 128-GB still use LBA28 opcodes. 16-Dec-18 XHDD /P cache limit is now 1.5-GB. 20-Oct-18 XHDD 2.5-MB cache added. XMGR/XHDD now use 6K-byte blocks in real-mode XMS moves. 30-Jun-18 XMGR UltraDMA "boot" deleted and "I-O Catcher" reinstalled. Related XHDD code deleted. 31-May-18 README file updated re: XMGR /O and JEMMEX usage. 22-May-18 XHDD again handles 80386 CPUs. 15-May-18 XMGR again handles 80386 CPUs. 31-Jan-18 /G switch added to XDVD2/RDISK, for DOS "game" PCs. 14-Jan-18 XMGR /N32 switch added to save low memory. 22-Dec-17 XMGR's disk "I-O Catcher" updated to a full UltraDMA "boot" (no BIOS calls). 27-Nov-17 XHDD/XDVD2 now allow 5 SATA/IDE controllers, 14 BIOS disks, 3 CD/DVD drives. Logic to avoid < 80486 CPUs deleted. 20-Nov-17 Initial "private" release of these drivers. 4. Switch Options -------------- XMGR usually needs only a /B switch, when "booting" with an EMM driver. All XMGR switches are: /B Sets "boot" mode. XMGR uses a temporary area, until JEMM386 enables upper memory. Without /B, XMGR loads into UMBPCI "Shadow RAM" or in low memory if UMBPCI is unused. /Mn Sets a temporary area, for loading XMGR in "boot" mode or for UMBPCI "Shadow RAM" DMA until a workspace buffer gets set. /M values are: /M1 = 64K. /M3 = 192K. /M5 = 320K. /M7 = 448K. /M2 = 128K. /M4 = 256K. /M6 = 384K. /M8 = 512K. Without /M, the 320K area will be used. Temporary system data can go anywhere in memory! /Mn helps to find a safe area for XMGR to use. /Nnn Sets how many XMS "Handles" are available. The value nn may be 48, 80, or 128. The /B "boot" option permits /N24 and /N32 to save low memory, but only 24 or 32 "Handles" might be not-enough and should be tested! If /N is omitted, 48 "Handles" are set. /PA Specifies use or non-use of PS/2 Port 92h logic to handle the /PN "A20" line. /PA means "Always" use Port 92h logic. /PN means "Never" use it and handle "A20" via normal keyboard- port logic. Without /P, XMGR "asks the BIOS" if Port 92h hardware is present. Keyboard-port logic is used if not. If "A20" is found "on" as XMGR loads, XMGR does not handle it at all. /Tn Sets the BIOS calls to use in getting extended memory: /T0 No "E820h" or "E801h" calls. /T1 Memory-list calls only (Int 15h, AX=E820h). /T2 A dual-area call only (Int 15h, AX=E801h). /T3 "E820h" calls first, then an "E801h" call. /T can usually be omitted, causing a /T3 default. An old 64-MB call is also used for /T0 memory. Users might want to test /T1 and /T2, since a pre-1996 BIOS may not execute them properly. If so, /T0 will be required. /W Requests using the system workspace buffer for UMBPCI "Shadow RAM" DMA. If /W is omitted, XMGR sets its own low memory buffer. /W may NOT be given with PC-DOS or EDR-DOS! /W is ignored if UMBPCI is not used. /Z For XMGR or XHDD, moves protected-move data in 8K blocks (not 64K) with a 486+ CPU and 4K blocks with slower 80386 CPUs. /Z is unneeded if using JEMM386 or with a real-mode system (UMBPCI, etc.). When using other EMM/VCPI/DPMI drivers, PCs must be tested to find if /Z is needed. BAD schemes, allowing not-enough interrupts during XMS moves, may still be in use! -------------------- RDISK requires only a /S size and a /: drive-letter switch. All RDISK switches are: /G For RDISK, XHDD or XDVD2, allocates ALL "leftover" XMS memory with old DOS games that FAIL if the game finds unused XMS! /G can be issued only from the LAST of these drivers to be loaded, since no free XMS will be left afterward. /G for XDVD2 is ignored, if it loads after XHDD, since XDVD2 then "shares" XHDD's XMS memory. /Rnn For RDISK, XHDD, or XDVD2, "reserves" (skips above) lower XMS as needed by some DOS game programs. Values are a number of megabytes from 2 to 2048 (2-GB) and denote the start of user XMS, e.g. /R16 reserves all XMS up to the 16-MB area. The drivers must be able to reserve this memory, set their own XMS beyond it, and then "free" the reserved XMS. If not, they display "XMS init error" and abort! All of the drivers must use the same /R switch, so no driver will get the reserved XMS before the DOS game has loaded. /R for XDVD2 is ignored, if it loads after XHDD, since XDVD2 then "shares" XHDD's XMS memory. /Snn Specifies a desired RAM-disk size in megabytes of XMS memory. Values are any number from 2 to 2047 (2 Gigabytes). When /S is omitted or invalid, a 25-Megabyte default is used. /:L Specifies the DOS drive letter desired to access RDISK files. L may be any available drive letter from A to Z, e.g. /:N assigns drive N: to all RDISK files. If the drive letter is too high or already in use, RDISK aborts, and users may need "LASTDRIVE=" in CONFIG.SYS to set more drives. When RDISK loads from CONFIG.SYS, or if /: is omitted, the next free drive letter is used. -------------------- XHDD usually needs only a /H switch to use HMA space and a /S switch to set its cache size. All XHDD switches are: /A For XHDD or XDVD2, requests "alternate" addressing for legacy IDE controllers, 01E8h/0168h for the first one, and 01F0h/ 0170h for a second. /A is rarely needed. Without /A, the first legacy controller uses 01F0h/0170h, and a second uses 01E8h/0168h, as is usual for PC mainboards. /B Loads a basic UltraDMA disk driver (no cache). 128K of XMS is required as a buffer for disk I-O unsuited to UltraDMA. With /B, the /E /O /S and /Z switches are ignored. /E Excludes UltraDMA I-O logic, on 80386 or early 80486 PCs that never had UltraDMA! XHDD will "call the BIOS" to do disk I-O and cache data (as necessary), after the BIOS is done. With /E, the /A and /Q switches are ignored. /G See /G for RDISK, above. When RDISK loads after XHDD, RDISK must issue /G, and XHDD must omit it! /H Puts most of the driver in "free HMA" space. /H must NOT be given with ROM-DOS (NO "free HMA")! MS-DOS kernels have ERRORS declaring "free HMA" which can cause crashes! PCs should be tested before /H is used in critical work. /O "Overlaps" disk UltraDMA with caching tasks for faster speed. /O may NOT work on old/odd/"cheap" PC mainboards unable to do UltraDMA and access XMS at the same time! PCs must be tested with /O. If disk errors occur but CD/DVD input by XDVD2 runs fine, /O must NOT be used! /Q Awaits "data request" before starting UltraDMA I-O transfers. /Q is rarely needed, only for old systems where the driver loads O.K. but seems unable to transfer data. /Q is NOT for use with Sabrent or other SATA-to-IDE adapters that do not emulate "data request"! /Rnn See /R for RDISK, above. /Snn Sets the cache size, in megabytes of XMS memory. Values are 2 (2.5-MB), 5 or any number from 10 to 4093 (4 Gigabytes). If /S is omitted or invalid, a 20-MB cache is used. XHDD displays "XMS init error" and will abort if not-enough XMS is free. If so, request a smaller cache. See Section 6 below for comments about using the small 2.5-MB and 5-MB cache sizes. /Z See /Z for XMGR, above. -------------------- XDVD2 usually needs only a /H switch to use "free HMA" and a /D: switch to set its "device name" for SHSUCDX/MSCDEX. All XDVD2 switches are: /A See /A for XHDD, above. /D: Specifies the "device name" used by the CD/DVD Redirector to access CD/DVD drives, e.g. /D:CDROM1 /D:SANYO1 etc. If /D: is omitted, or the name following a /D: is missing or invalid, UDVD1 is set by default. /G See /G for RDISK, above. If /G is needed, XDVD2 may issue it only if XHDD does not load first and if RDISK will not be loaded later (small DOS "game" systems, etc.). /H Loads most of the driver in "free HMA". See the /H notes above for XHDD! /Rnn See /R for RDISK, above. /UX Disables all CD/DVD UltraDMA, even for units that can do it. All CD/DVD data input then uses PIO-mode. /UX is rarely needed, only for odd drives that do not obey ATAPI rules. -------------------- For all switches in each driver, a dash may replace the slash and lower case letters may be used if desired. 5. Example Configuration Files --------------------------- A) A small real-mode system that needs only XMS may use this CONFIG.SYS example file: .. .. DOS=HIGH DEVICE=C:\BIN\XMGR.SYS .. .. Int 13h drivers cached by XHDD load now. .. DEVICE=C:\BIN\XHDD.SYS /S10 /H /O ;Min. 10 MB for Read Ahead DEVICE=C:\BIN\XDVD2.SYS /D:BLURAY1 /H ;Must load after XHDD DEVICE=C:\BIN\RDISK.COM /S5 ;Optional .. .. Etc. .. B) Real-mode systems with V3.70+ UMBPCI and XMGR do not need the LOWDMA driver, as XMGR has an "I-O Catcher" for UMBPCI. This scheme takes NO low memory if /W can be used (MS-DOS etc.) or only 544 low memory bytes without /W (PC-DOS etc.). XMGR and other drivers load direct to UMBPCI "Shadow RAM"! For MS-DOS, PC-DOS, and others that permit multiple upper memory providers, JEMM386 can also be used to provide protected-mode items, e.g. "mapping" the B000-B7FFh monochrome space as extra upper memory. See Section 6 below for more protected-mode notes! An example CONFIG.SYS file is: .. .. DOS=HIGH,UMB DEVICE=C:\BIN\UMBPCI.SYS DEVICE=C:\BIN\XMGR.SYS /W ;W switch when allowed! DEVICE=C:\BIN\JEMM386.EXE I=B000-B7FF X=C800-EFFF NOEMS ;Optional .. .. Int 13h drivers cached by XHDD load .. now and can load into upper memory. .. DEVICEHIGH=C:\BIN\XHDD.SYS /S200 /H /O ;FAST 200 MB cache! DEVICEHIGH=C:\BIN\XDVD2.SYS /D:CDROM1 /H ;Must load after XHDD DEVICEHIGH=C:\BIN\RDISK.COM /S50 ;Optional .. .. Etc. .. C) A protected-mode system with XMGR and JEMM386 can use XMGR's "boot", taking only 304 low memory bytes as its 24-entry "XMS Handles" table (used early by JEMM386). See Section 6 below for other notes about protected-mode! An example CONFIG.SYS file is: .. .. DOS=HIGH,UMB DEVICE=C:\BIN\XMGR.SYS /B /N24 ;24 Handle XMGR "boot" DEVICE=C:\BIN\JEMM386.EXE I=B000-B7FF ... DEVICEHIGH=C:\BIN\XMGR.SYS ;Loads the runtime XMGR .. .. Int 13h drivers cached by XHDD load .. now and can load into upper memory. .. DEVICEHIGH=C:\BIN\XHDD.SYS /S1023 /H /O ;1 Gigabyte cache DEVICEHIGH=C:\BIN\XDVD2.SYS /D:MYDVD /H ;Must load after XHDD DEVICEHIGH=C:\BIN\RDISK.COM /S250 ;Optional .. .. Etc. .. In all above examples, XDVD2 must load after XHDD so it can "find" XHDD in memory and "link" with it for CD/DVD file caching. When all above drivers have been loaded, further CONFIG.SYS drivers (SETVER, ANSI.SYS, etc.) can then be loaded in any order. Users that need RDISK with a specific drive letter may delay loading it until AUTOEXEC.BAT is run. If /G is also needed by an old DOS "game", RDISK must issue the /G switch from AUTOEXEC, as it is then the last of these drivers to load. 6. Technical Notes --------------- Protected-mode users must pretest "I=nnnn-nnnn" or "X=nnnn-nnnn" values for JEMM386, as its "I=TEST" or "X=TEST" options may fail on newer PCs. Protected-mode is unrecommended with old DOS games needing reserved XMS as JEMM386 takes some XMS memory first. Newer "cheap BIOS" mainboards now OMIT logic used only by DOS and need an UltraDMA disk driver loaded before JEMM386 sets "V86" protected-mode! For such boards, CONFIG.SYS examples B or C above require drivers cached by XHDD, then XHDD itself, to load right after XMGR (such drivers can use only "Shadow RAM" upper- memory for example B, and they MUST use only LOW memory for example C). JEMM386 can then load and set "V86" protected-mode O.K. 2015 or older PCs with a regular BIOS usually do not need this and can use examples B or C as shown above. Use of JEMMEX or other "EMM" drivers but JEMM386 should now be avoided. Other "EMM" drivers got dropped long ago, some with remaining ERRORS! JEMMEX has caused crashes on newer PCs, due to OBSOLETE (since 1995!) XMS detection code, and it cannot work with XHDD on "cheap BIOS" boards as neither driver will load O.K. if the other is absent! To have protected-mode on such boards, use CONFIG.SYS example B or C with the "cheap BIOS" changes described above, and be aware that JEMM386 shall always be REQUIRED! XHDD's 2.5-MB and 5-MB cache sizes are for old PCs with only 4- or 8-MB of memory. /S2 leaves about 400K (more with /S5) for a small RAM-disk that can be set using the "NJRAMDX" driver available from many Internet archives. PCs with at least 16-MB can use XHDD /S10 for a good 10-MB Read-Ahead cache and RDISK /S4 for a good 4-MB RAM-disk. AUTOEXEC can load the RAM-disk with frequently-used DOS programs (COMMAND.COM, etc), and the cache can improve performance of normal disk files. Both will help limit "wear out" of IDE disks used on old PCs. Note that XHDD /E is also needed with 80386 and early 80486 PCs that never had UltraDMA. With V7.0+ MS-DOS, CONFIG.SYS cannot set over "BUFFERS=12" if both XHDD and XDVD2 load in "free HMA" (/H switches). For more DOS buffers, use "BUFFERSHIGH=nn". On systems having limited "free HMA", XHDD or XDVD2 can omit /H switches and load in only upper/DOS memory. XMGR and XDVD2 post normal XMS or CD/DVD error codes, as needed. They are listed in the "V3.0 XMS Specification" and in the Microsoft "MS-DOS CD-ROM Extensions 2.1" document, from Microsoft or elsewhere. XHDD is a "BIOS driver" and returns BIOS error codes for disks or diskettes run by it. For its own SATA/IDE disks, XHDD can return these error codes: Code 0Fh - DMA error. CCh - Disk is FAULTED. 20h - Controller busy. E0h - Hard I-O error. AAh - Disk not ready. FFh - XMS memory error. Many DOS programs display only "Disk Error" messages with NO code, thus disk errors may require running a diagnostic to get better information! XHDD handles only "Legacy" or Native-PCI IDE controllers. "RAID only" chipsets, port-multiplier chips, and ADMA chips are unsupported. XHDD runs only "Legacy", "Compatibility", and "Native IDE" AHCI controllers. On mainboards with no such controller settings, a Sabrent or equivalent SATA-to-IDE adapter can let XHDD and XDVD2 run SATA disks/CDs/DVDs from a parallel-port IDE controller (80-pin cable) at DMA speeds. "Add-on" PCI-bus adapter cards, which can be detected thru normal PCI-bus logic, may also be used for disks/CDs/DVDs. XMGR loads in UMBPCI upper memory that is not "provided" to the system. With UMBPCI, a "MEM" list may begin with a block having a 00A6h offset, or greater with 80 or 128 XMS "Handles". The upper memory skipped by this offset contains XMGR. The UMBPCI upper memory manager uses system "Shadow RAM" that cannot do DMA. A newer BIOS may use UltraDMA to load programs in upper memory. If this is "Shadow RAM", a HANG can occur! These two rules apply, if using UMBPCI with XMGR and XHDD: A) V3.70+ UMBPCI must load before XMGR, so XMGR finds UMBPCI and sets its "I-O Catcher", to handle diskette "Shadow RAM" DMA forever and to run disk "Shadow RAM" UltraDMA until XHDD loads. Older UMBPCI drivers, or other UMBPCI load schemes, are not recommended! B) When CHS I-O is done (MS-DOS V6.22 or older), every disk must have valid CHS parameters set in the BIOS. If not, the "I-O Catcher" and XHDD let the BIOS deal with CHS I-O. When BIOS UltraDMA was left enabled, a "Shadow RAM" HANG can occur! Old BIOS programs may not configure a mainboard controller when no user drives are on it! The drivers then display "BAD controller" and go on looking for others to use. If this message is given, users must check that all SATA/IDE drives are set "active" with the BIOS setup routines. If so, "BAD controller" means a chip is not using "Bus Master" and "I-O Space" modes, and a BIOS update is needed.