Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!bionet!agate!linus!linus!gwr From: gwr@linus.mitre.org (Gordon W. Ross) Newsgroups: comp.sys.ibm.pc.misc Subject: MSDOS 3.3 patch for >1024 cyl hard disk Summary: Fixes disk parameter vector Keywords: 1024 cylinder hard disk Message-ID: <119237@linus.mitre.org> Date: 6 Sep 90 16:12:35 GMT Reply-To: gwr@linus.mitre.org (Gordon W. Ross) Distribution: usa Organization: The MITRE Corporation, Bedford, MA. Lines: 337 Here is my "msdos-fix" package for using dos on disks with more than 1024 cylinders. The README file below describes this package further. (The README file appears first in the shell archive below.) If you need to split-up this shell archive but don't have a UNIX-compatible shell or unshar program, just use an editor to make a file from each section delimited by: cat << \SHAR_EOF > 'some_file' ... the body of 'some_file' ... SHAR_EOF -- Gordon W. Ross (M/S E095) | internet: gwr@linus.mitre.org The MITRE Corporation | uucp: (backbone-host)!linus!gwr Burlington Road | Day-phone: 617-271-3205 Bedford, MA 01730 (U.S.A.) | #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # README # Instruct.doc # debug_io.cmd # This archive created: Thu Sep 6 12:11:34 1990 # By: Gordon W. Ross (The MITRE Corporation, Bedford, MA.) export PATH; PATH=/bin:$PATH echo shar: extracting "'README'" '(1701 characters)' if test -f 'README' then echo shar: will not over-write existing file "'README'" else cat << \SHAR_EOF > 'README' The "msdos-fix" package contains patches for MSDOS 3.3 to allow it to use the first 1024 cylinders of a hard disk when the disk controller BIOS has installed disk parameters showing more than 1024 cylinders. Note that this patch is designed for use on PC/AT compatible disk controllers that have a BIOS parameter override feature, such as the RLL and ESDI controllers by Adaptec and Western Digital. If the ROM BIOS installs a "disk parameter vector" (addressed by int 0x41) which shows more than 1024 cylinders, then DOS (at least MS DOS 3.3) takes the number of cylinders to be (real_cyls MOD 1024) and, worse yet, gets the number of sectors-per-track wrong as well. Disk controllers by Adaptec and Western Digital may install a disk parameter vector which shows more than 1024 cylinders. In these circumstances, this DOS patch can be used to modify the disk parameter vector such that the number-of-cylinders field is limited to 1024. There is no problem using a disk with more than 1024 cylinders as long as the BIOS installs a disk parameter vector which specifies a number of cylinders not greater than 1024. If the BIOS supports specification of arbitrary disk parameters, one can just lie (if necessary) to make the disk look like it has 1024 cylinders even if it has more, and then the DOS patch is not necessary. The file Instruct.doc contains instructions for applying this patch. The file debug_io.cmd contains debug commands to modify your copy of IO.SYS (as described in the instructions). Gordon W. Ross (M/S E095) | internet: gwr@linus.mitre.org The MITRE Corporation | uucp: (backbone-host)!linus!gwr Burlington Road | Day-phone: 617-271-3205 Bedford, MA 01730 (U.S.A.) | SHAR_EOF if test 1701 -ne "`wc -c < 'README'`" then echo shar: error transmitting "'README'" '(should have been 1701 characters)' fi fi # end of overwriting check echo shar: extracting "'Instruct.doc'" '(7159 characters)' if test -f 'Instruct.doc' then echo shar: will not over-write existing file "'Instruct.doc'" else cat << \SHAR_EOF > 'Instruct.doc' ************************************************************************ Introduction: MS-DOS 3.3 does not work correctly with hard disks having more than 1024 cylinders. The instructions below describe a way to patch MS-DOS so it can use the first 1024 cylinders of these large disks under certain limited conditions. This patch depends on having the disk parameter vectors (pointed at by interrupt vectors 0x41 and 0x46) reside in memory that is writable, as is the case when an auto-configuring disk controller is in use. The RLL and ESDI controllers by Adaptec and Western Digital are known to use writable memory locations for the customized disk parameters installed by the disk controller BIOS at boot-time. The patch works by limiting the "number of cylinders" entry in each disk parameter table to a maximum of 1024. This is done before DOS examines the hard disks, so DOS finds disk parameter vectors indicating at most 1024 cylinders. Note that this patch will not work on most XT disks controllers because these set interrupt vector 0x41 to point at the base of a table of several sets of disk parameters and not at the actual disk parameters as it does on an AT. ************************************************************************ Verifying the version of MS-DOS 3.3: Before making any changes, verify the following features of your copy of the hidden file "IO.SYS" using DEBUG: DEBUG \IO.SYS R CX :577E <- Verify this (size of old_io.sys) If the file size (value of CX register) was not 577E then you may have a different variant of MS-DOS 3.3 from what I have. If your version is significantly different then these patches may not work. Now (still in debug) dump and verify the area near the end of the file: D 5860 587f XXXX:5860 24 0D 0A 49 6E 76 61 6C-69 64 20 53 54 41 43 4B $..Invalid STACK XXXX:5870 20 70 61 72 61 6D 65 74-65 72 73 0D 0A 24 00 00 parameters..$.. If the dump does not match the above (other than the XXXX segment value) then you probably have a different version of DOS. All bets are off... Now unassemble near the beginning, and check that it looks like: U 100 140 XXXX:0100 FA CLI XXXX:0101 33C0 XOR AX,AX XXXX:0103 8ED0 MOV SS,AX XXXX:0105 BCE27B MOV SP,7BE2 XXXX:0108 BDE27B MOV BP,7BE2 XXXX:010B FB STI XXXX:010C 895E14 MOV [BP+14],BX XXXX:010F 886E1A MOV [BP+1A],CH XXXX:0112 885618 MOV [BP+18],DL XXXX:0115 33C0 XOR AX,AX XXXX:0117 8ED8 MOV DS,AX XXXX:0119 A1187C MOV AX,[7C18] XXXX:011C 894616 MOV [BP+16],AX XXXX:011F A11A7C MOV AX,[7C1A] XXXX:0122 894600 MOV [BP+00],AX XXXX:0125 A1167C MOV AX,[7C16] XXXX:0128 894608 MOV [BP+08],AX XXXX:012B A11C7C MOV AX,[7C1C] XXXX:012E 89460A MOV [BP+0A],AX XXXX:0131 A10E7C MOV AX,[7C0E] XXXX:0134 89460E MOV [BP+0E],AX XXXX:0137 33C0 XOR AX,AX XXXX:0139 8ED8 MOV DS,AX XXXX:013B A10B7C MOV AX,[7C0B] XXXX:013E 33DB XOR BX,BX XXXX:0140 8A1E0D7C MOV BL,[7C0D] Q (Done with debug.) If all of the above matches what you have, then it is safe to proceed. ************************************************************************ Making a patched version of IO.SYS The following procedure will make new copies of the two hidden system files, IO.SYS and MSDOS.SYS and modify the IO.SYS file. First, make copies of the hidden files using the commands: DEBUG \IO.SYS N NEW_IO.SYS W Q DEBUG \MSDOS.SYS N NEW_DOS.SYS W Q Then patch the new file NEW_IO.SYS using debug with input redirection. The commands for debug should be put into a file such as DEBUG_IO.CMD and then used as input with the DOS command: DEBUG NEW_IO.SYS 'debug_io.cmd' R CX 5800 F 587E 58FF 0 A 137 CALL 5880 NOP A 5880 MOV BX,0104 CALL 588D MOV BX,0118 CALL 588D RET PUSH DS LDS SI,[BX] MOV AX,[SI] MOV BX,0400 CMP AX,BX JBE 589B MOV [SI],BX NOP PUSH CS POP DS JBE 58B4 MOV SI,57B8 CLD LODSB CMP AL,00 JZ 58B4 PUSH SI MOV BX,0007 MOV AH,0E INT 10 POP SI JMP 58A4 POP DS RET NOP NOP DB "Disk size fixed.",0D,0A,00 W Q SHAR_EOF if test 360 -ne "`wc -c < 'debug_io.cmd'`" then echo shar: error transmitting "'debug_io.cmd'" '(should have been 360 characters)' fi fi # end of overwriting check # End of shell archive exit 0 -- Gordon W. Ross (M/S E095) | internet: gwr@linus.mitre.org The MITRE Corporation | uucp: (backbone-host)!linus!gwr Burlington Road | Day-phone: 617-271-3205 Bedford, MA 01730 (U.S.A.) |