- 1 - Patches for DOS 3.1 COMMAND.COM ------------------------------- Patches 1 through 5 were obtained from the November 26, 1985 issue of PC Magazine. It appeared on User-to-User. The contributor of these patches is Calvin R. Shields from Louisville, Kentucky. Patches 6 through 12 were obtained from CompuServe. It was posted on August 9, 1985 by Jim Gainsley. - 2 - Patch 1: Fix CLS command to clear 25 lines instead of 26 lines. This -------- particularity allows DOS to erase the first line in video buffer which follows the currently active buffer. debug COMMAND.COM -e 263B xxxx:263B 19.18 -w -q Patch 2: Fix the ECHO command so that ECHO followed by two spaces may -------- be used to display a blank line. The practice of using ECHO to generate a blank line is not supported by MicroSoft. However, this is an undocumented feature available in earlier DOS versions but not in DOS 3.1, and even some authors like Peter Norton uses ECHO with two spaces to display a blank line. debug COMMAND.COM -e 3878 xxxx:3878 E8.83 20.F9 00.02 74.72 -w -q Patch 3: Fix ECHO command so that ECHO OFF is the default for executing -------- a BATch file. The first byte is modified to set ECHO OFF for the processing of the AUTOEXEC.BAT file, and the second byte is modified to set ECHO OFF for all BATch files executed from the DOS prompt. debug COMMAND.COM -e 105B xxxx:105B 03.02 -e 1967 xxxx:1967 01.00 -w -q - 3 - Patch 4: Replace the CHDIR command, since most people use CD anyway, -------- with a new command. The new command DATER may be used to display the current date; unlike the DATE command, the DATER command will not prompt you to enter a value or a carriage return. debug COMMAND.COM -e 4D7D "DATER" -e 4D82 xxxx:4D82 01.00 DB.2E 15.26 -w -q Patch 5: Replace the MKDIR command, since most people use MD anyway, -------- with a new command. The new command TIMER may be used to display the current time; unlike the TIME command, the TIMER command will not prompt you to enter a value or a carriage return. debug COMMAND.COM -e 4D8C "TIMER" -e 4D91 xxxx:4D91 01.00 1E.DF 16.1E -w -q - 4 - Patch 6: Disables the printing of an automatic header for DOS FIND -------- ren FIND.EXE FIND.TMP debug FIND.TMP -e 0424 xxxx:0424 03.2C -w -q ren FIND.TMP FIND.EXE Patch 7: Permit more than 10 mismatches in DOS COMP -------- debug COMP.COM -e 08E2 xxxx:08E2 0A.32 ;This patch allows for 50 mismatches -e 0BF8 xxxx:0BF8 31.35 -w -q Patch 8: Changing the size of the default environment. -------- debug COMMAND.COM -e 0D11 xxxx:0D11 0A.1E ;Set size to 544 bytes, use X'3C' for 1K bytes -w -q Patch 9: Alter ANSI.SYS to disable the wait for retrace and the screen -------- blanking. debug ANSI.SYS -e 02E3 xxxx:02E3 74.90 FB.90 -e 02EA xxxx:02EA EE.90 -w -q - 5 - Patch 10: Disables automatic creation of the .BAK files by EDLIN --------- debug EDLIN.COM -e 0CD5 xxxx:0CD5 56.41 -w -q Patch 11: Automatic installation of printer port for DOS PRINT --------- debug PRINT.COM -e 10CA 4 "LPT1" ;Specify the printer port you want to use -e 1788 xxxx:1788 E8.90 CB.90 02.90 -e 179A xxxx:179A CD.90 21.90 -w -q - 6 - Patch 12: Changing the size of the Fixed Disk Cluster from 4K to 2K. --------- This is a useful change if you keep many small files. Typically, you will free up about 10% of the disk space you are currently using. NOTE: THE FOLLOWING PROCEDURE WILL DESTROY ALL DATA ON THE FIXED DISK!!! You will need: 1) IBM PC DOS 3.1 (will not work with 3.0) 2) A disk utility such as DISK REPAIR (a part of the IBM PROFESSIONAL DEBUG FACILITY) or DEBUG The following steps must be performed to convert the cluster size from 4K to 2K without losing your data. 1) BACKUP everything on the FIXED DISK using the DOS BACKUP command which comes with your current version of DOS. 2) Perform a COLD boot using a DOS 3.1 system diskette in drive A, and then run FDISK against the FIXED DISK to create and/or verify that a DOS partition exist. 3) FORMAT the FIXED DISK using the DOS 3.1 FORMAT command. DO NOT USE ANY PARAMETERS ON THE FORMAT COMMAND EXCEPT THE DRIVE IDENTIFIER. 4) Using your disk utility, select the boot sector and view it. If you are using the DOS DEBUG command, you will have to use the L command to read the boot sector into memory, and the W command to write the modified boot sector back to the FIXED DISK. (See below for an explanation of the pertinent information in this sector.) At location AA (offset X'0D') is the value for the number of sectors per cluster. It should be X'08', this value should be changed to X'04'. At location BB (offset X'16') is the value for the number of sectors per FAT. It should be X'0800', this value should be changed to X'1500'. The results of the above two changes should appear as in CC and DD below. The FIXED DISK will be reformatted to match the new description in the boot sector in step 6. - 7 - A Layout of the Boot Sector --------------------------- An example of the first few bytes in the boot sector of the FIXED DISK displayed in HEX format both before and after applying the alterations to convert from 4K clusters to 2K clusters. (The bytes of interest are located at boot sector offset X'0D' for sectors per cluster, and X'16' for sectors per FAT.) Original Boot Sector: EB299049 424D2020 332E3100 02080100 020002F3 50F80800 ^^ ^^^^ AA BB After applying changes: EB299049 424D2020 332E3100 02040100 020002F3 50F81500 ^^ ^^^^ CC DD Where the data elements directly above AA are sectors per cluster, and above BB are sectors per FAT. Modifying the Boot Sector with DEBUG ------------------------------------ If you are using the DOS DEBUG command to alter the boot sector, you will need to use the following instructions to accomplish the task. DEBUG -l 0 N 0 1 -e 000D xxxx:000D 08.04 -e 0016 xxxx:0016 08.15 -w 0 N 0 1 -q Where N = the FIXED DISK drive as follows: If fixed disk is drive B then N = 1 " C " N = 2 " D " N = 3 " E " N = 4 - 8 - A more detailed explanation of these two changes ------------------------------------------------ The number of sectors per cluster will be changed from 08 to 04, since that's what this is all about. The size of the FAT entries will be changed from the 12 bit into the 16 bit format to allow DOS to address all the additional clusters created by this process, and the number of sectors per FAT will be increased to accommodate both the larger size FAT entries, and the increased number of FAT entries. 5) Exit the disk utility and perform a COLD boot with the same DOS 3.1 diskette. You must perform the COLD boot since the boot sector is read by DOS only once, at boot time, in order to build the BIOS Parameter Block. Having different information in the boot sector than what's in the memory resident BPB will give unpredictable results. 6) Reformat the FIXED DISK using the DOS 3.1 FORMAT command. Now you may use any parameters to format the disk any way you like. The DOS 3.1 FORMAT command will not affect the changes you have made to the boot sector. (This is not so in DOS 3.0 which will rewrite the boot sector.) 7) Now you may RESTORE you files using the DOS RESTORE command with the /P option. This option is required to force DOS to prompt you prior to restoring a file. There are three files which you do not want to have restored back onto your FIXED DISK, they are IBMBIO.COM, IBMDOS.COM, and COMMAND.COM. If you do allow COMMAND.COM to be restored, make sure it is a DOS 3.1 version of COMMAND.COM. Otherwise, you will have to copy in the correct version of COMMAND.COM on to you FIXED DISK. If you allow either IBMBIO.COM or IBMDOS.COM to be restored, YOU WILL NOT BE ABLE TO BOOT OFF YOUR FIXED DISK, EVEN IF THESE ARE DOS 3.1 SYSTEM FILES. These files will be placed into the wrong location by DOS RESTORE, and you will have to reformat your FIXED DISK.