diff options
| author | 2024-04-25 21:24:10 +0100 | |
|---|---|---|
| committer | 2024-04-25 22:32:27 +0000 | |
| commit | 2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch) | |
| tree | 80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/CMD/CHKDSK | |
| parent | Merge pull request #430 from jpbaltazar/typoptbr (diff) | |
| download | ms-dos-main.tar.gz ms-dos-main.tar.xz ms-dos-main.zip | |
Diffstat (limited to 'v4.0/src/CMD/CHKDSK')
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKCHNG.INC | 288 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKDATA.INC | 244 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKDISK.ASM | 328 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKDISP.ASM | 139 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKDSK.FLS | 7 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKDSK.LNK | 12 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKDSK.SKL | 82 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKDSK1.ASM | 682 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKDSK2.ASM | 449 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKEQU.INC | 206 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKFAT.ASM | 1064 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKINIT.ASM | 1548 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKMACRO.INC | 105 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKMSG.INC | 1047 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKPARSE.INC | 285 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKPRMT.ASM | 93 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKPROC.ASM | 1892 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKPROC2.ASM | 479 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKSEG.INC | 21 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/MAKEFILE | 94 | ||||
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/PATHMAC.INC | 32 |
21 files changed, 9097 insertions, 0 deletions
diff --git a/v4.0/src/CMD/CHKDSK/CHKCHNG.INC b/v4.0/src/CMD/CHKDSK/CHKCHNG.INC new file mode 100644 index 0000000..46f7991 --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKCHNG.INC | |||
| @@ -0,0 +1,288 @@ | |||
| 1 | .xlist | ||
| 2 | ; | ||
| 3 | ; | ||
| 4 | |||
| 5 | ; CHKDSK Version 2.0 | ||
| 6 | ; Verifies and repairs MS-DOS disk directory. | ||
| 7 | |||
| 8 | |||
| 9 | ;REV 1.1 ARR | ||
| 10 | ; 05/21/82 Added rev number | ||
| 11 | ;REV 1.5 NP ARR | ||
| 12 | ; Mod by NANCYP to report on extents | ||
| 13 | ; Mod by AARONR to report volume ID | ||
| 14 | ;REV 2.0 ARR | ||
| 15 | ; Total rewrite for directories | ||
| 16 | ;REV 2.1 ARR | ||
| 17 | ; Added ^C and INT 24H handlers | ||
| 18 | ;REV 2.2 ARR | ||
| 19 | ; INTERNATIONAL support | ||
| 20 | ;REV 2.3 NP | ||
| 21 | ; Mod by NANCYP to use 2.0 system calls | ||
| 22 | ; and accept pathnames as parameters | ||
| 23 | ;REV 2.4 NP | ||
| 24 | ; PRINTF incorporated into CHKDSK | ||
| 25 | ; Modified to run as .EXE file | ||
| 26 | ;REV 3.0 ARR 8/30/83 | ||
| 27 | ; Update for vers 2.5 of DOS | ||
| 28 | ; 16 bit FATS | ||
| 29 | ;REV 3.05 RS 10/11/84 | ||
| 30 | ; Split into CHKDSK2.ASM for on-machine assembly. | ||
| 31 | ;REV 3.20 RS 9/26/85 | ||
| 32 | ; Allow 0F0H as a valid DOS media descriptor byte - used for non-standard | ||
| 33 | ; media layouts. | ||
| 34 | ; | ||
| 35 | ;***************************************************************************** | ||
| 36 | ;* * | ||
| 37 | ;* Change list to CHKDSK modules * | ||
| 38 | ;* * | ||
| 39 | ;* Lines are tagged ANxxx for new, ACxxx for changed * | ||
| 40 | ;* --------------------------------------------------------------------------* | ||
| 41 | ;* 000 - DOS 4.00 Spec additions and DCR's thru unit/function test * | ||
| 42 | ;* Date: 8/3/87 Developer: MT * | ||
| 43 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 44 | ;* 001 - DOS 4.00 PTM P265 - Give 'Can't chkdsk subst drive" when running * | ||
| 45 | ;* hardfile. Using 1 based drive insted of 0 * | ||
| 46 | ;* Date: 8/17/87 Developer: Mark T. * | ||
| 47 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 48 | ;* 002 - DOS 4.00 PTM P251 - Hang when chkdsk default drive. Not setting up * | ||
| 49 | ;* drive fields correctly on default drive * | ||
| 50 | ;* Date: 8/14/87 Developer: Mark T. * | ||
| 51 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 52 | ;* * | ||
| 53 | ;* * | ||
| 54 | ;* * | ||
| 55 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 56 | ;* * | ||
| 57 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 58 | ;* 005 - DOS 4.00 DCR D166 - Enable 128k FAT * | ||
| 59 | ;* Date: 8/21/87 Developer: Bruce B. * | ||
| 60 | ;* general modifications are: reserve the rest of the program segment for the* | ||
| 61 | ;* stack, put the fat-table next after the end of the program seg, then * | ||
| 62 | ;* put the fatmap area next after the end of the fat-table. * | ||
| 63 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 64 | ;* 006 - DOS 4.00 ptm p097 - change calculation of total disk space * | ||
| 65 | ;* Date: 8/28/87 Developer: Bruce B. * | ||
| 66 | ;* modules - chkinit.sal, chkdsk2.sal * | ||
| 67 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 68 | ;* 007 - DOS 4.00 ptm p816 - files with length zero * | ||
| 69 | ;* Date: 8/21/87 Developer: Bruce B. * | ||
| 70 | ;* modules - chkproc.sal * | ||
| 71 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 72 | ;* 008 - DOS 4.00 ptm p872 - incorrect media size reported * | ||
| 73 | ;* Date: 9/10/87 Developer: Bruce B. * | ||
| 74 | ;* modules - chkinit.sal * | ||
| 75 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 76 | ;* 009 - DOS 4.00 ptm p1151- incorrect date and time * | ||
| 77 | ;* Date: 9/10/87 Developer: Bruce B. * | ||
| 78 | ;* modules - chkdsk1.sal * | ||
| 79 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 80 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 81 | ;* 010 - DOS 4.00 ptm p1158- incorrect disk size when disk is full * | ||
| 82 | ;* Date: 9/10/87 Developer: Bruce B. * | ||
| 83 | ;* modules - chkfat.sal * | ||
| 84 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 85 | ;* 011 - DOS 4.00 ptm p817 - cant check files * | ||
| 86 | ;* Date: 9/24/87 Developer: Bruce B. * | ||
| 87 | ;* modules - chkdsk1.sal * | ||
| 88 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 89 | ;* 012 - DOS 4.00 ptm p1223- month and day reversed * | ||
| 90 | ;* Date: 9/22/87 Developer: Bruce B. * | ||
| 91 | ;* modules - chkdsk1.sal * | ||
| 92 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 93 | ;* 013 - DOS 4.00 ptm p1238- not detect filesize <> number of clusters * | ||
| 94 | ;* Date: 9/25/87 Developer: Bruce B. * | ||
| 95 | ;* modules - chkproc.sal, chkdisk.sal * | ||
| 96 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 97 | ;* - DOS 4.00 ptm p1239- hangs when file has invalid ??? * | ||
| 98 | ;* Date: 9/25/87 Developer: Bruce B. * | ||
| 99 | ;* modules - chkproc.sal, chkdisk.sal * | ||
| 100 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 101 | ;* 014 - DOS 4.00 ptm p1240- not detect crosslinked files * | ||
| 102 | ;* Date: 9/25/87 Developer: Bruce B. * | ||
| 103 | ;* modules - chkproc.sal, chkfat.sal * | ||
| 104 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 105 | ;* - DOS 4.00 ptm p1241- hangs when trying to fix lost subdir * | ||
| 106 | ;* Date: 9/25/87 Developer: Bruce B. * | ||
| 107 | ;* modules - chkproc.sal, chkfat.sal * | ||
| 108 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 109 | ;* - DOS 4.00 ptm p1242- hangs when lost subdir found * | ||
| 110 | ;* Date: 9/25/87 Developer: Bruce B. * | ||
| 111 | ;* modules - chkproc.sal, chkfat.sal * | ||
| 112 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 113 | ;* 015 - DOS 4.00 ptm p1176 - not working for vdisk drives * | ||
| 114 | ;* Date: 10/1/87 Developer: Bruce B. * | ||
| 115 | ;* modules - chkinit.sal * | ||
| 116 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 117 | ;* 016 - DOS 4.00 ptm p1436 - not working for full disk with system files * | ||
| 118 | ;* Date: 10/2/87 Developer: Bruce B. * | ||
| 119 | ;* modules - chkproc.sal * | ||
| 120 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 121 | ;* - DOS 4.00 ptm p1437 - not working on vdisk * | ||
| 122 | ;* Date: 10/2/87 Developer: Bruce B. * | ||
| 123 | ;* modules - chkproc.sal * | ||
| 124 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 125 | ;* - DOS 4.00 ptm p1447 - chkdsk filenam --> invalid drive spec * | ||
| 126 | ;* Date: 10/2/87 Developer: Bruce B. * | ||
| 127 | ;* modules - chkproc.sal * | ||
| 128 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 129 | ;* 017 - DOS 4.00 ptm p1491 - invalid use of common msgs * | ||
| 130 | ;* Date: 10/5/87 Developer: Bruce B. * | ||
| 131 | ;* modules - chkdsk.skl chkmsg.inc * | ||
| 132 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 133 | ;* 018 - DOS 4.00 ptm p1507 - 'non_dos' instead of 'non-dos' * | ||
| 134 | ;* Date: 10/6/87 Developer: Bruce B. * | ||
| 135 | ;* modules - chkdsk.skl * | ||
| 136 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 137 | ;* 019 - DOS 4.00 ptm p1506 - '0 bytes would be freed' * | ||
| 138 | ;* Date: 10/6/87 Developer: Bruce B. * | ||
| 139 | ;* modules - * | ||
| 140 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 141 | ;* 020 - DOS 4.00 ptm p1556 - chkdsk allows 2 positional or keyword parms * | ||
| 142 | ;* Date: 10/8/87 Developer: Bruce B. * | ||
| 143 | ;* modules - chkparse.inc * | ||
| 144 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 145 | ;* 021 - DOS 4.00 ptm p1557 - displays invalid drive spec twice * | ||
| 146 | ;* Date: 10/8/87 Developer: Bruce B. * | ||
| 147 | ;* modules - chkinit.sal * | ||
| 148 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 149 | ;* 022 - DOS 4.00 ptm p1558 - divide overflow on invalid drive * | ||
| 150 | ;* Date: 10/8/87 Developer: Bruce B. * | ||
| 151 | ;* modules - chkinit.sal * | ||
| 152 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 153 | ;* 023 - DOS 4.00 ptm p1559 - abnormal results when int13 is bad * | ||
| 154 | ;* Date: 10/8/87 Developer: Bruce B. * | ||
| 155 | ;* modules - * | ||
| 156 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 157 | ;* 024 - DOS 4.00 ptm p1606 - no display of volume serial number * | ||
| 158 | ;* Date: 10/12/87 Developer: Bruce B. * | ||
| 159 | ;* modules - chkdsk2.sal, chkmsg.inc * | ||
| 160 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 161 | ;* 025 - DOS 4.00 ptm p1761 - doesnt work on zerod out cluster for dir * | ||
| 162 | ;* Date: 10/17/87 Developer: Bruce B. * | ||
| 163 | ;* modules - chkproc.sal * | ||
| 164 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 165 | ;* 026 - DOS 4.00 ptm p1842 - chkdsk accepts 2 filespec parms * | ||
| 166 | ;* Date: 10/20/87 Developer: Bruce B. * | ||
| 167 | ;* modules - chkinit.sal, chkparse.inc * | ||
| 168 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 169 | ;* 027 - DOS 4.00 ptm p2007 - test case 7 - chkdsk a: /v (invalid subdirs) * | ||
| 170 | ;* Date: 10/24/87 Developer: Bruce B. * | ||
| 171 | ;* modules - chkproc.sal * | ||
| 172 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 173 | ;* 028 - DOS 4.00 ptm p2029 - chkdsk cant exec for afs * | ||
| 174 | ;* Date: 10/26/87 Developer: Bruce B. * | ||
| 175 | ;* modules - chkexec.sal * | ||
| 176 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 177 | ;* 029 - DOS 4.00 ptm p2104 - chkdsk goes to drive a: on ctl-break * | ||
| 178 | ;* Date: 10/29/87 Developer: Bruce B. * | ||
| 179 | ;* modules - chkfat.sal * | ||
| 180 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 181 | ;* 030 - DOS 4.00 ptm p2323 - low memory check, correct free memory report * | ||
| 182 | ;* Date: 11/04/87 Developer: Bruce B. * | ||
| 183 | ;* modules - chkfat.sal, chkdsk2.sal * | ||
| 184 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 185 | ;* 031 - DOS 4.00 ptm p2495 - incorrect message for drive not ready * | ||
| 186 | ;* Date: 11/17/87 Developer: Bruce B. * | ||
| 187 | ;* modules - chkinit.sal * | ||
| 188 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 189 | ;* 032 - DOS 4.00 ptm p2648 - unformatted disk displays "invalid device type" * | ||
| 190 | ;* Date: 11/24/87 Developer: Bruce B. * | ||
| 191 | ;* modules - chkinit.sal * | ||
| 192 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 193 | ;* 033 - DOS 4.00 ptm p2781 - divide overflow on unformatted diskette * | ||
| 194 | ;* Date: 12/07/87 Developer: Bruce B. * | ||
| 195 | ;* modules - chkinit.sal * | ||
| 196 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 197 | ;* 034 - DOS 4.00 ptm p2975 - get psp done three times * | ||
| 198 | ;* Date: 12/20/87 Developer: Bruce B. * | ||
| 199 | ;* modules - chkinit.sal, chkdsk1.sal * | ||
| 200 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 201 | ;* 035 - DOS 4.00 ptm p3007 - chkdsk reports incorrect memory * | ||
| 202 | ;* Date: 12/28/87 Developer: Bruce B. * | ||
| 203 | ;* modules - chkinit.sal, chkdsk1.sal * | ||
| 204 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 205 | ;* 036 - DOS 4.00 ptm p3028 - include pathgen into pgm * | ||
| 206 | ;* Date: 01/12/88 Developer: Bruce B. * | ||
| 207 | ;* modules - all * | ||
| 208 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 209 | ;* 037 - DOS 4.00 ptm p3129 - chkdsk fails to build * | ||
| 210 | ;* Date: 01/14/88 Developer: Bruce B. * | ||
| 211 | ;* modules - chkdisp.asm * | ||
| 212 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 213 | ;* 038 - DOS 4.00 ptm p3130 - remove AFS from code * | ||
| 214 | ;* Date: 01/14/88 Developer: Bruce B. * | ||
| 215 | ;* modules - chkinit.sal, chkequ.inc, chkexec.sal * | ||
| 216 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 217 | ;* 039 - DOS 4.00 ptm p3360 - correct addressing of ctl-break handling * | ||
| 218 | ;* Date: 02/05/88 Developer: Bruce B. * | ||
| 219 | ;* modules - chkproc2.sal * | ||
| 220 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 221 | ;* 040 - DOS 4.00 ptm p3573 - pathgen parser and msg ret. * | ||
| 222 | ;* Date: 02/19/88 Developer: Bruce B * | ||
| 223 | ;* modules - chkdisp.asm, chkparse.inc * | ||
| 224 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 225 | ;* 041 - DOS 4.00 dcr d490 - change get media id call for same as os/2 1.0 * | ||
| 226 | ;* Date: 02/26/88 Developer: Bruce B * | ||
| 227 | ;* modules - chkdata.inc, chkdsk1.sal * | ||
| 228 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 229 | ;* 042 - DOS 4.00 ptm p3735 - chkdsk prints files to stderr, not stdout * | ||
| 230 | ;* Date: 03/04/88 Developer: Bruce B * | ||
| 231 | ;* modules - chkmsg.inc * | ||
| 232 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 233 | ;* 043 - DOS 4.00 ptm p3708 - chkdsk prints wrong message for network drive * | ||
| 234 | ;* Date: 03/07/88 Developer: Bruce B * | ||
| 235 | ;* modules - chkinit.sal * | ||
| 236 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 237 | ;* 044 - DOS 4.00 ptm p3840 - wrong message for newtork filename * | ||
| 238 | ;* Date: 03/14/88 Developer: Bruce B * | ||
| 239 | ;* modules - chkinit.sal * | ||
| 240 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 241 | ;* 045 - DOS 4.00 ptm p3876 - hang when .. entry erased and /f parameter * | ||
| 242 | ;* Date: 03/15/88 Developer: Bruce B * | ||
| 243 | ;* modules - chkproc.sal, chkdsk2.sal, chkmsg.inc, chkfat.sal * | ||
| 244 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 245 | ;* 046 - DOS 4.00 ptm p3923?- display invalid parm names * | ||
| 246 | ;* Date: 03/21/88 Developer: Bruce B * | ||
| 247 | ;* modules - chkinit.sal, chkmsg.inc * | ||
| 248 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 249 | ;* 047 - private build only- display lost cluster number * | ||
| 250 | ;* Date: 03/24/88 Developer: Bruce B * | ||
| 251 | ;* modules - chkfat.sal * | ||
| 252 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 253 | ;* 048 - DOS 4.00 PTM p4050 - wont recover . and .. entries * | ||
| 254 | ;* Date: 04/12/88 Developer: Bruce B * | ||
| 255 | ;* modules - many * | ||
| 256 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 257 | ;* 049 - DOS 4.00 PTM p4125 - chkdsk prints incorrect user file bytes * | ||
| 258 | ;* Date: 04/13/88 Developer: Bruce B. * | ||
| 259 | ;* modules - many * | ||
| 260 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 261 | ;* 050 - DOS 4.00 PTM p4571 - chkdsk and mem report diff ram under Windows * | ||
| 262 | ;* Date: 05/02/88 Developer: Bruce B. * | ||
| 263 | ;* modules - chkdsk1.sal * | ||
| 264 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 265 | ;* 051 - DOS 4.00 PTM p4571 - chkdsk does not recover lost clusters into files* | ||
| 266 | ;* Date: 05/05/88 Developer: Bruce B. * | ||
| 267 | ;* modules - chkfat.sal * | ||
| 268 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 269 | ;* 052 - DOS 4.00 PTM p4869 - handle MS ramdrive.sys * | ||
| 270 | ;* Date: 05/16/88 Developer: Bruce B. * | ||
| 271 | ;* modules - chkinit.sal * | ||
| 272 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 273 | ;* 053 - DOS 4.00 PTM p4924 - oops! do it right this time.... * | ||
| 274 | ;* Date: 05/19/88 Developer: Bruce B. * | ||
| 275 | ;* modules - chkinit.sal * | ||
| 276 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 277 | ;* 054 - DOS 4.00 PTM p4957 - both chkdsk & mem do avail mem incorrectly * | ||
| 278 | ;* Date: 05/24/88 Developer: Bruce B. * | ||
| 279 | ;* modules - chkdsk1.sal * | ||
| 280 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 281 | ;* 055 - DOS 4.00 PTM p5007 - wont handle '\' as 2nd byte of dbcs pair * | ||
| 282 | ;* Date: 06/01/88 Developer: Bruce B * | ||
| 283 | ;* modules - chkdsk1.sal, chkinit.sal * | ||
| 284 | ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * | ||
| 285 | ;* * | ||
| 286 | ;***************************************************************************** | ||
| 287 | ;* Note: This is file CHKCHNG.INC for updating purposes * | ||
| 288 | ;***************************************************************************** | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKDATA.INC b/v4.0/src/CMD/CHKDSK/CHKDATA.INC new file mode 100644 index 0000000..aeb1ffe --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKDATA.INC | |||
| @@ -0,0 +1,244 @@ | |||
| 1 | |||
| 2 | CONST SEGMENT PUBLIC PARA 'DATA' | ||
| 3 | EXTRN STACKMES:byte | ||
| 4 | EXTRN BADVER:byte, BADDRV_ARG:word, INVPATH_ARG:word | ||
| 5 | EXTRN FILE_ARG:word | ||
| 6 | EXTRN BADCD_ARG:word, BADSUBDIR:byte | ||
| 7 | EXTRN no_mem_arg:word ;an030;bgb | ||
| 8 | EXTRN BADRDMES:byte | ||
| 9 | EXTRN BADDRVM:byte | ||
| 10 | EXTRN BADIDBYT:byte | ||
| 11 | EXTRN OPNERR_ARG:word, NOEXT_ARG:word, EXTENT_ARG:word | ||
| 12 | EXTRN IDMES_ARG:WORD | ||
| 13 | EXTRN ORPH_ARG:WORD | ||
| 14 | EXTRN FILE_ARG1:WORD, FILE_ARG2:WORD | ||
| 15 | EXTRN badrw_num:word, BADRW_STR:WORD, BLOCK_NUM:WORD | ||
| 16 | EXTRN FATAL_ARG1:WORD, FATAL_ARG2:WORD | ||
| 17 | EXTRN FATmsg2:word ;an024;bgb | ||
| 18 | EXTRN BADSW_ARG:WORD, DSKSPC:WORD ;an049;bgb | ||
| 19 | EXTRN HIDMES:WORD, DIRMES:WORD, FILEMES:WORD, ORPHMES2:WORD | ||
| 20 | EXTRN ORPHMES3:WORD, BADSPC:WORD, FRESPC:WORD | ||
| 21 | EXTRN FREMEM:WORD, REPORT_ARG:WORD, CRLF_ARG:WORD | ||
| 22 | EXTRN RARG1:WORD, RARG3:WORD, ORPHCNT:WORD | ||
| 23 | EXTRN NO_NET_ARG:byte, MONTAB:BYTE, SubstErr:BYTE | ||
| 24 | EXTRN ExitStatus:Byte,Badr_Arg:Byte ;an000;bgb | ||
| 25 | EXTRN Sublist_msg_Idmes:word ;an000;bgb | ||
| 26 | extrn msgserialnumber:byte ;an000;bgb | ||
| 27 | extrn psp_segment:word ;an000;bgb;an034;bgb | ||
| 28 | ;an000;bgb | ||
| 29 | PUBLIC SWITCHAR | ||
| 30 | PUBLIC TCHAR | ||
| 31 | PUBLIC HECODE | ||
| 32 | PUBLIC conbuf | ||
| 33 | PUBLIC DOTMES | ||
| 34 | PUBLIC NOISY | ||
| 35 | PUBLIC DOTENT | ||
| 36 | PUBLIC HAVFIX | ||
| 37 | PUBLIC DOFIX | ||
| 38 | PUBLIC DIRBUF | ||
| 39 | PUBLIC PARSTR, DDOTENT, NUL, ERRSUB, SECONDPASS, ALLFILE | ||
| 40 | PUBLIC ORPHFCB, ORPHEXT, HIDCNT, HIDSIZ, FILCNT, FILSIZ, DIRCNT | ||
| 41 | PUBLIC DIRSIZ, DIRTYFAT, CROSSCNT, BADSIZ, ORPHSIZ, LCLUS | ||
| 42 | PUBLIC USERDIR, FRAGMENT, ALLDRV, FIXMFLG, DIRCHAR | ||
| 43 | PUBLIC BIGFAT, EOFVAL, BADVAL,CHAIN_END | ||
| 44 | PUBLIC fTrunc,Volnam | ||
| 45 | PUBLIC temp_dd ;an049;bgb | ||
| 46 | |||
| 47 | DIRBUF LABEL BYTE ;Entry buffer for searches | ||
| 48 | VOLID DB -1,0,0,0,0,0,8 ;Volume ID FCB | ||
| 49 | VOLNAM DB 0,"???????????" | ||
| 50 | DB 25 DUP(0) | ||
| 51 | |||
| 52 | ALLFILE DB -1 ;Extended FCB indicator | ||
| 53 | DB 0,0,0,0,0 ;reserved bytes | ||
| 54 | DB 1EH ;attribute byte 0001-1110 hidden, system, label, subdir | ||
| 55 | ALLDRV DB 0 ;default drive | ||
| 56 | DB "???????????" ;any file name | ||
| 57 | DB 25 DUP (?) | ||
| 58 | |||
| 59 | ORPHFCB DB 0,"FILE0000" | ||
| 60 | ORPHEXT DB "CHK" | ||
| 61 | DB 25 DUP (?) | ||
| 62 | |||
| 63 | fcb_copy db 32 dup (?) | ||
| 64 | |||
| 65 | ;Non-message data | ||
| 66 | |||
| 67 | pFileName DW ? ; pointer | ||
| 68 | SWITCHAR DB "/" | ||
| 69 | ROOTSTR LABEL BYTE ;use this to change dir to the root | ||
| 70 | DIRCHAR DB "\" | ||
| 71 | NUL DB 0 | ||
| 72 | PARSTR DB "..",0 | ||
| 73 | DOTMES DB ".",0 | ||
| 74 | DOTENT DB ". " | ||
| 75 | DDOTENT DB ".. " | ||
| 76 | HECODE DB ? | ||
| 77 | FIXMFLG DB 0 ;Flag for printing fixmes | ||
| 78 | ERRSUB DW 0 ;Flag for bad subdir error | ||
| 79 | FRAGMENT DB 0 ;Flag for extent processing | ||
| 80 | DIR_FIX DB 0 ;Flag for changing dir back to users' | ||
| 81 | DIRTYFAT DB 0 ;Dirty flag for FAT | ||
| 82 | ; | ||
| 83 | ;note - all these fields that count allocation units can remain the same, | ||
| 84 | ; because the total au's are always less than 64k (1 word). | ||
| 85 | ; looks like the number of files and directories should change, though. | ||
| 86 | DIRCNT dd 0 ;# directories ;an049;bgb | ||
| 87 | DIRSIZ dw 0 ;# alloc units in dirs ;an049;bgb | ||
| 88 | FILCNT dd 0 ;# reg files | ||
| 89 | FILSIZ dw 0 ;# alloc units in reg files | ||
| 90 | HIDCNT dd 0 ;# hidden files | ||
| 91 | HIDSIZ dw 0 ;# alloc units in hid files | ||
| 92 | BADSIZ dw 0 ;# alloc units in bad sectors | ||
| 93 | ORPHSIZ dw 0 ;# alloc units in orphan files | ||
| 94 | LCLUS dw 0 ;# alloc units in lost clusters | ||
| 95 | DISPFLG DB 0 ;used by number routines | ||
| 96 | CROSSCNT dd 0 ;# crosslinked files (first pass) | ||
| 97 | ;end of display fields | ||
| 98 | ; | ||
| 99 | temp_dd dd 0 ;temporary double word field for orphcnt;an049;bgb | ||
| 100 | SECONDPASS DB 0 ;Pass flag | ||
| 101 | HAVFIX DB 0 ;non zero if any fixes | ||
| 102 | DOFIX DB 0 ;flag for F switch | ||
| 103 | NOISY DB 0 ;flag for V switch | ||
| 104 | BIGFAT DB 0 ;0=12 bit FAT, NZ=16bit FAT | ||
| 105 | EOFVAL DW 0FF8H ;0FF8 for 12 bit FAT,0FFF8 for 16 bit | ||
| 106 | CHAIN_END DW 0FFFH ;0FFF for 12 bit FAT,0FFFF for 16 bit ;AN000; | ||
| 107 | BADVAL DW 0FF7H ;0FF7 for 12 bit FAT,0FFF7 for 16 bit | ||
| 108 | |||
| 109 | mon_name db 3 dup (?),0 | ||
| 110 | TCHAR DB 'a' | ||
| 111 | USERDIR DB "\",0 ;Users current dir for drive | ||
| 112 | DB (DIRSTRLEN-1) DUP (?) | ||
| 113 | CONBUF DB 15,0 ;Input buffer | ||
| 114 | DB 15 DUP (?) | ||
| 115 | |||
| 116 | fTrunc DB FALSE ; TRUE => couldn't chdir, no freeing. | ||
| 117 | |||
| 118 | badread db " File allocation table bad",0 | ||
| 119 | CONST ENDS | ||
| 120 | |||
| 121 | |||
| 122 | |||
| 123 | |||
| 124 | |||
| 125 | |||
| 126 | |||
| 127 | |||
| 128 | DATA SEGMENT PUBLIC PARA 'DATA' | ||
| 129 | PUBLIC THISDPB,DOTSNOGOOD,NUL_ARG,STACKLIM,ZEROTRUNC | ||
| 130 | PUBLIC NAMBUF,SRFCBPT,fatmap,ISCROSS,MCLUS,CSIZE,SSIZE | ||
| 131 | PUBLIC DSIZE,ARG1,ARG_BUF,ERRCNT,USERDEV,SECBUF | ||
| 132 | PUBLIC HARDCH,CONTCH,PATH_NAME,TMP_SPC,mem_size | ||
| 133 | public Read_Write_Relative,Transrc, fatcnt, fattbl_seg ;an000;bgb | ||
| 134 | public firstfat, fatsiz, secs_per_64k, paras_per_fat, sec_count ;an000;bgb | ||
| 135 | public firstsec ;an047;bgb | ||
| 136 | public dirsec ;an047;bgb | ||
| 137 | public root_entries ;an047;bgb | ||
| 138 | public paras_per_64k, save_drive ;an000;bgb | ||
| 139 | public sernum ;an000;bgb;an024;bgb | ||
| 140 | ifdef fsexec ;an038;bgb | ||
| 141 | public exec_path ;an038;bgb;an000;bgb;an027;bgb | ||
| 142 | public exec_block ;an038;bgb;an000;bgb;an027;bgb | ||
| 143 | public path_string ;an038;bgb;an000;bgb;an027;bgb | ||
| 144 | endif ;an038;bgb | ||
| 145 | public end_of_fatmap ;an000;bgb;an030;bgb | ||
| 146 | public DBCS_VECTOR ;an055;bgb | ||
| 147 | public DBCS_VECTOR_off ;an055;bgb | ||
| 148 | public DBCS_VECTOR_seg ;an055;bgb | ||
| 149 | |||
| 150 | DBCS_VECTOR DB 0 | ||
| 151 | DBCS_VECTOR_off dw 0 | ||
| 152 | DBCS_VECTOR_seg dw 0 | ||
| 153 | |||
| 154 | ifdef fsexec ;an038;bgb | ||
| 155 | Exec_Block Exec_Block_Parms <> ;an038;bgb;an027;bgb | ||
| 156 | EXEC_Path db 66 dup(0) ;an038;bgb;an027;bgb | ||
| 157 | ;These next two should stay togather ;an027;bgb | ||
| 158 | ; --------------------------------------- ;an027;bgb | ||
| 159 | Path_String db "PATH=" ; ;an027;bgb | ||
| 160 | Len_Path_String equ $ - Path_String ; ;an027;bgb;AN000; | ||
| 161 | ;---------------------------------------- ;an027;bgb | ||
| 162 | endif ;an038;bgb | ||
| 163 | ;an038;bgb;an027;bgb | ||
| 164 | ;an027;bgb | ||
| 165 | ;These should stay togather ;an027;bgb | ||
| 166 | ; --------------------------------------- ;an027;bgb | ||
| 167 | ; ;an027;bgb | ||
| 168 | Search_Chkdsk db "KSDKHC" ; ;an027;bgb | ||
| 169 | Len_Search_Chkdsk equ $ - Search_Chkdsk ; ;an027;bgb | ||
| 170 | Search_Chkdsk_End equ $-1 ;an027;bgb | ||
| 171 | ; ;an027;bgb | ||
| 172 | ;---------------------------------------- ;an027;bgb | ||
| 173 | save_drive db 0 ;determines whether drive specified is valid | ||
| 174 | firstfat dw 0 ;sector number of fat ;an005;bgb | ||
| 175 | firstsec dw 0 ;sector number of data area ;an047;bgb | ||
| 176 | dirsec dw 0 ;sector number of dir area ;an047;bgb | ||
| 177 | root_entries dw 0 ;number of entries in root dir ;an047;bgb | ||
| 178 | fattbl_seg dw 0 ;segment of the fat-table ;an005;bgb | ||
| 179 | sec_count dw 0 ;sectors / 64k | ||
| 180 | secs_per_64k dw 0 ;an005;bgb | ||
| 181 | paras_per_64k dw 0 ;an005;bgb | ||
| 182 | fatsiz dw 0 ;an005;bgb | ||
| 183 | paras_per_fat dw 0 ;an005;bgb | ||
| 184 | fatcnt db 2 ;number of fats on disk ;an005;bgb | ||
| 185 | HARDCH dd ? ;Pointer to real INT 24 handler | ||
| 186 | CONTCH DD ? ;Pointer to real INT 23 handler | ||
| 187 | THISDPB DD ? ;Pointer to drive DPB | ||
| 188 | USERDEV DB ? ;Users current device | ||
| 189 | CSIZE DB ? ;Sectors per cluster 1-256 | ||
| 190 | SSIZE DW ? ;bytes per sector 1-64k | ||
| 191 | DSIZE DW ? ;# alloc units on disk | ||
| 192 | MCLUS DW ? ;DSIZE + 1 | ||
| 193 | NAMBUF DB 14 DUP (?) ;Buffer | ||
| 194 | DOTSNOGOOD DB ? ;. or .. error flag | ||
| 195 | ZEROTRUNC DB ? ;Trimming flag | ||
| 196 | ISCROSS DB ? ;Crosslink flag | ||
| 197 | OLDCLUS DW ? | ||
| 198 | SRFCBPT DW ? | ||
| 199 | fatmap DW ? ;segment of fatmap table ;an005;bgb | ||
| 200 | end_of_fatmap dw ? ;last mem segment used ;an030;bgb | ||
| 201 | SECBUF DW ? ;Offset of sector buffer (in ram) | ||
| 202 | ERRCNT DB ? ;Used by FATread and write | ||
| 203 | PATH_NAME DB 128 DUP(0) | ||
| 204 | FNAME_LEN DW 128 | ||
| 205 | NUL_ARG DB ? | ||
| 206 | ARG1 DW ? | ||
| 207 | ARG2 DW ? | ||
| 208 | ARG3 DW ? | ||
| 209 | |||
| 210 | |||
| 211 | ; | ||
| 212 | ; The following is used as a PRINTF buffer and also as the source/destination | ||
| 213 | ; for a name trans | ||
| 214 | ; | ||
| 215 | ARG_BUF DB 256 DUP (?) | ||
| 216 | TMP_SPC DB 128 DUP (?) | ||
| 217 | mon dw ? | ||
| 218 | day dw ? | ||
| 219 | year dw ? | ||
| 220 | mem_size dw ? | ||
| 221 | ;;;TRANSRC DB "A:CON",0,0 ; Device so we don't hit the drive | ||
| 222 | TRANSRC DB "A:\",0,0 ; Device so we don't hit the drive | ||
| 223 | Read_Write_Relative Relative_Sector_Buffer <> ; ;AN000; | ||
| 224 | |||
| 225 | STACKLIM DW ? ;Stack growth limit | ||
| 226 | INTERNATVARS internat_block <> | ||
| 227 | DB (internat_block_max - ($ - INTERNATVARS)) DUP (?) | ||
| 228 | |||
| 229 | |||
| 230 | ; Structure for Get_Media_Id ;an024;bgb | ||
| 231 | SerNumBuf Label Byte ;AN000;S GENERIC_IOCTL buffer ;an024;bgb | ||
| 232 | dw 0 ;AN000;S Info level (set on input) ;an024;bgb | ||
| 233 | SerNum dd 0 ;AN000;S Serial # ;an024;bgb | ||
| 234 | db 11 DUP(' ') ;AN000;S Volume label ;an024;bgb | ||
| 235 | db 8 DUP(' ') ;AN000;S File system type ;an024;bgb | ||
| 236 | DATA ENDS | ||
| 237 | |||
| 238 | ;an000;bgb | ||
| 239 | ;an000;bgb | ||
| 240 | lastseg SEGMENT PUBLIC PARA 'LAST' ;an000;bgb | ||
| 241 | public fattbl ;an000;bgb | ||
| 242 | fattbl db 0 ;this is the last thing in the pgm ;an000;bgb;an005;bgb | ||
| 243 | lastseg ends ;this is where the fat is put in ram ;an000;bgb | ||
| 244 | |||
diff --git a/v4.0/src/CMD/CHKDSK/CHKDISK.ASM b/v4.0/src/CMD/CHKDSK/CHKDISK.ASM new file mode 100644 index 0000000..c76be99 --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKDISK.ASM | |||
| @@ -0,0 +1,328 @@ | |||
| 1 | TITLE CHKDISK - procedures that read or write to the disk | ||
| 2 | page ,132 ; | ||
| 3 | |||
| 4 | .xlist | ||
| 5 | include chkseg.inc ;an005;bgb | ||
| 6 | INCLUDE CHKCHNG.INC | ||
| 7 | INCLUDE DOSSYM.INC | ||
| 8 | INCLUDE CHKEQU.INC | ||
| 9 | INCLUDE CHKMACRO.INC | ||
| 10 | include pathmac.inc | ||
| 11 | |||
| 12 | |||
| 13 | CONST SEGMENT PUBLIC PARA 'DATA' | ||
| 14 | EXTRN FIXMES_ARG:word | ||
| 15 | EXTRN BADW_ARG:word | ||
| 16 | EXTRN badrw_num:word,BADRW_STR:WORD,HAVFIX:byte | ||
| 17 | EXTRN DIRTYFAT:byte,DOFIX:byte,SECONDPASS:byte | ||
| 18 | EXTRN HECODE:byte,USERDIR:byte,FRAGMENT:byte | ||
| 19 | EXTRN ORPHEXT:byte,ALLDRV:byte,FIXMFLG:byte,DIRCHAR:byte | ||
| 20 | EXTRN EOFVAL:word,BADVAL:word | ||
| 21 | extrn fTrunc:BYTE | ||
| 22 | CONST ENDS | ||
| 23 | |||
| 24 | DATA SEGMENT PUBLIC PARA 'DATA' | ||
| 25 | EXTRN THISDPB:dword,NUL_ARG:byte | ||
| 26 | EXTRN NAMBUF:byte,SRFCBPT:word,FATMAP:word | ||
| 27 | EXTRN USERDEV:byte,HARDCH:dword,CONTCH:dword | ||
| 28 | EXTRN ExitStatus:Byte,Read_Write_Relative:Byte | ||
| 29 | extrn bytes_per_sector:word ;an005;bgb | ||
| 30 | extrn sec_count:word, paras_per_64k:word, secs_per_64k:word ;an005;bgb | ||
| 31 | extrn fattbl_seg:word, paras_per_fat:word ;an005;bgb | ||
| 32 | DATA ENDS | ||
| 33 | |||
| 34 | CODE SEGMENT PUBLIC PARA 'CODE' | ||
| 35 | ASSUME CS:DG,DS:DG,ES:DG,SS:DG | ||
| 36 | EXTRN FCB_TO_ASCZ:NEAR | ||
| 37 | EXTRN EPRINT:NEAR | ||
| 38 | EXTRN PROMPTYN:NEAR,DIRPROC:NEAR | ||
| 39 | EXTRN DOCRLF:NEAR,UNPACK:NEAR,PACK:NEAR | ||
| 40 | EXTRN CHECKNOFMES:NEAR | ||
| 41 | public read_disk, Read_once, write_disk, Write_once ;an005;bgb | ||
| 42 | public ReadFt, seg_adj, calc_sp64k ;an005;bgb | ||
| 43 | .list | ||
| 44 | |||
| 45 | |||
| 46 | pathlabl chkdisk | ||
| 47 | ;========================================================================= ;an005;bgb | ||
| 48 | ; READ_DISK : This routine reads the logical sector count requested. ;an005;bgb | ||
| 49 | ; It will read a maximum of 64k in one read. If more ;an005;bgb | ||
| 50 | ; than 64k exists it will continue looping until ;an005;bgb | ||
| 51 | ; all sectors have been read. ;an005;bgb | ||
| 52 | ; ;an005;bgb | ||
| 53 | ; Inputs : AL - Drive letter ;an005;bgb | ||
| 54 | ; ES:BX - Segment:offset of transfer address ;an005;bgb | ||
| 55 | ; CX - Sector count ;an005;bgb | ||
| 56 | ; DX - 1st sector ;an005;bgb | ||
| 57 | ; ;an005;bgb | ||
| 58 | ; Outputs : Logical sectors read ;an005;bgb | ||
| 59 | ; LOGIC ;an005;bgb | ||
| 60 | ; ***** ;an005;bgb | ||
| 61 | ; adjust es:bx to es:00 ;an005;bgb | ||
| 62 | ; calcluate sectors-per-64k (how many sectors are there that can fit within a 64k segment?) | ||
| 63 | ; DO while there are more sectors to read than sectors-per-64k ;an005;bgb | ||
| 64 | ; set sector-count to sectors-per-64k ;an005;bgb | ||
| 65 | ; perform the disk read ;an005;bgb | ||
| 66 | ; bump the seg addr to the new addr ;an005;bgb | ||
| 67 | ; dec the number of sectors to read by sectors-per-64k ;an005;bgb | ||
| 68 | ; bump the starting sector number by the sectors-per-64k ;an005;bgb | ||
| 69 | ; ENDDO ;an005;bgb | ||
| 70 | ; perform a disk read for less than sectors-per-64k ;an005;bgb | ||
| 71 | ;========================================================================= ;an005;bgb | ||
| 72 | procedure read_disk ;an005;bgb | ||
| 73 | savereg <ax,bx,cx,dx,es> ;an005;bgb | ||
| 74 | call seg_adj ;an000;calc new seg:off ;an005;bgb | ||
| 75 | call calc_sp64k ;an000;secs/64k ;an005;bgb | ||
| 76 | ; $DO ; do while more than 64k ;an005;bgb | ||
| 77 | $$DO1: | ||
| 78 | cmp cx,secs_per_64k ;an000;exceed 64k ;an005;bgb | ||
| 79 | ; $LEAVE LE ;an000;yes ;an005;bgb | ||
| 80 | JLE $$EN1 | ||
| 81 | mov sec_count,cx ;an000;save cx ;an005;bgb | ||
| 82 | mov cx,secs_per_64k ;an000;get maximum read ;an005;bgb | ||
| 83 | call read_once ;an000;read it ;an005;bgb | ||
| 84 | ; $LEAVE C ;an005;bgb | ||
| 85 | JC $$EN1 | ||
| 86 | mov cx,es ;an005;bgb | ||
| 87 | add cx,paras_per_64k ; adjust transfer area ;an005;bgb | ||
| 88 | mov es,cx ;an005;bgb | ||
| 89 | mov cx,sec_count ; restore sector count ;an005;bgb | ||
| 90 | sub cx,secs_per_64k ;an000;get sectors remaining ;an005;bgb | ||
| 91 | add dx,secs_per_64k ;an000;adjust starting sector ;an005;bgb | ||
| 92 | ; $ENDDO ;an005;bgb | ||
| 93 | JMP SHORT $$DO1 | ||
| 94 | $$EN1: | ||
| 95 | call read_once ;an000;read it ;an005;bgb | ||
| 96 | restorereg <es,dx,cx,bx,ax> ;an005;bgb | ||
| 97 | ret ;an005;bgb | ||
| 98 | read_disk endp ;an005;bgb | ||
| 99 | ;an005;bgb | ||
| 100 | ;an005;bgb | ||
| 101 | ;***************************************************************************** ;an005;bgb | ||
| 102 | ;Routine name: Read_once ;an005;bgb | ||
| 103 | ;***************************************************************************** ;an005;bgb | ||
| 104 | ; ;an005;bgb | ||
| 105 | ;description: Read in data using Generic IOCtl ;an005;bgb | ||
| 106 | ; ;an005;bgb | ||
| 107 | ;Called Procedures: None ;an005;bgb | ||
| 108 | ; ;an005;bgb | ||
| 109 | ; ;an005;bgb | ||
| 110 | ;Change History: Created 5/13/87 MT ;an005;bgb | ||
| 111 | ; ;an005;bgb | ||
| 112 | ;Input: AL = Drive number (0=A) ;an005;bgb | ||
| 113 | ; es:BX = Transfer address ;an005;bgb | ||
| 114 | ; CX = Number of sectors ;an005;bgb | ||
| 115 | ; Read_Write_Relative.Start_Sector_High = Number of sectors high ;an005;bgb | ||
| 116 | ; DX = logical sector number low ;an005;bgb | ||
| 117 | ; ;an005;bgb | ||
| 118 | ;Output: CY if error ;an005;bgb | ||
| 119 | ; AH = INT 25h error code ;an005;bgb | ||
| 120 | ; ;an005;bgb | ||
| 121 | ;Psuedocode ;an005;bgb | ||
| 122 | ;---------- ;an005;bgb | ||
| 123 | ; Save registers ;an005;bgb | ||
| 124 | ; Setup structure for function call ;an005;bgb | ||
| 125 | ; Read the disk (AX=440Dh, CL = 6Fh) ;an005;bgb | ||
| 126 | ; Restore registers ;an005;bgb | ||
| 127 | ; ret ;an005;bgb | ||
| 128 | ;***************************************************************************** ;an005;bgb | ||
| 129 | Procedure Read_once ; ;an005;bgb | ||
| 130 | savereg <ax,bx,cx,dx,si,di,bp,es,ds> ;Change it to Read relative sect;an005;bgb | ||
| 131 | mov Read_Write_Relative.Buffer_Offset,bx ;Get transfer buffer add ;an005;bgb | ||
| 132 | mov bx,es ; ;AN005;bgb | ||
| 133 | mov Read_Write_Relative.Buffer_Segment,bx ;Get segment ;an005;bgb | ||
| 134 | mov Read_Write_Relative.Number_Sectors,cx ;Number of sec to read ;an005;bgb | ||
| 135 | mov Read_Write_Relative.Start_Sector_Low,dx ;Start sector ;an005;bgb | ||
| 136 | mov bx,offset Read_Write_Relative ; ;an005;bgb | ||
| 137 | mov cx,0FFFFh ;Read relative sector ;an005;bgb | ||
| 138 | INT 25h ;Do the read ;an005;bgb | ||
| 139 | pop dx ;Throw away flags on stack ;an005;bgb | ||
| 140 | restorereg <ds,es,bp,di,si,dx,cx,bx,ax> ;an005;bgb | ||
| 141 | return ;an005;bgb | ||
| 142 | Read_once endp ;an005;bgb | ||
| 143 | ;an005;bgb | ||
| 144 | ;an005;bgb | ||
| 145 | ;========================================================================= ;an005;bgb | ||
| 146 | ; WRITE-DISK : This routine reads the logical sector count requested. ;an005;bgb | ||
| 147 | ; It will read a maximum of 64k in one read. If more ;an005;bgb | ||
| 148 | ; than 64k exists it will continue looping until ;an005;bgb | ||
| 149 | ; all sectors have been read. ;an005;bgb | ||
| 150 | ; ;an005;bgb | ||
| 151 | ; Inputs : AL - Drive letter ;an005;bgb | ||
| 152 | ; ES:BX - Segment:offset of transfer address ;an005;bgb | ||
| 153 | ; CX - Sector count ;an005;bgb | ||
| 154 | ; DX - 1st sector ;an005;bgb | ||
| 155 | ; ;an005;bgb | ||
| 156 | ; Outputs : Logical sectors read ;an005;bgb | ||
| 157 | ; LOGIC ;an005;bgb | ||
| 158 | ; ***** ;an005;bgb | ||
| 159 | ; adjust es:bx to es:00 ;an005;bgb | ||
| 160 | ; calcluate sectors-per-64k (how many sectors are there that can fit within a 64k segment?) | ||
| 161 | ; DO while there are more sectors to read than sectors-per-64k ;an005;bgb | ||
| 162 | ; set sector-count to sectors-per-64k ;an005;bgb | ||
| 163 | ; perform the disk read ;an005;bgb | ||
| 164 | ; bump the seg addr to the new addr ;an005;bgb | ||
| 165 | ; dec the number of sectors to read by sectors-per-64k ;an005;bgb | ||
| 166 | ; bump the starting sector number by the sectors-per-64k ;an005;bgb | ||
| 167 | ; ENDDO ;an005;bgb | ||
| 168 | ; perform a disk read for less than sectors-per-64k ;an005;bgb | ||
| 169 | ;========================================================================= ;an005;bgb | ||
| 170 | procedure write_disk ;an005;bgb | ||
| 171 | savereg <ax,bx,cx,dx,es> ;an013;bgb | ||
| 172 | call seg_adj ;an000;calc new seg:off ;an005;bgb | ||
| 173 | ; $DO ; do while more than 64k ;an005;bgb | ||
| 174 | $$DO5: | ||
| 175 | cmp cx,secs_per_64k ;an000;exceed 64k ;an005;bgb | ||
| 176 | ; $LEAVE LE ;an000;yes ;an005;bgb | ||
| 177 | JLE $$EN5 | ||
| 178 | mov sec_count,cx ;an000;save cx ;an005;bgb | ||
| 179 | mov cx,secs_per_64k ;an000;get maximum read ;an005;bgb | ||
| 180 | call write_once ;an000;read it ;an005;bgb | ||
| 181 | ; $LEAVE C ;an005;bgb | ||
| 182 | JC $$EN5 | ||
| 183 | mov cx,es ;an005;bgb | ||
| 184 | add cx,paras_per_64k ; adjust transfer area ;an005;bgb | ||
| 185 | mov es,cx ;an005;bgb | ||
| 186 | mov cx,sec_count ; restore sector count ;an005;bgb | ||
| 187 | sub cx,secs_per_64k ;an000;get sectors remaining ;an005;bgb | ||
| 188 | add dx,secs_per_64k ;an000;adjust starting sector ;an005;bgb | ||
| 189 | ; $ENDDO ;an005;bgb | ||
| 190 | JMP SHORT $$DO5 | ||
| 191 | $$EN5: | ||
| 192 | call write_once ;an000;read it ;an005;bgb | ||
| 193 | restorereg <es,dx,cx,bx,ax> ;an013;bgb | ||
| 194 | ret ;an005;bgb | ||
| 195 | write_disk endp ;an005;bgb | ||
| 196 | ;an005;bgb | ||
| 197 | ;***************************************************************************** ;an005;bgb | ||
| 198 | ;Routine name: Write_once ;an005;bgb | ||
| 199 | ;***************************************************************************** ;an005;bgb | ||
| 200 | ; ;an005;bgb | ||
| 201 | ;description: Write Data using int 26 ;an005;bgb | ||
| 202 | ; ;an005;bgb | ||
| 203 | ;Called Procedures: None ;an005;bgb | ||
| 204 | ; ;an005;bgb | ||
| 205 | ; ;an005;bgb | ||
| 206 | ;Change History: Created 5/13/87 MT ;an005;bgb | ||
| 207 | ; ;an005;bgb | ||
| 208 | ;Input: AL = Drive number (0=A) ;an005;bgb | ||
| 209 | ; DS:BX = Transfer address ;an005;bgb | ||
| 210 | ; CX = Number of sectors ;an005;bgb | ||
| 211 | ; Read_Write_Relative.Start_Sector_High = already set up ;an048;bgb | ||
| 212 | ; DX = logical sector number low ;an005;bgb | ||
| 213 | ; ;an005;bgb | ||
| 214 | ;Output: CY if error ;an005;bgb | ||
| 215 | ; AH = INT 26h error code ;an005;bgb | ||
| 216 | ; ;an005;bgb | ||
| 217 | ;Psuedocode ;an005;bgb | ||
| 218 | ;---------- ;an005;bgb | ||
| 219 | ; Save registers ;an005;bgb | ||
| 220 | ; Setup structure for function call ;an005;bgb | ||
| 221 | ; Write to disk (AX=440Dh, CL = 4Fh) ;an005;bgb | ||
| 222 | ; Restore registers ;an005;bgb | ||
| 223 | ; ret ;an005;bgb | ||
| 224 | ;***************************************************************************** ;an005;bgb | ||
| 225 | Procedure Write_once ; ;an005;bgb | ||
| 226 | savereg <ax,bx,cx,dx,di,si,bp,es,ds> ;This is setup for INT 26h right;AN005;bgb | ||
| 227 | mov Read_Write_Relative.Buffer_Offset,bx ;Get transfer buffer add ;AN005;bgb | ||
| 228 | mov bx,es ; ;AN005;bgb | ||
| 229 | mov Read_Write_Relative.Buffer_Segment,bx ;Get segment ;AN005;bgb | ||
| 230 | mov Read_Write_Relative.Number_Sectors,cx ;Number of sec to write ;AN005;bgb | ||
| 231 | mov Read_Write_Relative.Start_Sector_Low,dx ;Start sector ;AN005;bgb | ||
| 232 | mov cx,0FFFFh ;Write relative sector ;AN005;bgb | ||
| 233 | lea bx,read_write_relative ; ;an005;bgb | ||
| 234 | INT 026h ;Do the write ;AN005;bgb | ||
| 235 | pop dx ;flags is returned on the stack;AN005;bgb | ||
| 236 | restorereg <ds,es,bp,si,di,dx,cx,bx,ax> ; ;AN005;bgb | ||
| 237 | ret ; ;AN005;bgb | ||
| 238 | Write_once endp ; ;AN005;bgb | ||
| 239 | ;an005;bgb | ||
| 240 | ;========================================================================= ;an005;bgb | ||
| 241 | ; SEG_ADJ : This routine adjusts the segment:offset to prevent ;an005;bgb | ||
| 242 | ; address wrap. ;an005;bgb | ||
| 243 | ; ;an005;bgb | ||
| 244 | ; Inputs : bx - Offset to adjust segment with ;an005;bgb | ||
| 245 | ; es - Segment to be adjusted ;an005;bgb | ||
| 246 | ; ;an005;bgb | ||
| 247 | ; Outputs : bx - New offset ;an005;bgb | ||
| 248 | ; es - Adjusted segment ;an005;bgb | ||
| 249 | ;========================================================================= ;an005;bgb | ||
| 250 | procedure seg_adj ;an005;bgb | ||
| 251 | savereg <ax,cx,dx> ;an005;bgb | ||
| 252 | mov ax,bx ;an000;get offset ;an005;bgb | ||
| 253 | mov bx,0010h ;divide by 16 ;an005;bgb | ||
| 254 | xor dx,dx ;an000;clear dx ;an005;bgb | ||
| 255 | div bx ;an000;get para count ;an022;bgb | ||
| 256 | mov bx,es ;an000;get seg ;an005;bgb | ||
| 257 | add bx,ax ;an000;adjust for paras ;an005;bgb | ||
| 258 | mov es,bx ;an000;save new seg ;an005;bgb | ||
| 259 | mov bx,dx ;an000;new offset ;an005;bgb | ||
| 260 | restorereg <dx,cx,ax> ;an005;bgb | ||
| 261 | ret ;an005;bgb | ||
| 262 | seg_adj endp ;an005;bgb | ||
| 263 | ;an005;bgb | ||
| 264 | ;an005;bgb | ||
| 265 | ;========================================================================= ;an005;bgb | ||
| 266 | ; CALC_SP64K : This routine calculates how many sectors, for this ;an005;bgb | ||
| 267 | ; particular media, will fit into 64k. ;an005;bgb | ||
| 268 | ; ;an005;bgb | ||
| 269 | ; Inputs : DPB_SECTOR_SIZE - bytes/sector ;an005;bgb | ||
| 270 | ; ;an005;bgb | ||
| 271 | ; Outputs : SECS_PER_64K - Sectors / 64k ;an005;bgb | ||
| 272 | ; PARAS_PER_64K - paragraphs per 64k ;an005;bgb | ||
| 273 | ;========================================================================= ;an005;bgb | ||
| 274 | procedure calc_sp64k ;an005;bgb | ||
| 275 | savereg <ax,bx,cx,dx> ;an005;bgb | ||
| 276 | mov ax,0ffffh ;an000;64k ;an005;bgb | ||
| 277 | mov bx,bytes_per_sector ;an000;get bytes/sector ;an005;bgb | ||
| 278 | xor dx,dx ;an000;clear dx ;an005;bgb | ||
| 279 | div bx ;an000;sector count ;an022;bgb;bgb | ||
| 280 | mov secs_per_64k,ax ;an000;save sector count ;an005;bgb | ||
| 281 | mov ax,bytes_per_sector ;an000;get bytes/sector ;an005;bgb | ||
| 282 | mov bx,010h ; divide by paras ;an005;bgb | ||
| 283 | xor dx,dx ;an000;clear dx ;an005;bgb | ||
| 284 | div bx ; paras per sector ;an022;bgb;bgb | ||
| 285 | mul secs_per_64k ; times sectors ;an005;bgb | ||
| 286 | mov paras_per_64k,ax ; = paras per 64k ;an005;bgb | ||
| 287 | restorereg <dx,cx,bx,ax> ;an000;restore dx ;an005;bgb | ||
| 288 | ret ;an000; ;an005;bgb | ||
| 289 | calc_sp64k endp ;an000; ;an005;bgb | ||
| 290 | ;an005;bgb | ||
| 291 | ;an005;bgb | ||
| 292 | Break <ReadFT - read in the entire fat> ;an005;bgb | ||
| 293 | ;****************************************************************************** ;an005;bgb | ||
| 294 | ; ReadFt - attempt to read in the fat. If there are errors, step to ;an005;bgb | ||
| 295 | ; successive fats until no more. ;an005;bgb | ||
| 296 | ; ;an005;bgb | ||
| 297 | ; Inputs: none. ;an005;bgb | ||
| 298 | ; Outputs: Fats are read until one succeeds. ;an005;bgb | ||
| 299 | ; Carry set indicates no Fat could be read. ;an005;bgb | ||
| 300 | ; Registers modified: all ;an005;bgb | ||
| 301 | ; LOGIC ;an005;bgb | ||
| 302 | ; ***** ;an005;bgb | ||
| 303 | ; DO for each of the fats on the disk: ;an005;bgb | ||
| 304 | ; read - all the sectors in the fat ;an005;bgb | ||
| 305 | ; increase the starting sector by the number of sectors in each fat ;an005;bgb | ||
| 306 | ; ;an005;bgb | ||
| 307 | ; LARGE FAT SUPPORT - the big change here is in read disk. since the fat must ;an005;bgb | ||
| 308 | ; be within the first 32M, then the starting sector number of 65535 is ok, ;an005;bgb | ||
| 309 | ; as is a larger number of sectors to read/write. ;an005;bgb | ||
| 310 | ;****************************************************************************** ;an005;bgb | ||
| 311 | Procedure ReadFt,NEAR ;an005;bgb | ||
| 312 | clc ;Clear CY so we will loop ;an005;bgb | ||
| 313 | mov Read_Write_Relative.Start_Sector_High,0 ; ;an005;bgb | ||
| 314 | call Read_Disk ; Read_Disk (); ;AC0;an005;bgb | ||
| 315 | ; $IF C | ||
| 316 | JNC $$IF9 | ||
| 317 | add dx,cx ; fatstart += fatsize ;an005;bgb | ||
| 318 | call Read_Disk ; Read_Disk (); ;AC0;an005;bgb | ||
| 319 | ; $ENDIF | ||
| 320 | $$IF9: | ||
| 321 | bad_read: ret ;an005;bgb | ||
| 322 | EndProc ReadFt ;an005;bgb | ||
| 323 | |||
| 324 | |||
| 325 | pathlabl chkdisk | ||
| 326 | CODE ENDS | ||
| 327 | END | ||
| 328 | \ No newline at end of file | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKDISP.ASM b/v4.0/src/CMD/CHKDSK/CHKDISP.ASM new file mode 100644 index 0000000..e4d6ebc --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKDISP.ASM | |||
| @@ -0,0 +1,139 @@ | |||
| 1 | page ,132 ; ;an000;bgb | ||
| 2 | ;***************************************************************************** ;an000;bgb | ||
| 3 | ;***************************************************************************** ;an000;bgb | ||
| 4 | ;UTILITY NAME: FORMAT.COM ;an000;bgb | ||
| 5 | ; ;an000;bgb | ||
| 6 | ;MODULE NAME: DISPLAY.ASM ;an000;bgb | ||
| 7 | ; ;an000;bgb | ||
| 8 | ; ;an000;bgb | ||
| 9 | ; Designed: Mark T. ;an000;bgb | ||
| 10 | ; ;an000;bgb | ||
| 11 | ; Change List: AN000 - New code DOS 3.3 spec additions ;an000;bgb | ||
| 12 | ; AC000 - Changed code DOS 3.3 spec additions ;an000;bgb | ||
| 13 | ;***************************************************************************** ;an000;bgb | ||
| 14 | ;an000;bgb | ||
| 15 | EXTRN command_line_buffer:byte ;an000;bgb;an005;bgb | ||
| 16 | ;***************************************************************************** ;an000;bgb | ||
| 17 | ; Include Files ;an000;bgb | ||
| 18 | ;***************************************************************************** ;an000;bgb | ||
| 19 | .xlist ;an000;bgb | ||
| 20 | include pathmac.inc ;an040;bgb | ||
| 21 | include chkseg.inc ;an000;bgb | ||
| 22 | INCLUDE CPMFCB.INC ;an000;bgb | ||
| 23 | INCLUDE CHKEQU.INC ;an000;bgb | ||
| 24 | .list ;an000;bgb | ||
| 25 | INCLUDE CHKMSG.INC ;an000;bgb | ||
| 26 | .xlist ;an000;bgb | ||
| 27 | INCLUDE SYSMSG.INC ;an000;bgb | ||
| 28 | .list ;an000;bgb | ||
| 29 | ; ;an000;bgb | ||
| 30 | cstack segment para stack 'STACK' ;an000;bgb | ||
| 31 | db 62 dup ("-Stack!-") ; (362-80h) is the additional IBM ROM ;an000;bgb | ||
| 32 | cstack ends ;an000;bgb | ||
| 33 | ;an000;bgb | ||
| 34 | ;an000;bgb | ||
| 35 | ;***************************************************************************** ;an000;bgb | ||
| 36 | ; Message Services ;an000;bgb | ||
| 37 | ;***************************************************************************** ;an000;bgb | ||
| 38 | MSG_UTILNAME <CHKDSK> ;an000;bgb | ||
| 39 | ;an000;bgb | ||
| 40 | ;.xlist ;an000;bgb | ||
| 41 | data segment public para 'DATA' ;an000;bgb | ||
| 42 | Msg_Services <MSGDATA> ;an000;bgb | ||
| 43 | data ends ;an000;bgb | ||
| 44 | ;an000;bgb | ||
| 45 | code segment public para 'CODE' ;an000;bgb | ||
| 46 | pathlabl msgret ;an040;bgb | ||
| 47 | Msg_Services <NEARmsg> ;an000;bgb | ||
| 48 | Msg_Services <LOADmsg> ;an000;bgb | ||
| 49 | Msg_Services <DISPLAYmsg,CHARmsg,NUMmsg,TIMEmsg,DATEmsg> ;an000;bgb | ||
| 50 | pathlabl msgret ;an040;bgb | ||
| 51 | Msg_Services <CHKDSK.CLA,CHKDSK.CLB,CHKDSK.CLC,CHKDSK.CLD,CHKDSK.CL1,CHKDSK.CL2,CHKDSK.CTL> ;an037;bgb | ||
| 52 | code ends ;an000;bgb | ||
| 53 | .list ;an000;bgb | ||
| 54 | ;an000;bgb | ||
| 55 | ; ;an000;bgb | ||
| 56 | ;***************************************************************************** ;an000;bgb | ||
| 57 | ; Public Declarations ;an000;bgb | ||
| 58 | ;***************************************************************************** ;an000;bgb | ||
| 59 | Public SysLoadMsg ;an000;bgb | ||
| 60 | Public SysDispMsg ;an000;bgb | ||
| 61 | ;an000;bgb | ||
| 62 | ;an000;bgb | ||
| 63 | ; ;an000;bgb | ||
| 64 | ;*************************************************************************** ;an000;bgb | ||
| 65 | ; Message Structures ;an000;bgb | ||
| 66 | ;*************************************************************************** ;an000;bgb | ||
| 67 | Message_Table struc ; ;an000;bgb;AN000; | ||
| 68 | Entry1 dw 0 ; ;an000;bgb;AN000; | ||
| 69 | Entry2 dw 0 ; ;an000;bgb;AN000; | ||
| 70 | Entry3 dw 0 ; ;an000;bgb;AN000; | ||
| 71 | Entry4 dw 0 ; ;an000;bgb;AN000; | ||
| 72 | Entry5 db 0 ; ;an000;bgb;AN000; | ||
| 73 | Entry6 db 0 ; ;an000;bgb;AN000; | ||
| 74 | Entry7 dw 0 ; ;an000;bgb;AN000; | ||
| 75 | Message_Table ends ; ;an000;bgb;AN000; | ||
| 76 | ;an000;bgb | ||
| 77 | code segment public para 'CODE' ; ;an000;bgb;AN000; | ||
| 78 | ;***************************************************************************** ;an000;bgb | ||
| 79 | ;Routine name&gml Display_Interface ;an000;bgb | ||
| 80 | ;***************************************************************************** ;an000;bgb | ||
| 81 | ; ;an000;bgb | ||
| 82 | ;DescriptioN&gml Save all registers, set up registers required for SysDispMsg ;an000;bgb | ||
| 83 | ; routine. This information is contained in a message description ;an000;bgb | ||
| 84 | ; table pointed to by the DX register. Call SysDispMsg, then ;an000;bgb | ||
| 85 | ; restore registers. This routine assumes that the only time an ;an000;bgb | ||
| 86 | ; error will be returned is if an extended error message was ;an000;bgb | ||
| 87 | ; requested, so it will ignore error returns ;an000;bgb | ||
| 88 | ; ;an000;bgb | ||
| 89 | ;Called Procedures: Message (macro) ;an000;bgb | ||
| 90 | ; ;an000;bgb | ||
| 91 | ;Change History&gml Created 4/22/87 MT ;an000;bgb | ||
| 92 | ; ;an000;bgb | ||
| 93 | ;Input&gml ES&gmlDX = pointer to message description ;an000;bgb | ||
| 94 | ; ;an000;bgb | ||
| 95 | ;Output&gml None ;an000;bgb | ||
| 96 | ; ;an000;bgb | ||
| 97 | ;Psuedocode ;an000;bgb | ||
| 98 | ;---------- ;an000;bgb | ||
| 99 | ; ;an000;bgb | ||
| 100 | ; Save all registers ;an000;bgb | ||
| 101 | ; Setup registers for SysDispMsg from Message Description Tables ;an000;bgb | ||
| 102 | ; CALL SysDispMsg ;an000;bgb | ||
| 103 | ; Restore registers ;an000;bgb | ||
| 104 | ; ret ;an000;bgb | ||
| 105 | ;***************************************************************************** ;an000;bgb | ||
| 106 | Public Display_Interface ;an000;bgb | ||
| 107 | Display_Interface proc ; ;an000;bgb;AN000; | ||
| 108 | push ds ;an000;bgb | ||
| 109 | push ax ;an000;bgb | ||
| 110 | push bx ;an000;bgb | ||
| 111 | push cx ;an000;bgb | ||
| 112 | push dx ;an000;bgb | ||
| 113 | push si ;an000;bgb | ||
| 114 | push di ;an000;bgb | ||
| 115 | mov di,dx ;Change pointer to table ;an000;bgb;AN000; | ||
| 116 | mov dx,dg ;Point to group ;an000;bgb | ||
| 117 | mov ds,dx ; ;an000;bgb | ||
| 118 | mov ax,[di].Entry1 ;Message number ;an000;bgb;AN000; | ||
| 119 | mov bx,[di].Entry2 ;Handle ;an000;bgb;AN000; | ||
| 120 | mov si,[di].Entry3 ;Sublist ;an000;bgb;AN000; | ||
| 121 | mov cx,[di].Entry4 ;Count ;an000;bgb;AN000; | ||
| 122 | mov dh,[di].Entry5 ;Class ;an000;bgb;AN000; | ||
| 123 | mov dl,[di].Entry6 ;Function ;an000;bgb;AN000; | ||
| 124 | mov di,[di].Entry7 ;Input ;an000;bgb;AN000; | ||
| 125 | call SysDispMsg ;Display the message ;an000;bgb;AN000; | ||
| 126 | pop di ;an000;bgb | ||
| 127 | pop si ;an000;bgb | ||
| 128 | pop dx ;an000;bgb | ||
| 129 | pop cx ;an000;bgb | ||
| 130 | pop bx ;an000;bgb | ||
| 131 | pop ax ;an000;bgb | ||
| 132 | pop ds ;an000;bgb | ||
| 133 | ret ;All done ;an000;bgb;AN000; | ||
| 134 | Display_Interface endp ; ;an000;bgb;AN000; | ||
| 135 | ;an000;bgb | ||
| 136 | include msgdcl.inc | ||
| 137 | |||
| 138 | code ends ;an000;bgb | ||
| 139 | end ;an000;bgb | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKDSK.FLS b/v4.0/src/CMD/CHKDSK/CHKDSK.FLS new file mode 100644 index 0000000..43e0841 --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKDSK.FLS | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | CHKDSK1.ASM | ||
| 2 | CHKMES.ASM | ||
| 3 | CHKPRMT.ASM | ||
| 4 | CHKPROC.ASM | ||
| 5 | CHKPROC2.ASM | ||
| 6 | CHKDSK2.ASM | ||
| 7 | \ No newline at end of file | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKDSK.LNK b/v4.0/src/CMD/CHKDSK/CHKDSK.LNK new file mode 100644 index 0000000..25d94f5 --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKDSK.LNK | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | chkdisk+ | ||
| 2 | chkdisp+ | ||
| 3 | CHKDSK1+ | ||
| 4 | CHKDSK2+ | ||
| 5 | chkfat+ | ||
| 6 | CHKINIT+ | ||
| 7 | CHKPRMT+ | ||
| 8 | CHKPROC2+ | ||
| 9 | CHKPROC | ||
| 10 | CHKDSK.EXE,CHKDSK.MAP ; | ||
| 11 | ;chkexec+ ;an038;bgb | ||
| 12 | \ No newline at end of file | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKDSK.SKL b/v4.0/src/CMD/CHKDSK/CHKDSK.SKL new file mode 100644 index 0000000..cf2f149 --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKDSK.SKL | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | :util CHKDSK ;an000;bgb | ||
| 2 | ;an000;bgb | ||
| 3 | :class A ;an000;bgb | ||
| 4 | :use COMMON1 ;Incorrect DOS version ;an000;bgb | ||
| 5 | :use COMMON2 ;stackmes ;an000;bgb | ||
| 6 | :def 3 "Convert lost chains to files (Y/N)?" ;freemes ;an000;bgb | ||
| 7 | :def 4 "Unrecoverable error in directory" ;ptrandir ;an000;bgb | ||
| 8 | :def 5 "Convert directory to file (Y/N)?" ;ptrandir2 ;an000;bgb | ||
| 9 | :def 7 "%1 bytes total disk space" ;dskspc ;an000;bgb | ||
| 10 | :def 8 "%1 bytes in bad sectors" ;badspc ;an000;bgb | ||
| 11 | :def 9 "%1 bytes in %2 hidden files" ;hidmes ;an000;bgb | ||
| 12 | :def 10 "%1 bytes in %2 directories" ;dirmes ;an000;bgb | ||
| 13 | :def 11 "%1 bytes in %2 user files" ;filemes ;an000;bgb | ||
| 14 | :def 12 "%1 bytes in %2 recovered files" ;orphmes2 ;an000;bgb | ||
| 15 | :def 13 "%1 bytes would be in %2 recovered files" ;orphmes3 ;an000;bgb | ||
| 16 | :def 14 "%1 bytes available on disk" ;frespc ;an000;bgb | ||
| 17 | :def 15 "%1 total bytes memory" ;totmem ;an000;bgb | ||
| 18 | :def 16 "%1 bytes free" ;fremem ;an000;bgb | ||
| 19 | :def 17 "Cannot CHKDSK a network drive" ;no_net_arg ;an000;bgb | ||
| 20 | :def 18 "Cannot CHKDSK a SUBSTed or ASSIGNed drive" ;SubStErr ;an000;bgb | ||
| 21 | :def 19 "Probable non-DOS disk",CR,LF,"Continue (Y/N)?" ;badidbyt ;an018;bgb ;an000;bgb | ||
| 22 | :def 20 "Disk error reading FAT %1",CR,LF ;badr ;an000;bgb | ||
| 23 | ;an000;bgb | ||
| 24 | :class B ;an000;bgb | ||
| 25 | :def 21 "Directory %1" ;direc_arg ;an000;bgb | ||
| 26 | :def 22 "%1 Contains %2 non-contiguous blocks" ;extent_arg ;an000;bgb | ||
| 27 | :def 23 "All specified file(s) are contiguous" ;noext_arg ;an000;bgb | ||
| 28 | :def 24 "Errors found, F parameter not specified",CR,LF,"Corrections will not be written to disk" ;fixmes_arg;an000;bgb | ||
| 29 | :def 25 " Processing cannot continue %1%2" ;fatal_arg ;an000;bgb | ||
| 30 | :def 26 " File allocation table bad, drive %1" ;badrdmes ;an000;bgb | ||
| 31 | :use COMMON2 ;stackmes ;an000;bgb | ||
| 32 | :def 29 " CHDIR .. failed, trying alternate method" ;cdddmes ;an000;bgb | ||
| 33 | :def 30 " Has invalid cluster, file truncated" ;badchain ;an000;bgb | ||
| 34 | :def 31 " Invalid sub-directory entry" ;badsubdir ;an000;bgb | ||
| 35 | :def 32 " Does not exist" ;ndotmes ;an000;bgb | ||
| 36 | :def 33 " First cluster number is invalid, entry truncated" ;nulnz ;an000;bgb | ||
| 37 | :def 34 " Allocation error, size adjusted" ;badclus ;an000;bgb | ||
| 38 | :def 35 " Cannot recover .. entry, processing continued" ;norecdot ;an000;bgb | ||
| 39 | :def 36 " Directory is totally empty, no . or .." ;nuldmes ;an000;bgb | ||
| 40 | :def 37 " Directory is joined" ;joinmes ;an000;bgb | ||
| 41 | :def 38 " Cannot recover .. entry" ;norecddot ;an000;bgb | ||
| 42 | :def 39 " Entry has a bad link" ;norecddot1 ;an000;bgb | ||
| 43 | :def 40 " Entry has a bad attribute" ;norecddot2 ;an000;bgb | ||
| 44 | ;an000;bgb | ||
| 45 | :class C ;an000;bgb | ||
| 46 | :def 41 " Entry has a bad size" ;norecddot3 ;an000;bgb | ||
| 47 | :def 42 " Is cross linked on cluster %1" ;cross_arg ;an000;bgb | ||
| 48 | :def 43 " Cannot CHDIR to %1,",CR,LF,"tree past this point not processed" ;badtarg_ptr;an000;bgb | ||
| 49 | :def 44 " tree past this point not processed" ;badtarg2 ;an000;bgb | ||
| 50 | :def 45 "%1 bytes disk space freed" ;freebymes1 ;an000;bgb | ||
| 51 | :def 46 "%1 bytes disk space would be freed" ;freebymes2 ;an000;bgb | ||
| 52 | :def 47 "Volume %1 created %2 %3",CR,LF ;idmes_arg ;an000;bgb | ||
| 53 | :def 48 "%1 total allocation units on disk" ;idmes1 ;an000;bgb | ||
| 54 | :def 49 "%1 bytes in each allocation unit" ;idmes2 ;an000;bgb | ||
| 55 | ;:def 50 "CHKDSK not available on drive %1" ;msgExecFailure ;an000;bgb | ||
| 56 | :def 51 " Extended Attributes has invalid clusters, attributes truncated" ;Inv_XA_Msg;an000;bgb | ||
| 57 | :def 52 " Extended Attributes allocation error , attributes truncated" ;Alloc_XA_Msg;an000;bgb | ||
| 58 | :def 53 "Invalid parameter" ;badsw_arg ;an000;bgb | ||
| 59 | :use 54 extend15 ;baddrv_arg "invalid drive spec" ;an017;bgb | ||
| 60 | :use 55 extend3 ;invpath_arg "path not found" ;an017;bgb | ||
| 61 | :use 56 extend2 ;opnerr_arg "file not found" ;an017;bgb | ||
| 62 | :def 58 " %1 lost clusters found in %2 chains." ;orph_arg ;an000;bgb | ||
| 63 | :def 59 CR,LF ;crlf_arg ;an000;bgb | ||
| 64 | :def 60 " Cannot CHDIR to root",CR,LF ;badcd_arg ;an000;bgb | ||
| 65 | ;an000;bgb | ||
| 66 | :class D ;an000;bgb | ||
| 67 | :def 61 " Disk error writing FAT %1" ;badw_arg ;an000;bgb | ||
| 68 | :def 62 " %1" ;noisy_arg ;an000;bgb | ||
| 69 | :def 63 "Invalid current directory" ;baddpbdir ;an000;bgb | ||
| 70 | :def 64 "%1",CR,LF ;file_arg ;an000;bgb | ||
| 71 | :def 65 " Insufficient room in root directory",CR,LF," Move files from root directory and repeat CHKDSK" ;creatmes;an000;bgb | ||
| 72 | :def 66 "%1 %2 %3" ;eup_arg ;an000;bgb | ||
| 73 | :def 67 "%1 %2, %3" ;usp_arg ;an000;bgb | ||
| 74 | :def 68 "%1%2%3%4%5" ;oth_arg ;an000;bgb | ||
| 75 | :def 69 "%1%2%3%4" ;time_arg ;an000;bgb | ||
| 76 | :def 70 "%1 available allocation units on disk" ;idmes2 ;an017;bgb | ||
| 77 | :use 71 COMMON36 ;Volume Serial Number is %1-%2 ;an024;bgb | ||
| 78 | :use 72 extend8 ;insufficent memory ;an030;bgb | ||
| 79 | :use 73 extend26 ;invalid media type ;an033;bgb | ||
| 80 | :use 74 extend29 ;write fault error ;an033;bgb | ||
| 81 | |||
| 82 | :end | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKDSK1.ASM b/v4.0/src/CMD/CHKDSK/CHKDSK1.ASM new file mode 100644 index 0000000..6d85d42 --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKDSK1.ASM | |||
| @@ -0,0 +1,682 @@ | |||
| 1 | TITLE CHKDSK - MS-DOS Disk consistancy checker ; | ||
| 2 | page ,132 ; | ||
| 3 | |||
| 4 | .xlist | ||
| 5 | include chkseg.inc ;an005;bgb | ||
| 6 | INCLUDE CHKCHNG.INC | ||
| 7 | INCLUDE DOSSYM.INC | ||
| 8 | INCLUDE syscall.inc ;an041;bgb | ||
| 9 | INCLUDE ioctl.inc ;an041;bgb;an041;bgb | ||
| 10 | INCLUDE CHKEQU.INC | ||
| 11 | INCLUDE CHKMACRO.INC | ||
| 12 | include chkdata.inc ;an005;bgb | ||
| 13 | include pathmac.inc | ||
| 14 | |||
| 15 | CODE SEGMENT PUBLIC PARA 'CODE' | ||
| 16 | ASSUME CS:DG,DS:NOTHING,ES:DG,SS:dg | ||
| 17 | EXTRN INT_23:NEAR, readft:near ;an005;bgb | ||
| 18 | EXTRN FATAL:NEAR, PROMPTYN:NEAR, GET_CURRDIR:NEAR | ||
| 19 | extrn calc_fatmap_seg:near, FINDCHAIN:NEAR, CHECKERR:NEAR, DIRPROC:NEAR | ||
| 20 | extrn CHKMAP:NEAR, Main_Init:Near ;an049;bgb | ||
| 21 | EXTRN CHKCROSS:NEAR, AMDONE:NEAR, UNPACK:NEAR, GET_THISEL2:NEAR | ||
| 22 | EXTRN PRINTF_CRLF:NEAR, DOCRLF:NEAR, REPORT:NEAR | ||
| 23 | extrn init_fatmap:near, CHKPRMT_END:near ;an005;bgb | ||
| 24 | extrn hook_interrupts:near | ||
| 25 | extrn CHECK_DBCS_CHARACTER:NEAR ;an055;bgb | ||
| 26 | |||
| 27 | public SETSTACK, OkDrive, DRVISOK, Root_CD_Ok, NOTVOLID, fat16b, SMALLFAT | ||
| 28 | public BAD_STACK, RDLOOP, NORETRY1, RDOK, IDOK, ALLDONE, CHECKFILES, GotPath | ||
| 29 | public IS_ROOT_DIR, NOT_ROOT_DIR, VALID_PATH, ParseName, ScanFile, FRAGCHK | ||
| 30 | public EACHCLUS, LASTCLUS, NXTCHK, GETNXT, MSGCHK, FILSPOK, CDONE, CDONE1 | ||
| 31 | public PRINTID, FIGREC, Main_Routine, checkit | ||
| 32 | .list | ||
| 33 | |||
| 34 | |||
| 35 | pathlabl chkdsk1 | ||
| 36 | CHKDSK: | ||
| 37 | ; find out if we have enough memory to do the job | ||
| 38 | mov cs:save_drive,al ;save drive validity | ||
| 39 | ;;;;int 12h ;1k blocks (640k = 280h) ;an054;bgb;an050;bgb | ||
| 40 | ;;;;mov bx,64 ;number of paragraphs ;an054;bgb;an050;bgb | ||
| 41 | ;;;;mul bx ;640k = a000 ;an054;bgb;an050;bgb | ||
| 42 | ;;;;mov cs:[mem_size],ax ;returns number of 1k blocks ;an054;bgb;an050;bgb | ||
| 43 | DOS_Call GetCurrentPSP ;Get PSP segment address ;Ac034;bgb | ||
| 44 | mov cs:psp_segment,bx ;ac034;bgb | ||
| 45 | mov ds,bx ;ds points to the psp ;Ac034;bgb | ||
| 46 | Assume DS:Nothing | ||
| 47 | MOV DX,DS:[2] ;High break | ||
| 48 | mov cs:[mem_size],dx ;move it into data area ;an054;bgb | ||
| 49 | MOV BX,0FFFFH ;need at least 64k bytes | ||
| 50 | MOV CX,CS ;get segment of where we are | ||
| 51 | SUB DX,CX ;top-of-mem - pgm = # para left in alloc block | ||
| 52 | CMP DX,0FFFH ; is the space available > 64K ? | ||
| 53 | ; $IF B | ||
| 54 | JNB $$IF1 | ||
| 55 | MOV CX,4 ; Yes, set SP to BX (FFF0) | ||
| 56 | SHL DX,CL ; Convert remaining memory to bytes | ||
| 57 | MOV BX,DX | ||
| 58 | ; $ENDIF | ||
| 59 | $$IF1: | ||
| 60 | SETSTACK: ;***Set_Memory********* | ||
| 61 | CLI | ||
| 62 | PUSH CS | ||
| 63 | POP SS | ||
| 64 | ASSUME SS:DG | ||
| 65 | MOV SP,BX | ||
| 66 | STI | ||
| 67 | PUSH AX | ||
| 68 | JMP Main_Init ;Go to init routines | ||
| 69 | |||
| 70 | |||
| 71 | ;************************************************************************** | ||
| 72 | ; MAIN-ROUTINE | ||
| 73 | ; | ||
| 74 | ; called by - main-init | ||
| 75 | ; | ||
| 76 | ; LOGIC | ||
| 77 | ; ***** | ||
| 78 | ; - get the dpb addr | ||
| 79 | ; - set the default drive to here | ||
| 80 | ; - save the directory we are on | ||
| 81 | ; - set the directory to the root of the drive | ||
| 82 | ; - print the volume name | ||
| 83 | ; - get the dpb info | ||
| 84 | ; - get the addr of the fatmap area | ||
| 85 | ; - calculate the amount of stack space we have | ||
| 86 | ;************************************************************************** | ||
| 87 | Main_Routine: | ||
| 88 | set_data_segment | ||
| 89 | OkDrive: | ||
| 90 | ;get the dpb addr from this drive | ||
| 91 | mov dl,AllDrv ;Get drive number ;AN000; | ||
| 92 | DOS_Call Get_DPB ;func 32 ;Get DPB pointer ;AC000; | ||
| 93 | ASSUME DS:NOTHING,cs:DG | ||
| 94 | CMP AL,-1 ;is this a good drive? | ||
| 95 | ; $IF Z | ||
| 96 | JNZ $$IF3 | ||
| 97 | ;;;;;;;;JNZ DRVISOK ;Bad drive (should always be ok) | ||
| 98 | LEA DX,BADDRV_arg ;This should never happen ;AC000; | ||
| 99 | push cs | ||
| 100 | pop ds | ||
| 101 | call PRINTf_crlf ; ;AC000; | ||
| 102 | mov ExitStatus,Bad_Exit ;Get return code ;AC000; | ||
| 103 | ret ;Go back to Main_Init ;AC000; | ||
| 104 | ; $ENDIF | ||
| 105 | $$IF3: | ||
| 106 | MOV WORD PTR CS:[THISDPB+2],DS ;get the dpb segment | ||
| 107 | set_data_segment ;reset ds to the pgm | ||
| 108 | MOV WORD PTR [THISDPB],BX ;get the dpb offset | ||
| 109 | |||
| 110 | ;**Set_Drive_Info************************************************************* | ||
| 111 | DRVISOK: | ||
| 112 | push dx | ||
| 113 | push es | ||
| 114 | call hook_interrupts | ||
| 115 | pop es | ||
| 116 | pop dx | ||
| 117 | ; make this drive the default drive | ||
| 118 | DEC DL ;A=0 b=1 c=2 | ||
| 119 | DOS_Call Set_Default_Drive ;func 0e - no return ;AC000; | ||
| 120 | |||
| 121 | ;get the name of the current directory | ||
| 122 | INC DL ;drive number a=1 b=2 c=3 | ||
| 123 | LEA SI,USERDIR+1 ; ;AC000; | ||
| 124 | DOS_Call Current_Dir ; ;AC000; | ||
| 125 | ;;;;PUSH CS | ||
| 126 | ;;;;POP ES | ||
| 127 | |||
| 128 | ;change the current directory to the root | ||
| 129 | lea DX,rootstr ; ;an005;bgb | ||
| 130 | DOS_Call ChDir ; ;AC000; | ||
| 131 | ; $IF C ;will this ever happen? | ||
| 132 | JNC $$IF5 | ||
| 133 | ;;;;;;;;jnc Root_CD_Ok ; ;AN000; | ||
| 134 | MOV DX,OFFSET DG:BADCD_arg | ||
| 135 | call display_interface ; ;AC000; | ||
| 136 | mov ExitStatus,Bad_Exit ;Get return code ;AC000; | ||
| 137 | ret ;Go back to Main_Init ;AC000; | ||
| 138 | ; $ENDIF | ||
| 139 | $$IF5: | ||
| 140 | |||
| 141 | ;get the dpb info | ||
| 142 | LDS BX,[THISDPB] ;ds:bx--> dpb area | ||
| 143 | ASSUME DS:NOTHING | ||
| 144 | MOV AX,[BX.dpb_sector_size] ;Bytes/sector | ||
| 145 | MOV [SSIZE],AX ;Sector size in bytes | ||
| 146 | MOV AL,[BX.dpb_cluster_mask] | ||
| 147 | INC AL | ||
| 148 | MOV [CSIZE],AL ;Sectors per cluster | ||
| 149 | MOV AX,[BX.dpb_max_cluster] ; number of clusters in the disk | ||
| 150 | MOV [MCLUS],AX ;Bound for FAT searching | ||
| 151 | DEC AX ;ax= max clusters - 1 ;an005;bgb | ||
| 152 | MOV [DSIZE],AX ;Total data clusters on disk ;an005;bgb | ||
| 153 | CMP AX,4096-8 ;Big or little FAT? | ||
| 154 | ; $IF NB | ||
| 155 | JB $$IF7 | ||
| 156 | fat16b: INC es:[BIGFAT] ;set 16-bit fat flag to true | ||
| 157 | MOV es:[EOFVAL],0FFF8H ;set 16-bit compare fields for fat | ||
| 158 | MOV es:[CHAIN_END],0FFFFh ;Marker for end of chain ;AC000; | ||
| 159 | MOV es:[BADVAL],0FFF7H ;set 16-bit compare fields for fat | ||
| 160 | ; $ENDIF | ||
| 161 | $$IF7: | ||
| 162 | mov ax,[bx.dpb_FAT_size] ;Sectors for one fat (DCR) ;an005;bgb | ||
| 163 | mov fatsiz,ax ;Sectors for one fat (DCR) ;an005;bgb | ||
| 164 | MOV CL,[BX.dpb_FAT_count] ;Number of FATs ;an005;bgb | ||
| 165 | mov fatcnt,cl ;an005;bgb | ||
| 166 | MOV DX,[BX.dpb_first_FAT] ;First sector of FAT ;an005;bgb | ||
| 167 | MOV firstfat,dx ;First sector of FAT ;an005;bgb | ||
| 168 | MOV DX,[BX.dpb_first_sector] ;First sector of data ;ac048;bgb | ||
| 169 | MOV firstsec,dx ;First sector of data ;ac048;bgb | ||
| 170 | MOV DX,[BX.dpb_dir_sector] ;First sector of dir ;ac048;bgb | ||
| 171 | MOV dirsec,dx ;First sector of dir ;ac048;bgb | ||
| 172 | MOV DX,[BX.dpb_root_entries] ;First sector of dir ;ac048;bgb | ||
| 173 | MOV root_entries,dx ;First sector of dir ;ac048;bgb | ||
| 174 | set_data_segment ;reset ds to point to data area | ||
| 175 | |||
| 176 | ;calc fatmap area | ||
| 177 | SMALLFAT: ;do this for both size fats | ||
| 178 | ;old calculation | ||
| 179 | ;;;;DEC AX ;ax= max clusters - 1 ;an005;bgb | ||
| 180 | ;;;;MOV [DSIZE],AX ;Total data clusters on disk ;an005;bgb | ||
| 181 | ;;;;MOV AX,[BX.dpb_FAT_size] ;Sectors for one fat (DCR) ;an005;bgb | ||
| 182 | ;;;;MOV CX,AX ;CX = Sectors/Fat ;an005;bgb | ||
| 183 | ;;;;MUL [SSIZE] ;times bytes/sector = bytes per fat ;an005;bgb | ||
| 184 | ;;;;ADD fatmap,AX ;Allocate FAT space ;an005;bgb | ||
| 185 | ;;;;MOV AX,fatmap ; get seg of fatmap ;an005;bgb | ||
| 186 | |||
| 187 | Root_CD_Ok: ; ;AN000; | ||
| 188 | ;set dta area----do i need to do this since we are using int 25? | ||
| 189 | ;set it to fat table | ||
| 190 | call calc_fatmap_seg ;find the addr of where to put the fat map ;an005;bgb | ||
| 191 | ;see if we still have enough memory | ||
| 192 | mov ax,mem_size ;get top of memory | ||
| 193 | cmp ax,end_of_fatmap ;mem_size must be greater or equal | ||
| 194 | ; $IF B ; if not, display error msg | ||
| 195 | JNB $$IF9 | ||
| 196 | MOV DX,OFFSET DG:no_mem_arg | ||
| 197 | invoke printf_crlf | ||
| 198 | jmp alldone ;finished with pgm | ||
| 199 | ; $ENDIF | ||
| 200 | $$IF9: | ||
| 201 | push ds ;save ds | ||
| 202 | mov ds,fattbl_seg ;get seg | ||
| 203 | xor dx,dx ;ds:dx--> dta area | ||
| 204 | ;;;;mov fatmap,dx | ||
| 205 | DOS_Call Set_DMA ;function 1a ;AC000; | ||
| 206 | pop ds ;restore ds | ||
| 207 | |||
| 208 | ;look for volume entry in dir | ||
| 209 | lea DX,volid ;Look for VOL ID ;an005;bgb | ||
| 210 | DOS_Call Dir_Search_First ;function 11 ;AC000; | ||
| 211 | CMP AL,0 ;did we find it? | ||
| 212 | ; $IF Z ;yes | ||
| 213 | JNZ $$IF11 | ||
| 214 | ;;;;;;;;JZ NOTVOLID | ||
| 215 | CALL PRINTID ;print volume name, date, time | ||
| 216 | ; $ENDIF | ||
| 217 | $$IF11: | ||
| 218 | NOTVOLID: | ||
| 219 | call get_serial_num ;print volume serial number ;an024;bgb | ||
| 220 | ;;;;call hook_interrupts | ||
| 221 | ; calculate the place where we run out of ram space ;an005;bgb | ||
| 222 | ;;;;ADD AX,[MCLUS] ;5000 ;fatmap seg + num of clusters? ;an005;bgb | ||
| 223 | ;;;;ADD AX,2 ;5002 ;Insurance ;an005;bgb | ||
| 224 | ;;;;MOV [SECBUF],AX ;Allocate fatmap space ;an005;bgb | ||
| 225 | mov ax, offset dg:chkprmt_end ;this label must be the last thing in the code segment | ||
| 226 | mov [secbuf],AX ;location of read/write buffer for dir entries ;an005;bgb | ||
| 227 | ;;;;ADD AX,[SSIZE] ;5202 ;an005;bgb | ||
| 228 | ;;;;ADD AX,20 ;5216 ;Insurance ;an005;bgb | ||
| 229 | mov ax,0ffffh ;get end of segment | ||
| 230 | lea bx,fattbl ;get end of program | ||
| 231 | sub ax,bx ;this is the amount of stack space we have | ||
| 232 | MOV [STACKLIM],AX ;Limit on recursion ;an005;bgb | ||
| 233 | ; see if we have already overrun the stack | ||
| 234 | MOV DI,SP ;where is the stack pointer now? ;an005;bgb | ||
| 235 | SUB DI,100H ; Want AT LEAST this much stack from ;an005;bgb | ||
| 236 | ; our current location ;an005;bgb | ||
| 237 | CMP DI,AX | ||
| 238 | ; $IF B | ||
| 239 | JNB $$IF13 | ||
| 240 | ;;;;;;;;JB BAD_STACK ; Already in trouble | ||
| 241 | BAD_STACK: | ||
| 242 | MOV BX,OFFSET DG:STACKMES ;Out of stack | ||
| 243 | PUSH CS | ||
| 244 | POP DS | ||
| 245 | JMP FATAL | ||
| 246 | ; $ENDIF | ||
| 247 | $$IF13: | ||
| 248 | |||
| 249 | ; | ||
| 250 | ;**Read in FAT***************************************************************** | ||
| 251 | ;;;;MOV DI,fatsiz ;sectors per fat ;an005;bgb | ||
| 252 | ;;;;MOV CL,[BX.dpb_FAT_count] ;Number of FATs | ||
| 253 | ;;;;MOV DX,[BX.dpb_first_FAT] ;First sector of FAT | ||
| 254 | mov cx,fatsiz ;number of sectors to read ;an005;bgb | ||
| 255 | mov dx,firstfat ;starting sector number ;an005;bgb | ||
| 256 | mov es,fattbl_seg ;set up bx for read-disk ;an005;bgb | ||
| 257 | xor bx,bx ;an005;bgb | ||
| 258 | MOV AL,[ALLDRV] ;set up al with drive letter for read-disk | ||
| 259 | DEC AL ;zero based | ||
| 260 | ;;;;MOV AH,1 | ||
| 261 | RDLOOP: | ||
| 262 | ;;;;XCHG CX,DI ;DI has # of Fats | ||
| 263 | call readft ; readft (); ;AN005;bgb | ||
| 264 | ; $IF C ; could the fat be read from disk? ;AN005;bgb | ||
| 265 | JNC $$IF15 | ||
| 266 | inc byte ptr [nul_arg] ;an005;bgb | ||
| 267 | ;;;;;;;;mov [fatal_arg2],offset dg:baddrvm ;an005;bgb | ||
| 268 | mov [fatmsg2],offset dg:baddrvm ;an005;bgb | ||
| 269 | lea BX,badread ;an022;bgb | ||
| 270 | JMP FATAL ;Couldn't read any FAT, BARF ;an005;bgb | ||
| 271 | ; $ENDIF ;fat could be read from disk ;AN005;bgb | ||
| 272 | $$IF15: | ||
| 273 | |||
| 274 | ; savereg <dx,cx,di,ax> ;an005;bgb | ||
| 275 | ; mov Read_Write_Relative.Start_Sector_High,0 ; ;AN000; | ||
| 276 | ; call Read_Disk ;Read in the FAT ;AC000; | ||
| 277 | ; $IF C | ||
| 278 | ;;;;;;;;JNC RDOK | ||
| 279 | ;;;;;;;;mov [badrw_str],offset dg:reading | ||
| 280 | ; POP AX ; Get fat# in ah | ||
| 281 | ; PUSH AX ; Back on stack | ||
| 282 | ; xchg al,ah ; Fat # to AL | ||
| 283 | ; xor ah,ah ; Make it a word | ||
| 284 | ; mov [badrw_num],ax | ||
| 285 | ; mov dx,offset dg:badr_arg | ||
| 286 | ; invoke printf_crlf | ||
| 287 | ; restorereg <ax,cx,di,dx> ;an005;bgb | ||
| 288 | ; INC AH | ||
| 289 | ; ADD DX,DI | ||
| 290 | ; LOOP RDLOOP ;Try next FAT | ||
| 291 | ;;;;;;;;JMP NORETRY1 ;Couldn't read either ;AC000; | ||
| 292 | NORETRY1: | ||
| 293 | ; inc byte ptr [nul_arg] | ||
| 294 | ; mov [fatal_arg2],offset dg:baddrvm | ||
| 295 | ; MOV BX,OFFSET DG:BADRDMES | ||
| 296 | ; JMP FATAL ;Couldn't read any FAT, BARF | ||
| 297 | ; $ENDIF | ||
| 298 | RDOK: ;**Check_for_FAT_ID********************************************** | ||
| 299 | ;;;;restorereg <ax,ax,ax,ax> ;Clean up ;an005;bgb | ||
| 300 | mov es,fattbl_seg ;segment of fat-table ;an005;bgb | ||
| 301 | xor si,si ;offset of first byte in fat-table ;an005;bgb | ||
| 302 | ;;;;LODSB ;Check FAT ID byte | ||
| 303 | mov al,byte ptr es:[si] ;get first byte of fat table | ||
| 304 | CMP AL,0F8H ;is it the correct id byte? | ||
| 305 | ; $IF B,AND | ||
| 306 | JNB $$IF17 | ||
| 307 | ;;;;;;;;JAE IDOK | ||
| 308 | CMP AL,0F0H ;if not, Is it a "strange" medium? | ||
| 309 | ; $IF NZ | ||
| 310 | JZ $$IF17 | ||
| 311 | ;;;;;;;;jz IDOK ;neither fat nor strange | ||
| 312 | MOV DX,OFFSET DG:BADIDBYT ;FAT ID bad | ||
| 313 | CALL PROMPTYN ;Ask user to stop or not | ||
| 314 | ; $IF NZ | ||
| 315 | JZ $$IF18 | ||
| 316 | ;;;;;;;;;;;;JZ IDOK | ||
| 317 | JMP ALLDONE ;User said stop | ||
| 318 | ; $ENDIF | ||
| 319 | $$IF18: | ||
| 320 | ; $ENDIF | ||
| 321 | $$IF17: | ||
| 322 | |||
| 323 | ;initialize the fatmap area to all zeros | ||
| 324 | IDOK: | ||
| 325 | call init_fatmap | ||
| 326 | |||
| 327 | ;set the dta addr to here for all searches | ||
| 328 | MOV DX,OFFSET DG:DIRBUF ;FOR ALL SEARCHING | ||
| 329 | DOS_Call Set_DMA ; ;AC000; | ||
| 330 | XOR AX,AX ;zero out ax | ||
| 331 | PUSH AX ;I am root | ||
| 332 | PUSH AX ;Parent is root | ||
| 333 | ; | ||
| 334 | set_data_segment | ||
| 335 | checkit: | ||
| 336 | CALL DIRPROC | ||
| 337 | CALL CHKMAP ;Look for badsectors, orphans | ||
| 338 | CALL CHKCROSS ;Check for second pass | ||
| 339 | INVOKE DOCRLF ;display new line | ||
| 340 | CALL REPORT ;finished, display data to screen | ||
| 341 | |||
| 342 | ;***************************************************************************** | ||
| 343 | ALLDONE: | ||
| 344 | CALL AMDONE | ||
| 345 | ;;;;;MOV AH,EXIT | ||
| 346 | ;;;;;;;;XOR AL,AL | ||
| 347 | ;;;;;; ;mov ExitStatus,Bad_Exit ;Get return code ;AC000; | ||
| 348 | ;;;;;;;;INT 21H | ||
| 349 | ret ;Ret to Main_Init for common exit ;AN000; | ||
| 350 | |||
| 351 | ASSUME DS:DG | ||
| 352 | ;**Extent_Check*************************************************************** | ||
| 353 | Break <Check for extents in specified files> | ||
| 354 | ; | ||
| 355 | ; Search the directory for the files specified on the command line and report | ||
| 356 | ; the number of fragmented allocation units found in each one. We examine the | ||
| 357 | ; given path name for a directory. If it is found, we CHDIR to it. In any | ||
| 358 | ; event, we move to the file name part and do a parseFCB call to convert it | ||
| 359 | ; into an FCB for a dir_search_first. If the parse did NOT advance the | ||
| 360 | ; pointer to the null byte terminating the string, then we have a bogus anme | ||
| 361 | ; and we should report it. | ||
| 362 | ; | ||
| 363 | |||
| 364 | CHECKFILES: | ||
| 365 | set_data_segment | ||
| 366 | ; see if there is a '\' in the path name | ||
| 367 | MOV DI,OFFSET DG:PATH_NAME | ||
| 368 | MOV SI,DI | ||
| 369 | MOV CX, FNAME_LEN ; ;an011;bgb | ||
| 370 | ADD DI,CX ; ES:DI points to char AFTER last char | ||
| 371 | DEC DI ; Point to last char | ||
| 372 | doagain: MOV AL,[DIRCHAR] ;try to find '\' in path name | ||
| 373 | STD | ||
| 374 | REPNE SCASB | ||
| 375 | CLD | ||
| 376 | ; $IF Z ;a '\' was found in path ;an055;bgb | ||
| 377 | JNZ $$IF21 | ||
| 378 | mov al,[di] ;get byte preceding '\' ;an055;bgb | ||
| 379 | call check_dbcs_character ;see if dbcs leading char ;an055;bgb | ||
| 380 | ; $IF C ;carry means dbcs leading char ;an055;bgb | ||
| 381 | JNC $$IF22 | ||
| 382 | jmp doagain ;so ignore ;an055;bgb | ||
| 383 | ; $ELSE ;an055;bgb | ||
| 384 | JMP SHORT $$EN22 | ||
| 385 | $$IF22: | ||
| 386 | jmp GotPath ;found a '\' and not dbcs ;an055;bgb | ||
| 387 | ; $ENDIF ;an055;bgb | ||
| 388 | $$EN22: | ||
| 389 | ; $ENDIF ;an055;bgb | ||
| 390 | $$IF21: | ||
| 391 | ;;;;;;;;;;;;;;;;;;;;;JZ GotPath ; found path char. ;an055;bgb | ||
| 392 | ; No '\' was found. set up pointers for parse FCB call. | ||
| 393 | MOV DI,OFFSET DG:PATH_NAME | ||
| 394 | CMP BYTE PTR [DI+1],':' ;was a drive letter entered? | ||
| 395 | JNZ ParseName | ||
| 396 | ADD DI,2 | ||
| 397 | JMP SHORT ParseName | ||
| 398 | |||
| 399 | ;***************************************************************************** | ||
| 400 | ; found a '\' in the path name | ||
| 401 | ;Change directories and set up the appropriate FCB | ||
| 402 | GotPath: | ||
| 403 | INC DI ; DI points AT the path sep | ||
| 404 | PUSH WORD PTR [DI] ; Save two chars here | ||
| 405 | PUSH DI ; Save location | ||
| 406 | SUB SI,DI | ||
| 407 | JZ IS_ROOT_DIR ; SI=DI=First char which is a dirchar | ||
| 408 | NEG SI | ||
| 409 | CMP SI,2 | ||
| 410 | JNZ NOT_ROOT_DIR | ||
| 411 | CMP BYTE PTR [DI-1],':' ; d:\ root spec? | ||
| 412 | JNZ NOT_ROOT_DIR ; Nope | ||
| 413 | IS_ROOT_DIR: | ||
| 414 | INC DI ; Don't zap the path sep, zap NEXT char | ||
| 415 | NOT_ROOT_DIR: | ||
| 416 | MOV BYTE PTR [DI],0 | ||
| 417 | MOV DX,OFFSET DG:PATH_NAME | ||
| 418 | DOS_Call Chdir ; ;AC000; | ||
| 419 | POP DI ; Recall loc | ||
| 420 | POP WORD PTR [DI] ; recall chars | ||
| 421 | JNC VALID_PATH | ||
| 422 | INVOKE DOCRLF | ||
| 423 | MOV DX,OFFSET DG:INVPATH_arg | ||
| 424 | invoke printf_crlf | ||
| 425 | JMP CDONE1 | ||
| 426 | |||
| 427 | ;***************************************************************************** | ||
| 428 | VALID_PATH: | ||
| 429 | INC [DIR_FIX] | ||
| 430 | INC DI ; Point past path sep to first char of name | ||
| 431 | ParseName: | ||
| 432 | ; parse the filename and get back a formatted fcb for it in es:di | ||
| 433 | MOV SI,DI ; DS:SI points to name | ||
| 434 | MOV DI,offset dg:FCB_copy ; ES:DI points to FCB | ||
| 435 | MOV AL,ALLDRV ; drive number | ||
| 436 | STOSB ; put it into fcb | ||
| 437 | DEC DI ; Back to start of FCB | ||
| 438 | MOV pFileName,SI ; save end of file name | ||
| 439 | MOV AL,00000010B ; tell parse to change drive letter if needed | ||
| 440 | DOS_Call Parse_File_Descriptor ; ;AC000; | ||
| 441 | CMP BYTE PTR [SI],0 ;ds:si should point past filename | ||
| 442 | JZ ScanFile | ||
| 443 | ; | ||
| 444 | ; Twiddle the file name to be truly bogus. Zorch the drive letter | ||
| 445 | ; | ||
| 446 | MOV BYTE PTR es:[DI],-1 | ||
| 447 | ScanFile: | ||
| 448 | INVOKE DOCRLF | ||
| 449 | ;set dma pointer to here | ||
| 450 | MOV DX,OFFSET DG:DIRBUF ;FOR ALL SEARCHING | ||
| 451 | MOV BP,DX | ||
| 452 | ADD BP,27 ;bp points to clus in the dir entry | ||
| 453 | DOS_Call Set_DMA ;set dma ptr here for dir search ;AC000; | ||
| 454 | ;try to find the file specified | ||
| 455 | MOV AH,DIR_SEARCH_FIRST ;Look for the first file | ||
| 456 | FRAGCHK: | ||
| 457 | MOV DX,offset dg:FCB_copy | ||
| 458 | INT 21H | ||
| 459 | OR AL,AL ;Did we find it? | ||
| 460 | JNZ MSGCHK ;No -- we're done | ||
| 461 | ; we found the file | ||
| 462 | ; look for fragmentation | ||
| 463 | XOR AX,AX ;Initialize the fragment counter | ||
| 464 | MOV SI,[BP] ;Get the first cluster ;an005;bgb | ||
| 465 | CALL UNPACK ;see what that cluster points to | ||
| 466 | CMP DI,[EOFVAL] ;End-of-file? | ||
| 467 | JAE NXTCHK ;Yes -- go report the results | ||
| 468 | INC SI | ||
| 469 | CMP SI,DI | ||
| 470 | JZ EACHCLUS | ||
| 471 | INC AX | ||
| 472 | EACHCLUS: | ||
| 473 | MOV [OLDCLUS],DI ;Save the last cluster found | ||
| 474 | MOV SI,DI ;Get the next cluster | ||
| 475 | CALL UNPACK | ||
| 476 | INC [OLDCLUS] ;Bump the old cluster | ||
| 477 | CMP DI,[OLDCLUS] ;Are they the same? | ||
| 478 | JNZ LASTCLUS ;No -- check for end-of-file | ||
| 479 | JMP SHORT EACHCLUS ;Continue processing | ||
| 480 | LASTCLUS: | ||
| 481 | CMP DI,[EOFVAL] ;End-of-file? | ||
| 482 | JAE NXTCHK ;Yes -- go report the results | ||
| 483 | INC AX ;No -- found a fragement | ||
| 484 | JMP SHORT EACHCLUS ;Continue processing | ||
| 485 | NXTCHK: ;reached the end of a file | ||
| 486 | OR AX,AX ;did we find any fragmentation? | ||
| 487 | JZ GETNXT | ||
| 488 | ;we found fragmentation | ||
| 489 | MOV [FRAGMENT],2 ;Signal that we output at least one file | ||
| 490 | inc ax ;bump by one for ends | ||
| 491 | mov [block_num],ax | ||
| 492 | mov word ptr rarg1,ax ; ;an011;bgb | ||
| 493 | mov word ptr rarg1+2,0 | ||
| 494 | mov si,offset dg:dirbuf ;point to filename ;an011;bgb | ||
| 495 | INC SI ;move pointer past drive letter | ||
| 496 | ; get the full path name for this file | ||
| 497 | CALL get_THISEL2 | ||
| 498 | ; print it out | ||
| 499 | mov dx,offset dg:extent_arg | ||
| 500 | invoke printf_crlf | ||
| 501 | GETNXT: | ||
| 502 | MOV AH,DIR_SEARCH_NEXT ;Look for the next file | ||
| 503 | JMP FRAGCHK | ||
| 504 | MSGCHK: | ||
| 505 | CMP AH,DIR_SEARCH_FIRST ;was this the first file searched for? | ||
| 506 | JNZ FILSPOK | ||
| 507 | ; MOV SI,offset dg:FCB_copy + 1 ;File not found error | ||
| 508 | ; CALL get_THISEL2 | ||
| 509 | MOV SI,pFileName | ||
| 510 | CALL get_currdir | ||
| 511 | mov dx,offset dg:OPNERR_arg | ||
| 512 | invoke printf_crlf ;bad file spec | ||
| 513 | jmp short cdone | ||
| 514 | FILSPOK: | ||
| 515 | CMP BYTE PTR [FRAGMENT],2 | ||
| 516 | JZ CDONE | ||
| 517 | ; all files were ok | ||
| 518 | mov dx,offset dg:NOEXT_arg | ||
| 519 | invoke printf_crlf | ||
| 520 | CDONE: | ||
| 521 | CMP BYTE PTR [DIR_FIX],0 | ||
| 522 | JZ CDONE1 | ||
| 523 | MOV DX,OFFSET DG:USERDIR | ||
| 524 | DOS_Call ChDir ; ;AC000; | ||
| 525 | CDONE1: | ||
| 526 | RET | ||
| 527 | |||
| 528 | |||
| 529 | |||
| 530 | ; This is the old parameter passing scheme ;ac048;bgb | ||
| 531 | ; inputs: AH - the sector number within the cluster ;ac048;bgb | ||
| 532 | ; BX - cluster number ;ac048;bgb | ||
| 533 | ; output: DX - absolute sector number ;ac048;bgb | ||
| 534 | ;***************************************************************************** ;ac048;bgb | ||
| 535 | ; FIGREC - This procedure calculates the absolute sector number of a logical ;ac048;bgb | ||
| 536 | ; drive, given any cluster number and the sector within that cluster. ;ac048;bgb | ||
| 537 | ; You can use this to find the sector number for a file. ;ac048;bgb | ||
| 538 | ; ;ac048;bgb | ||
| 539 | ; This procedure was entirely re-written for dos 4.0, since the ;ac048;bgb | ||
| 540 | ; sector number can now be a DOUBLE word value. ;ac048;bgb | ||
| 541 | ; ;ac048;bgb | ||
| 542 | ; called by: getent in chkproc ;ac048;bgb | ||
| 543 | ; ;ac048;bgb | ||
| 544 | ; inputs: BX - cluster number ;ac048;bgb | ||
| 545 | ; AH - sector number within cluster ;ac048;bgb | ||
| 546 | ; csize - sectors per cluster (from dpb) ;ac048;bgb | ||
| 547 | ; firstsec - starting sector number of the data area (from dpb) ;ac048;bgb | ||
| 548 | ; ;ac048;bgb | ||
| 549 | ;outputs: DX - absolute sector number (low order) ;ac048;bgb | ||
| 550 | ; INT26.start_sector_high (hi order) ;ac048;bgb | ||
| 551 | ; ;ac048;bgb | ||
| 552 | ;regs changed: DX only ;ac048;bgb | ||
| 553 | ; ;ac048;bgb | ||
| 554 | ;formula: cluster (3-fff7) * secs/cluster (1-8) = (3-7ffb8) ;ac048;bgb | ||
| 555 | ; + sector-offset (0-8) + first-sector (1-ffff) = (7ffb9-8ffbf) ;ac048;bgb | ||
| 556 | ; ;ac048;bgb | ||
| 557 | ; logic: 1. adjust the cluster number, since the 1st two clusters in the fat ;ac048;bgb | ||
| 558 | ; are not used. cluster number can be from 3-fff7. ;ac048;bgb | ||
| 559 | ; 2. get the sectors-per-cluster, and multiply it times cluster number ;ac048;bgb | ||
| 560 | ; in AX. since this is a word multiply, the high order number goes ;ac048;bgb | ||
| 561 | ; into DX. ;ac048;bgb | ||
| 562 | ; 3. add in the sector-number-within-the-cluster. Each cluster ;ac048;bgb | ||
| 563 | ; (usually) contains several sectors within a cluster. This sector ;ac048;bgb | ||
| 564 | ; number is that number. It may be from zero to the max number of ;ac048;bgb | ||
| 565 | ; sectors/cluster (which can be up to 8 so far on IBM systems). ;ac048;bgb | ||
| 566 | ; Do an ADC in case there is a overflow of the word register. ;ac048;bgb | ||
| 567 | ; 4. add in the starting cluster number of the data area. This now ;ac048;bgb | ||
| 568 | ; gives you the logical sector number within that drive. ;ac048;bgb | ||
| 569 | ;***************************************************************************** ;ac048;bgb | ||
| 570 | procedure figrec,NEAR ;ac048;bgb | ||
| 571 | push ax ;save registers ;ac048;bgb | ||
| 572 | push bx ;save registers ;ac048;bgb | ||
| 573 | push cx ;save registers ;ac048;bgb | ||
| 574 | ;ac048;bgb | ||
| 575 | xor ch,ch ;clear out hi byte of sector-offset ;ac048;bgb | ||
| 576 | mov cl,ah ;move sector-offset into cx ;ac048;bgb | ||
| 577 | mov ax,bx ;move cluster number into ax for mult ;ac048;bgb | ||
| 578 | ;ac048;bgb | ||
| 579 | xor bh,bh ;zero out bh ;ac048;bgb | ||
| 580 | mov bl,csize ;get sectors per cluster ;ac048;bgb | ||
| 581 | dec ax ; sub 2 for the 1st 2 unused clus in the fat ;ac048;bgb | ||
| 582 | dec ax ; ;ac048;bgb | ||
| 583 | mul bx ;ax=low word, dx=hi word ;ac048;bgb | ||
| 584 | ;ac048;bgb | ||
| 585 | add ax,cx ;add sector offset ;ac048;bgb | ||
| 586 | adc dx,0 ;inc hi word if overflow ;ac048;bgb | ||
| 587 | add ax,[firstsec] ;add first data sector ;ac048;bgb | ||
| 588 | adc dx,0 ;inc hi word if overflow ;ac048;bgb | ||
| 589 | ;ac048;bgb | ||
| 590 | mov Read_Write_Relative.Start_Sector_High,dx ;save hi value ;ac048;bgb | ||
| 591 | mov dx,ax ;convert to old format- dx=low ;ac048;bgb | ||
| 592 | ;ac048;bgb | ||
| 593 | pop cx ;ac048;bgb | ||
| 594 | pop bx ;ac048;bgb | ||
| 595 | pop ax ;ac048;bgb | ||
| 596 | RET ;ac048;bgb | ||
| 597 | endproc figrec ;ac048;bgb | ||
| 598 | |||
| 599 | |||
| 600 | ;***************************************************************************** | ||
| 601 | SUBTTL PRINTID - Print Volume ID info | ||
| 602 | PAGE | ||
| 603 | PRINTID: | ||
| 604 | ASSUME DS:DG | ||
| 605 | call docrlf ; ;AN000; | ||
| 606 | ;get volume name ;an012;bgb | ||
| 607 | xor si,si ;Point at DTA where find first just done;;an005;bgb | ||
| 608 | lea DI,arg_buf ;Where to put vol name for message ;AC000; | ||
| 609 | add si,DirNam ;Point at the vol label name ;AN000; | ||
| 610 | ;;;;;;;;lea DI,arg_buf ;Point at vol label location in arg_Buf ;AC000; | ||
| 611 | MOV CX,11 ; Pack the name | ||
| 612 | push ds ;an005;bgb | ||
| 613 | mov ds,fattbl_seg ;an005;bgb | ||
| 614 | REP MOVSB ; Move all of it | ||
| 615 | ;get the year ;an012;bgb | ||
| 616 | xor si,si ;Get back pointer to FCB ;an009;bgb | ||
| 617 | mov ax,ds:[si].DirDat ;yyyyyyym mmmddddd Put in SysDisp form ;AN009;bgb | ||
| 618 | and ax,Year_Mask ;yyyyyyy0 00000000 ;AN000; | ||
| 619 | shr ax,1 ;0yyyyyyy 00000000 ;AN000; | ||
| 620 | xchg al,ah ;00000000 0yyyyyyy ;AN000; | ||
| 621 | add ax,1980 ; ;AN000; | ||
| 622 | mov es:Sublist_msg_Idmes.Sublist_Offset+(size Sublist_Struc),ax ; ;AN009;bgb | ||
| 623 | ;get the month ;an012;bgb | ||
| 624 | mov ax,ds:[si].DirDat ;yyyyyyym mmmddddd ;AN009;bgb | ||
| 625 | and ax,Month_Mask ;0000000m mmm00000 ;AN000; | ||
| 626 | mov cl,5 ; ;AN000; | ||
| 627 | shr ax,cl ;00000000 0000mmmm ;AN000; | ||
| 628 | mov cl,al ;0000mmmm ;AN000; | ||
| 629 | ;get the day ;an012;bgb | ||
| 630 | mov ax,ds:[si].DirDat ;yyyyyyym mmmddddd ;AN009;bgb | ||
| 631 | and ax,Day_Mask ;00000000 000ddddd ;AN000; | ||
| 632 | mov ah,cl ;0000mmmm 000ddddd ;AN000; | ||
| 633 | xchg ah,al ;make it display correctly ;an012;bgb | ||
| 634 | mov es:Sublist_msg_Idmes.Sublist_Segment+(size Sublist_Struc),ax ; ;AN009;bgb | ||
| 635 | ;get the time ;an012;bgb | ||
| 636 | mov ax,ds:[si].DirTim ;hhhhhmmm mmmsssss ;AN009;bgb | ||
| 637 | and ax,Hour_Mask ;hhhhh000 00000000 ;AN000; | ||
| 638 | mov cl,11 ; ;AN000; | ||
| 639 | shr ax,cl ;00000000 000hhhhh ;AN000; | ||
| 640 | mov ch,al ;000hhhhh ;AN000; | ||
| 641 | mov ax,ds:[si].DirTim ;hhhhhmmm mmmsssss ;AN009;bgb | ||
| 642 | and ax,Minute_Mask ;00000mmm mmm00000 ;AN000; | ||
| 643 | mov cl,3 ; ;AN000; | ||
| 644 | shl ax,cl ;00mmmmmm 00000000 ;AN000; | ||
| 645 | mov al,ch ;00mmmmmm 000hhhhh ;AN000; | ||
| 646 | mov es:Sublist_msg_Idmes.Sublist_Offset+(size Sublist_Struc)+(size Sublist_Struc),ax ;AN009;bgb | ||
| 647 | mov es:Sublist_msg_Idmes.Sublist_Segment+(size Sublist_Struc)+(size Sublist_Struc),0 ;AN009;bgb | ||
| 648 | pop ds ;an009;bgb | ||
| 649 | Message Idmes_Arg ; the parts out as needed ;AC000' | ||
| 650 | ;;;;;;;;call doCRLF | ||
| 651 | ret ; | ||
| 652 | |||
| 653 | |||
| 654 | |||
| 655 | |||
| 656 | ;***************************************************************************** ;an024;bgb | ||
| 657 | ; Get the volume serial number ;an024;bgb | ||
| 658 | ;***************************************************************************** ;an024;bgb | ||
| 659 | ; Input: FCB_Drive ;an024;bgb | ||
| 660 | ; Output: SerNum if no carry ;an024;bgb | ||
| 661 | ; Notes: Only DOS Version 3.4 and above will contain serial numbers ;an024;bgb | ||
| 662 | ;***************************************************************************** ;an024;bgb | ||
| 663 | PUBLIC GET_SERIAL_NUM ;an024;bgb | ||
| 664 | procedure Get_Serial_Num,NEAR ;AN000;S ;an024;bgb | ||
| 665 | mov al,GENERIC_IOCTL ;AN000;S ;an041;bgb;an024;bgb | ||
| 666 | xor bx,bx ;zero out bx ;an041;bgb;an024;bgb | ||
| 667 | mov bl,alldrv ;AN000;S Which drive to check ;an024;bgb | ||
| 668 | mov ch,rawio ;8 = disk io ;an041;bgb;an024;bgb | ||
| 669 | mov cl,Get_Media_Id ;66h = get media id ;an041;bgb;an024;bgb | ||
| 670 | LEA dx,SerNumBuf ;AN000;S Pt to the buffer ;an024;bgb | ||
| 671 | Dos_call ioctl ;AN000;S Make the call ;an041;bgb;an024;bgb | ||
| 672 | ; $IF NC | ||
| 673 | JC $$IF26 | ||
| 674 | message msgserialnumber ;an024;bgb | ||
| 675 | ; $ENDIF | ||
| 676 | $$IF26: | ||
| 677 | ret ;AN000;S ;an024;bgb | ||
| 678 | endproc Get_Serial_Num ;AN000;S ;an024;bgb | ||
| 679 | pathlabl chkdsk1 ;an024;bgb | ||
| 680 | CODE ENDS | ||
| 681 | END CHKDSK | ||
| 682 | \ No newline at end of file | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKDSK2.ASM b/v4.0/src/CMD/CHKDSK/CHKDSK2.ASM new file mode 100644 index 0000000..45838da --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKDSK2.ASM | |||
| @@ -0,0 +1,449 @@ | |||
| 1 | TITLE CHKDSK - MS-DOS Disk consistancy checker | ||
| 2 | page ,132 ; | ||
| 3 | |||
| 4 | .xlist | ||
| 5 | include chkseg.inc | ||
| 6 | INCLUDE CHKCHNG.INC | ||
| 7 | INCLUDE DOSSYM.INC | ||
| 8 | INCLUDE CHKEQU.INC | ||
| 9 | INCLUDE CHKMACRO.INC | ||
| 10 | include pathmac.inc | ||
| 11 | .list | ||
| 12 | |||
| 13 | SUBTTL Initialized Data | ||
| 14 | PAGE | ||
| 15 | CONST SEGMENT PUBLIC PARA 'DATA' | ||
| 16 | EXTRN BADVER:byte,BADDRV_ARG:word,INVPATH_ARG:word | ||
| 17 | EXTRN FILE_ARG:word | ||
| 18 | EXTRN BADCD_ARG:word,BADSUBDIR:byte | ||
| 19 | EXTRN BADDRVM:byte | ||
| 20 | EXTRN BADIDBYT:byte | ||
| 21 | EXTRN OPNERR_ARG:word,NOEXT_ARG:word,EXTENT_ARG:word | ||
| 22 | EXTRN IDMES_ARG:WORD | ||
| 23 | EXTRN FILE_ARG1:WORD,FILE_ARG2:WORD | ||
| 24 | EXTRN badrw_num:word,BADRW_STR:WORD,BLOCK_NUM:WORD | ||
| 25 | EXTRN BADSW_ARG:WORD,DSKSPC:WORD | ||
| 26 | EXTRN HIDMES:WORD,DIRMES:WORD,FILEMES:WORD,ORPHMES2:WORD | ||
| 27 | EXTRN ORPHMES3:WORD,BADSPC:WORD,FRESPC:WORD | ||
| 28 | EXTRN TOTMEM:WORD,FREMEM:WORD,REPORT_ARG:WORD,CRLF_ARG:WORD | ||
| 29 | EXTRN RARG1:dWORD,RARG3:dWORD,ORPHCNT:dWORD ;an049;bgb | ||
| 30 | EXTRN SubstErr:BYTE | ||
| 31 | extrn tot_bytes_lo:word, tot_bytes_hi:word | ||
| 32 | |||
| 33 | extrn SWITCHAR:byte,TCHAR:byte,HECODE:byte,CONBUF:byte | ||
| 34 | extrn DOTMES:byte,NOISY:byte,HAVFIX:byte | ||
| 35 | extrn DOFIX:byte,DIRBUF:near,PARSTR:byte | ||
| 36 | extrn NUL:byte,ERRSUB:word,ALLFILE:byte | ||
| 37 | extrn ORPHFCB:byte,ORPHEXT:byte,HIDCNT:dword | ||
| 38 | extrn HIDSIZ:word,FILCNT:dword,FILSIZ:word,DIRCNT:dword ;an049;bgb | ||
| 39 | extrn DIRSIZ:word,CROSSCNT:dword,BADSIZ:word ;an049;bgb | ||
| 40 | extrn ORPHSIZ:word ;an049;bgb | ||
| 41 | extrn LCLUS:word ;an049;bgb | ||
| 42 | extrn USERDIR:byte,FRAGMENT:byte | ||
| 43 | extrn ALLDRV:byte,FIXMFLG:byte,DIRCHAR:byte | ||
| 44 | extrn EOFVAL:word ;an050;bgb | ||
| 45 | extrn Idmes2:Byte,Idmes1:Byte,idmes3:byte ;an017;bgb | ||
| 46 | CONST ENDS | ||
| 47 | |||
| 48 | SUBTTL Un-initialized Data | ||
| 49 | PAGE | ||
| 50 | DATA SEGMENT PUBLIC PARA 'DATA' | ||
| 51 | extrn THISDPB:dword,DOTSNOGOOD:byte,NUL_ARG:byte | ||
| 52 | extrn NAMBUF:byte,SRFCBPT:word | ||
| 53 | extrn ISCROSS:byte,MCLUS:word,CSIZE:byte,SSIZE:word | ||
| 54 | extrn DSIZE:word,ARG1:word,ARG_BUF:byte,ERRCNT:byte | ||
| 55 | extrn USERDEV:byte,HARDCH:dword,CONTCH:dword | ||
| 56 | extrn mem_size:word ;an055;bgb | ||
| 57 | extrn psp_segment:word ;an030;bgb | ||
| 58 | extrn write_fault:byte ;an045;bgb | ||
| 59 | DATA ENDS | ||
| 60 | |||
| 61 | CODE SEGMENT PUBLIC PARA 'CODE' | ||
| 62 | ASSUME CS:DG,DS:DG,ES:DG,SS:DG | ||
| 63 | EXTRN INT_23:NEAR | ||
| 64 | EXTRN PROMPTYN:NEAR,GET_CURRDIRERR:NEAR,GET_CURRDIR:NEAR | ||
| 65 | EXTRN FINDCHAIN:NEAR,CHECKERR:NEAR | ||
| 66 | EXTRN Write_Disk:Near, multiply_32_bits:near | ||
| 67 | |||
| 68 | PUBLIC PRINTF_CRLF,DOCRLF,SUBERRP,FCB_TO_ASCZ,EPRINT | ||
| 69 | PUBLIC DOINT26,DOTCOMBMES,REPORT | ||
| 70 | public ramcarv | ||
| 71 | |||
| 72 | |||
| 73 | ;EPRINT: | ||
| 74 | ; CALL CHECKERR | ||
| 75 | ; JNZ RET14 | ||
| 76 | ; cmp byte ptr [nul_arg],0 | ||
| 77 | ; jnz hav_eprint_arg | ||
| 78 | ; mov [file_arg2],offset dg:nul | ||
| 79 | ;hav_eprint_arg: | ||
| 80 | ; mov [file_arg1],dx | ||
| 81 | ; ;mov dx,offset dg:file_arg | ||
| 82 | ; mov dx,file_arg ;Get offset of message ;AC000; | ||
| 83 | ; call printf_crlf | ||
| 84 | ; mov byte ptr [nul_arg],0 | ||
| 85 | ;RET14: ret | ||
| 86 | |||
| 87 | |||
| 88 | EPrint: | ||
| 89 | call CheckErr ;See if we should display msg | ||
| 90 | pathlabl chkdsk2 | ||
| 91 | ; $IF Z ;Yes if Z set ;AC000; | ||
| 92 | JNZ $$IF1 | ||
| 93 | push dx ;Save message ;AC000; | ||
| 94 | Message File_Arg ;Put out file in question ;AC000; | ||
| 95 | pop dx ;Get back message ;AC000; | ||
| 96 | call Printf_CRLF ;Print it | ||
| 97 | cmp byte ptr [nul_arg],0 ;Is there a second message? | ||
| 98 | ; $IF NZ ;Yes if not nul ;AC000; | ||
| 99 | JZ $$IF2 | ||
| 100 | mov dx,File_Arg2 ;Display it ;AN000; | ||
| 101 | call Printf_CRLF ; ;AN000; | ||
| 102 | ; $ENDIF ; ;AC000; | ||
| 103 | $$IF2: | ||
| 104 | mov byte ptr [nul_arg],0 ;Re-init this field | ||
| 105 | ; $ENDIF | ||
| 106 | $$IF1: | ||
| 107 | ret ; | ||
| 108 | |||
| 109 | DOTCOMBMES: | ||
| 110 | CMP [NOISY],0 | ||
| 111 | JZ SUBERRP | ||
| 112 | mov [file_arg2],dx | ||
| 113 | CALL get_currdirERR | ||
| 114 | ;MOV DX,OFFSET DG:CENTRY ;Centry got split into 3 msg's | ||
| 115 | ;inc byte ptr [nul_arg] ; | ||
| 116 | CALL EPRINT | ||
| 117 | RET | ||
| 118 | |||
| 119 | SUBERRP: | ||
| 120 | MOV AL,1 ;found a subdir error | ||
| 121 | XCHG AL,BYTE PTR [ERRSUB] ;set error flag and get old flag | ||
| 122 | CMP AL,0 ;were any errors found before? | ||
| 123 | ; $if z ;no errors found yet | ||
| 124 | JNZ $$IF5 | ||
| 125 | ;JNZ RET32 | ||
| 126 | MOV SI,OFFSET DG:NUL ;display error msgs | ||
| 127 | CALL get_currdirERR | ||
| 128 | MOV DX,OFFSET DG:BADSUBdir | ||
| 129 | CALL EPRINT | ||
| 130 | ; $endif | ||
| 131 | $$IF5: | ||
| 132 | RET32: RET | ||
| 133 | |||
| 134 | ;**************************************************************************** | ||
| 135 | ; called by: get_thisel2 | ||
| 136 | ; inputs: DS:SI - pointer to file name | ||
| 137 | ;**************************************************************************** | ||
| 138 | FCB_TO_ASCZ: ;Convert DS:SI to ASCIZ ES:DI | ||
| 139 | PUSH CX | ||
| 140 | ;move filename from ds:si to es:di | ||
| 141 | MOV CX,8 ; Pack the name | ||
| 142 | REP MOVSB ; Move all of it | ||
| 143 | main_kill_tail: | ||
| 144 | ; delete trailing spaces in name | ||
| 145 | CMP BYTE PTR ES:[DI-1]," " ;was the last char in name a space? | ||
| 146 | JNZ find_check_dot | ||
| 147 | DEC DI ; Back up over trailing space | ||
| 148 | INC CX | ||
| 149 | CMP CX,8 | ||
| 150 | JB main_kill_tail | ||
| 151 | find_check_dot: | ||
| 152 | ; ??? | ||
| 153 | CMP WORD PTR [SI],(" " SHL 8) OR " " | ||
| 154 | JNZ got_ext ; Some chars in extension | ||
| 155 | CMP BYTE PTR [SI+2]," " | ||
| 156 | JZ find_done ; No extension | ||
| 157 | got_ext: | ||
| 158 | ; move period for extension | ||
| 159 | MOV AL,"." | ||
| 160 | STOSB | ||
| 161 | ; move 3 byte extension | ||
| 162 | MOV CX,3 | ||
| 163 | REP MOVSB | ||
| 164 | ext_kill_tail: | ||
| 165 | ;delete trailing blanks | ||
| 166 | CMP BYTE PTR ES:[DI-1]," " ; | ||
| 167 | JNZ find_done ; | ||
| 168 | DEC DI ; Back up over trailing space | ||
| 169 | JMP ext_kill_tail ; | ||
| 170 | find_done: ; | ||
| 171 | ; put hex zero at the end | ||
| 172 | XOR AL,AL ; | ||
| 173 | STOSB ; NUL terminate | ||
| 174 | POP CX | ||
| 175 | RET | ||
| 176 | |||
| 177 | |||
| 178 | DOINT26: | ||
| 179 | ; PUSH CX ;reg saves are handled in write_disk ;ac048;bgb;an045;bgb | ||
| 180 | ; PUSH DX ;reg saves are handled in write_disk ;ac048;bgb;an045;bgb | ||
| 181 | ; PUSH BX ;reg saves are handled in write_disk ;ac048;bgb;an045;bgb | ||
| 182 | call Write_Disk ; ;an045;bgb;AC000; | ||
| 183 | ; POP BX ;reg saves are handled in write_disk ;ac048;bgb;an045;bgb | ||
| 184 | ; POP DX ;reg saves are handled in write_disk ;ac048;bgb;an045;bgb | ||
| 185 | ; POP CX ;reg saves are handled in write_disk ;ac048;bgb;an045;bgb | ||
| 186 | ; JNC RET23 ;ac048;bgb;an045;bgb | ||
| 187 | ;MOV SI,OFFSET DG:WRITING ;ac048;bgb;an045;bgb | ||
| 188 | ;CALL DSKERR ;ac048;bgb;an045;bgb | ||
| 189 | ; $IF C ;ac048;bgb;an045;bgb | ||
| 190 | JNC $$IF7 | ||
| 191 | mov dx,offset dg:write_fault ;ac048;bgb;an045;bgb | ||
| 192 | invoke printf_crlf ;ac048;bgb;an045;bgb | ||
| 193 | ; $ENDIF ;ac048;bgb;an045;bgb | ||
| 194 | $$IF7: | ||
| 195 | ; ;ac048;bgb;ac048;bgb;an045;bgb | ||
| 196 | ;Need to handle 'Fail' option of critical error here. ;ac048;bgb;an045;bgb | ||
| 197 | ; ;ac048;bgb;an045;bgb | ||
| 198 | ;ac048;bgb;an045;bgb | ||
| 199 | ; JZ DOINT26 ;ac048;bgb;an045;bgb | ||
| 200 | RET23: RET ;ac048;bgb;an045;bgb | ||
| 201 | |||
| 202 | |||
| 203 | |||
| 204 | ;************************************** | ||
| 205 | ; Prints all reporting data | ||
| 206 | ;************************************** | ||
| 207 | |||
| 208 | REPORT: | ||
| 209 | ;total disk space | ||
| 210 | mov bx,offset dg:dskspc | ||
| 211 | mov dx,tot_bytes_hi ;total bytes in disk ;AN006;bgb | ||
| 212 | mov ax,tot_bytes_lo ;total bytes in disk ;AN006;bgb | ||
| 213 | xor si,si ;no file count | ||
| 214 | xor di,di ;no file count | ||
| 215 | call Report_Mes_2 ; ;AN006;bgb | ||
| 216 | ;hidden files | ||
| 217 | mov ax,hidsiz ;get cluster count ;an049;bgb | ||
| 218 | or ax,ax ;are there any hidden files? | ||
| 219 | ; $IF NZ ;yes ;AC000; | ||
| 220 | JZ $$IF9 | ||
| 221 | mov si,word ptr hidcnt ;si=low file count ;an049;bgb | ||
| 222 | mov di,word ptr hidcnt+2 ;di=hi file count ;an049;bgb | ||
| 223 | mov bx,offset dg:hidmes ;bx=msg ; | ||
| 224 | call report_mes_1 ; | ||
| 225 | ; $ENDIF ; ;AC000; | ||
| 226 | $$IF9: | ||
| 227 | ;space in subdirectories | ||
| 228 | mov ax,dirsiz ;get cluster count | ||
| 229 | or ax,ax ;Are there any directories? ;an049;bgb | ||
| 230 | ; $IF NZ ;yes ;AC000; | ||
| 231 | JZ $$IF11 | ||
| 232 | mov si,word ptr dircnt ;si=low file count ;an049;bgb | ||
| 233 | mov di,word ptr dircnt+2 ;di=hi file count ;an049;bgb | ||
| 234 | mov bx,offset dg:dirmes ;bx=msg | ||
| 235 | call report_mes_1 ;an049;bgb | ||
| 236 | ; $ENDIF ; ;AC000; | ||
| 237 | $$IF11: | ||
| 238 | ;user files | ||
| 239 | mov ax,filsiz ;get cluster count | ||
| 240 | or ax,ax ;Are there any user files? ;an049;bgb | ||
| 241 | ; $IF NZ ;yes ;AC000; | ||
| 242 | JZ $$IF13 | ||
| 243 | mov si,word ptr filcnt ;si=lo file count ;an049;bgb | ||
| 244 | mov di,word ptr filcnt+2 ;di=hi file count ;an049;bgb | ||
| 245 | mov bx,offset dg:filemes ;bx=msg | ||
| 246 | call report_mes_1 | ||
| 247 | ; $ENDIF ; ;AC000; | ||
| 248 | $$IF13: | ||
| 249 | ;chains of lost clusters | ||
| 250 | mov ax,orphsiz ;get cluster count | ||
| 251 | or ax,ax ;Are there any lost clusters? ;an049;bgb | ||
| 252 | ; $IF NZ ;yes ;AC000; | ||
| 253 | JZ $$IF15 | ||
| 254 | mov si,word ptr orphcnt ;si=lo file count | ||
| 255 | mov di,word ptr orphcnt+2 ;di=hi file count | ||
| 256 | cmp dofix,0 ;/F entered? | ||
| 257 | ; $IF Z ;no ;AC000; | ||
| 258 | JNZ $$IF16 | ||
| 259 | mov bx,offset dg:orphmes3 ;bytes would be recovered | ||
| 260 | ; $else | ||
| 261 | JMP SHORT $$EN16 | ||
| 262 | $$IF16: | ||
| 263 | mov bx,offset dg:orphmes2 ;bytes were recovered | ||
| 264 | ; $ENDIF ; ;AC000; | ||
| 265 | $$EN16: | ||
| 266 | call report_mes_1 | ||
| 267 | ; $ENDIF ; ;AC000; | ||
| 268 | $$IF15: | ||
| 269 | ;clusters of bad spots | ||
| 270 | mov ax,badsiz ;get cluster count | ||
| 271 | or ax,ax ;Are there any bad spots on disk? | ||
| 272 | ; $IF NZ ;if low word > zero, then yes ;AC000; | ||
| 273 | JZ $$IF20 | ||
| 274 | xor si,si ;no files to count | ||
| 275 | xor di,di ;no files to count | ||
| 276 | mov bx,offset dg:badspc ;Issue report | ||
| 277 | call report_mes_1 | ||
| 278 | ; $ENDIF ; ;AC000; | ||
| 279 | $$IF20: | ||
| 280 | ;bytes on disk left - free space | ||
| 281 | mov ax,[dsize] ;get total disk clusters | ||
| 282 | sub ax,[dirsiz] ; - dirs | ||
| 283 | sub ax,[filsiz] ; - files | ||
| 284 | sub ax,[hidsiz] ; - hidden files | ||
| 285 | sub ax,[badsiz] ; - bad spots | ||
| 286 | sub ax,[orphsiz] ; - lost clusters recovered | ||
| 287 | sub ax,[lclus] ; - lost clusters not recovered | ||
| 288 | xor si,si | ||
| 289 | xor di,di | ||
| 290 | mov bx,offset dg:frespc | ||
| 291 | call report_mes_1 ;Free space is whats left | ||
| 292 | call docrlf ; ;AN000; | ||
| 293 | ;size of each allocation unit | ||
| 294 | xor dx,dx ;Figure out cluster size ;AN000; | ||
| 295 | xor ah,ah ; ;AN000; | ||
| 296 | mov cx,SSize ;Bytes/sector * ;AN000; | ||
| 297 | mov al,CSize ; Sectors/cluster ;AN000; | ||
| 298 | mul cx ; = Bytes/Cluster in AX ;AN000; | ||
| 299 | mov bx,offset dg:idmes2 ;Allocation size message ;AN000; | ||
| 300 | xor si,si | ||
| 301 | xor di,di | ||
| 302 | call Report_Mes_2 ; ;AN000; | ||
| 303 | ;total clusters | ||
| 304 | mov ax,Mclus ;Allocation units available ;AN000; | ||
| 305 | dec ax ;MCLUS is # clusters+1 | ||
| 306 | xor dx,dx ; ;AN000; | ||
| 307 | mov bx,offset dg:idmes1 ; ;AN000; | ||
| 308 | xor si,si | ||
| 309 | xor di,di | ||
| 310 | call Report_Mes_2 ; ;AN000; | ||
| 311 | ;;;;;;;;call docrlf ; ;an017;bgb | ||
| 312 | ;avail clusters ;an017;bgb | ||
| 313 | public avail_clus | ||
| 314 | avail_clus: | ||
| 315 | mov ax,[dsize] ;total clusters on disk ;an017;bgb | ||
| 316 | sub ax,[dirsiz] ; - clusters in subdirs ;an017;bgb | ||
| 317 | sub ax,[filsiz] ; - user files ;an017;bgb | ||
| 318 | sub ax,[hidsiz] ; - hidden files ;an017;bgb | ||
| 319 | sub ax,[badsiz] ; - bad spots ;an017;bgb | ||
| 320 | sub ax,[orphsiz] ; - lost clusters recovered ;an017;bgb | ||
| 321 | sub ax,[lclus] ; - lost clusters not recovered ;an017;bgb | ||
| 322 | mov bx,offset dg:idmes3 ; ;an017;bgb | ||
| 323 | xor dx,dx ; ;AN017;bgb | ||
| 324 | xor si,si | ||
| 325 | xor di,di | ||
| 326 | call Report_Mes_2 ;dont convert to bytes! ;an017;bgb | ||
| 327 | call docrlf ;an017;bgb | ||
| 328 | |||
| 329 | |||
| 330 | ;dcl Jan 8, 87 Compensate for RAM Carving - Start | ||
| 331 | |||
| 332 | ramcarv: | ||
| 333 | push es ;AN000; | ||
| 334 | xor bx,bx ;AN000; | ||
| 335 | mov ah,0c1h ; return Ext'd Bios Data Seg Address ;AN000; | ||
| 336 | int 15h ;AN000; | ||
| 337 | ; $IF NC ; ram carving exists if no carry ;AC000; ;AN000; | ||
| 338 | JC $$IF22 | ||
| 339 | xor ax,ax ; zero out ax | ||
| 340 | mov al,byte ptr es:[0] ; pointer to # of 1k blocks of RAM Carve;AN000; | ||
| 341 | mov dx,64 ; convert 1k blocks to paras ;AN000; | ||
| 342 | mul dx ;AN000; | ||
| 343 | mov bx,ax ; save value in BX ;AN000; | ||
| 344 | ; $ENDIF ; ;AC000; ;AN000; | ||
| 345 | $$IF22: | ||
| 346 | pop es ;AN000; | ||
| 347 | |||
| 348 | ;dcl Jan 8, 87 Compensate for RAM Carving - End | ||
| 349 | |||
| 350 | mov ax,[mem_size] ;Find out about memory | ||
| 351 | add ax,bx ; dcl Jan 8, 87 Compensate for RAM Carving | ||
| 352 | mov dx,16 ;Mul to convert kbytes to bytes | ||
| 353 | mul dx | ||
| 354 | mov bx,offset dg:totmem | ||
| 355 | call report_mes_2 | ||
| 356 | mov ax,[mem_size] | ||
| 357 | ;;;;;;; mov dx,psp_segment ;an030;bgb | ||
| 358 | sub ax,psp_segment ;an030;bgb | ||
| 359 | mov dx,16 | ||
| 360 | mul dx | ||
| 361 | mov bx,offset dg:fremem | ||
| 362 | call report_mes_2 | ||
| 363 | ret | ||
| 364 | |||
| 365 | ;************************************************************* | ||
| 366 | ; | ||
| 367 | ; Print the message specified by the control string. | ||
| 368 | ; | ||
| 369 | ; REPORT_MES_1 | ||
| 370 | ; On entry: | ||
| 371 | ; BX contains the address of the control string. | ||
| 372 | ; AX contains a cluster count for the %ld argument in the control string. | ||
| 373 | ; CX contains a word count for the %d argument in the control string | ||
| 374 | ; or is meaningless. | ||
| 375 | ; | ||
| 376 | ; REPORT_MES_2 | ||
| 377 | ; On entry: | ||
| 378 | ; BX contains the address of the control string. | ||
| 379 | ; AX,DX contain a long integer. | ||
| 380 | ; CX contains a word count for the %d argument in the control string | ||
| 381 | ; or is meaningless. | ||
| 382 | ; | ||
| 383 | ;************************************************************* | ||
| 384 | |||
| 385 | ;***************************************************************************** | ||
| 386 | ; REPORT_MES_1 - Print the report messages. Display the file count and | ||
| 387 | ; translate the number of clusters into the number of bytes. | ||
| 388 | ; | ||
| 389 | ; WARNING!! NOTE!! --> | ||
| 390 | ; | ||
| 391 | ; called by - PROCEDURE NAME | ||
| 392 | ; | ||
| 393 | ; inputs: AX - cluster count (1-ffff) | ||
| 394 | ; BX - offset of control string | ||
| 395 | ; CX - | ||
| 396 | ; DX - high word of cluster count is zero'd out here. | ||
| 397 | ; SP - | ||
| 398 | ; BP - | ||
| 399 | ; SI - low word of file count | ||
| 400 | ; DI - hi word of file count | ||
| 401 | ; DS - segment of control string | ||
| 402 | ; ES - | ||
| 403 | ; | ||
| 404 | ; output: DISPLAY OF DATA TO SCREEN | ||
| 405 | ; | ||
| 406 | ; Regs abused - ALL | ||
| 407 | ; | ||
| 408 | ;logic: 1. zero out hi word of cluster count, and multiply by sectors per | ||
| 409 | ; cluster. This gives number of sectors, which is a double word. | ||
| 410 | ; | ||
| 411 | ; 2. multiply by bytes per sector to give number of bytes. | ||
| 412 | ; | ||
| 413 | ; 3. place values in diplay fields, and call the msg. retriever. | ||
| 414 | ; | ||
| 415 | ;***************************************************************************** | ||
| 416 | report_mes_1: | ||
| 417 | push bx ;save it | ||
| 418 | xor dx,dx ;zero out hi word for multiply | ||
| 419 | mov cl,csize ;get sectors per cluster | ||
| 420 | xor ch,ch ;zero out hi byte of word | ||
| 421 | mul cx ;Convert cluster count to sector count ax/dx | ||
| 422 | |||
| 423 | mov bx,dx ;bx:ax is number to be mult;bgb | ||
| 424 | mov cx,ssize ;cx is number to mult with ;bgb | ||
| 425 | call multiply_32_bits ;bgb | ||
| 426 | mov dx,bx ;move hi value to dx | ||
| 427 | pop bx ;retore pointer;bgb | ||
| 428 | |||
| 429 | report_mes_2: | ||
| 430 | mov word ptr rarg1,ax ;Lo word of bytes in ax | ||
| 431 | mov word ptr rarg1+2,dx ;Hi word of bytes in dx | ||
| 432 | mov word ptr rarg3,si ;lo word of file count in si | ||
| 433 | mov word ptr rarg3+2,di ;hi word of file count in di | ||
| 434 | mov report_arg,bx ;Store the offset of the ctrl string | ||
| 435 | mov dx,bx ;dx has ptr to msg for disp_interface ;AC000; | ||
| 436 | call printf_crlf ;print msg, then carraige return | ||
| 437 | ret | ||
| 438 | |||
| 439 | PRINTF_CRLF: | ||
| 440 | call display_interface ; ;AC000; | ||
| 441 | DOCRLF: mov dx,offset dg:crlf_arg | ||
| 442 | call Display_Interface ;Replace old printf call with SysDispMsg;AN000; | ||
| 443 | ret ; ;AN000; | ||
| 444 | |||
| 445 | |||
| 446 | pathlabl chkdsk2 | ||
| 447 | CODE ENDS | ||
| 448 | END | ||
| 449 | \ No newline at end of file | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKEQU.INC b/v4.0/src/CMD/CHKDSK/CHKEQU.INC new file mode 100644 index 0000000..c2cbba5 --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKEQU.INC | |||
| @@ -0,0 +1,206 @@ | |||
| 1 | ;fsexec equ true ; ; ;an038;bgb ; | ||
| 2 | FCB EQU 5CH | ||
| 3 | |||
| 4 | String_Done equ 0 | ||
| 5 | No_Error equ 0 | ||
| 6 | chk_Error equ 1 | ||
| 7 | Stderr equ 2 | ||
| 8 | |||
| 9 | FALSE EQU 0 | ||
| 10 | TRUE EQU NOT FALSE | ||
| 11 | |||
| 12 | ; NOTE WARNING DANGER. | ||
| 13 | ; THIS EQU DEFINES AN OFFSET INTO THE SEARCH FCB OF THE LASTENT VALUE. | ||
| 14 | ; ITS LOCATION MAY CHANGE FROM DOS VERSION TO DOS VERSION. | ||
| 15 | ;2.0/2.1 value | ||
| 16 | ;THISENT EQU 17H ;Relative entry number of current entry | ||
| 17 | ;3.0 value | ||
| 18 | THISENT EQU 14H ;Relative entry number of current entry | ||
| 19 | |||
| 20 | |||
| 21 | ;Attribute bits | ||
| 22 | |||
| 23 | RDONLY EQU 1 | ||
| 24 | HIDDN EQU 2 | ||
| 25 | SYSTM EQU 4 | ||
| 26 | VOLIDA EQU 8 | ||
| 27 | ISDIR EQU 10H | ||
| 28 | DRVCHAR EQU ":" | ||
| 29 | ; | ||
| 30 | ;***************************************************************************** | ||
| 31 | ; Equates | ||
| 32 | ;***************************************************************************** | ||
| 33 | ; | ||
| 34 | |||
| 35 | Multiplex equ 2Fh ; ;AN000; | ||
| 36 | Set_Append_X equ 0B707h ; ;AN000;; | ||
| 37 | Append_X equ 0B706h ; ;AN000;; | ||
| 38 | Append_X_Set equ 1 ; ;AN000; | ||
| 39 | Append_Off equ 0 ; ;AN000; | ||
| 40 | Append_ON equ 1 ; ;AN000; | ||
| 41 | |||
| 42 | |||
| 43 | Disk_Error equ 80h ;INT 24h bit clear if disk error;AN000; | ||
| 44 | |||
| 45 | NO equ 0 ;AN000; | ||
| 46 | YES equ not NO ;AN000; | ||
| 47 | |||
| 48 | Year_Mask equ 0FE00h | ||
| 49 | Month_Mask equ 01E0h | ||
| 50 | Day_Mask equ 001Fh | ||
| 51 | Hour_Mask equ 0F800h | ||
| 52 | Minute_Mask equ 07E0h | ||
| 53 | |||
| 54 | Not_Include equ 0 | ||
| 55 | Do_Include equ 1 | ||
| 56 | |||
| 57 | |||
| 58 | YES_Found equ 1 | ||
| 59 | NO_Found equ 0 | ||
| 60 | |||
| 61 | ON equ 1 | ||
| 62 | OFF equ 0 | ||
| 63 | |||
| 64 | No_Ext_Attrib equ 0 ;AN000; | ||
| 65 | No_Entry equ 0 | ||
| 66 | XA_Chain equ 84h ;Mark head of XA chain ;AN000; | ||
| 67 | |||
| 68 | ifdef fsexec ;an038;bgb | ||
| 69 | Len_FS_String_Buffer equ 13 ;an038;bgb | ||
| 70 | FAT12_File_System equ 01h ;an038;bgb;AN000; | ||
| 71 | FAT16_File_System equ 04h ;an038;bgb;AN000; | ||
| 72 | New_File_System equ 06h ;an038;bgb;AN000; | ||
| 73 | endif | ||
| 74 | |||
| 75 | Bad_Exit equ 0FFh ;Errorlevel = 0FFh ;AN000; | ||
| 76 | |||
| 77 | Net_Check equ 1200h ;AN000; | ||
| 78 | Assign_Check equ 8000h ;AN000; | ||
| 79 | |||
| 80 | Found_Yes equ 1 ;AN000; | ||
| 81 | Found_No equ 0 ;AN000; | ||
| 82 | |||
| 83 | Asciiz_End equ 0 ;AN000; | ||
| 84 | |||
| 85 | Dir_Attribute equ 10h | ||
| 86 | Vol_Attribute equ 08h | ||
| 87 | |||
| 88 | Dir_Entries_Per_Sector equ 512/32 | ||
| 89 | |||
| 90 | |||
| 91 | Critical_Error_Fail equ 3 | ||
| 92 | Write_Protect equ 0 | ||
| 93 | Drive_Not_Ready equ 2 | ||
| 94 | |||
| 95 | Blank equ " " ;AN000; | ||
| 96 | |||
| 97 | Head_Mask equ 7Fh ;Mask to turn off head bit ;AN000; | ||
| 98 | |||
| 99 | |||
| 100 | ;Limits | ||
| 101 | BIG_FAT_THRESHOLD equ 4086 ;AN000; | ||
| 102 | |||
| 103 | |||
| 104 | |||
| 105 | ;------------------------------------------------------------------------------- | ||
| 106 | ; These are the data structures which we will need | ||
| 107 | ;**************************************************************************** | ||
| 108 | ; Structures | ||
| 109 | ;**************************************************************************** | ||
| 110 | ifdef fsexec ;an038;bgb | ||
| 111 | Exec_Block_Parms struc ;an038;bgb | ||
| 112 | Segment_Env dw 0 ;an038;bgb | ||
| 113 | Offset_Command dw 0 ;an038;bgb | ||
| 114 | Segment_Command dw 0 ;an038;bgb | ||
| 115 | Offset_FCB1 dw 0 ;an038;bgb | ||
| 116 | Segment_FCB1 dw 0 ;an038;bgb | ||
| 117 | Offset_FCB2 dw 0 ;an038;bgb | ||
| 118 | Segment_FCB2 dw 0 ;an038;bgb | ||
| 119 | Exec_Block_Parms ends ;an038;bgb | ||
| 120 | |||
| 121 | Media_ID struc ;AN000; | ||
| 122 | Media_ID_Info_Level dw 0 ;AN000; | ||
| 123 | Media_ID_Serial_Number dd 0 ;AN000; | ||
| 124 | Media_ID_Volume_Label db 11 dup(" ") ;AN000; | ||
| 125 | Media_ID_File_System db 8 dup(" ") ;AN000; | ||
| 126 | Media_ID ends ;AN000; | ||
| 127 | endif ;an038;bgb | ||
| 128 | |||
| 129 | Sublist_Struc struc | ||
| 130 | Sublist_Size db ? ; ;AN000; | ||
| 131 | Sublist_Rsv db ? ; ;AN000; | ||
| 132 | Sublist_Offset dw ? ; ;AN000; | ||
| 133 | Sublist_Segment dw ? ; ;AN000; | ||
| 134 | Sublist_Number db ? ; ;AN000; | ||
| 135 | Sublist_Type db ? ; ;AN000; | ||
| 136 | Sublist_Max db ? ; ;AN000; | ||
| 137 | Sublist_Min db ? ; ;AN000; | ||
| 138 | Sublist_Char db ? ; ;AN000; | ||
| 139 | Sublist_Struc ends | ||
| 140 | |||
| 141 | A_DeviceParameters struc | ||
| 142 | |||
| 143 | SpecialFunctions db ? ;1 0 | ||
| 144 | DeviceType db ? ;1 1 | ||
| 145 | DeviceAttributes dw ? ;2 2 | ||
| 146 | NumberOfCylinders dw ? ;2 4 | ||
| 147 | MediaType db ? ;1 6 | ||
| 148 | BytePerSector dw ? ;2 7 | ||
| 149 | SectorsPerCluster db ? ; | ||
| 150 | ReservedSectors dw ? | ||
| 151 | NumberOfFATs db ? | ||
| 152 | RootEntries dw ? | ||
| 153 | TotalSectors dw ? | ||
| 154 | MediaDescriptor db ? | ||
| 155 | SectorsPerFAT dw ? | ||
| 156 | SectorsPerTrack dw ? | ||
| 157 | Heads dw ? | ||
| 158 | HiddenSectors dd ? | ||
| 159 | Ext_Total_Sectors dd ? | ||
| 160 | ReservedArea db 6 dup(?) | ||
| 161 | |||
| 162 | A_DeviceParameters ends | ||
| 163 | |||
| 164 | |||
| 165 | |||
| 166 | |||
| 167 | Relative_Sector_Buffer struc ; ;AN000; | ||
| 168 | |||
| 169 | Start_Sector_Low dw ? ;Low word of RBA sector ;AN000; | ||
| 170 | Start_Sector_High dw ? ;High word of RBA sector ;AN000; | ||
| 171 | Number_Sectors dw ? ;Number of sectors ;AN000; | ||
| 172 | Buffer_Offset dw ? ;Address of data buffer ;AN000; | ||
| 173 | Buffer_Segment dw ? ; ;AN000; | ||
| 174 | |||
| 175 | Relative_Sector_Buffer ends ; ;AN000; | ||
| 176 | |||
| 177 | |||
| 178 | XAL struc ;AN000; | ||
| 179 | |||
| 180 | XAL_Tsize dw ? ;AN000; | ||
| 181 | XAL_TCount dw ? ;AN000; | ||
| 182 | XAL_LSize dw ? ;AN000; | ||
| 183 | XAL_LCount dw ? ;AN000; | ||
| 184 | XAL_Data db 512-8 dup(?) ;AN000; | ||
| 185 | |||
| 186 | XAL ends ;AN000; | ||
| 187 | |||
| 188 | DIRENT STRUC | ||
| 189 | DB 7 DUP (?) ;Ext FCB junk | ||
| 190 | DB ? ;Drive | ||
| 191 | DIRNAM DB 11 DUP (?) ; | ||
| 192 | DIRATT DB ? ; | ||
| 193 | DIRCP DW ? ; ;AN000; | ||
| 194 | DIR_XA DW ? ; ;AN000; | ||
| 195 | DIRATT2 db ? ; ;AN000; | ||
| 196 | DIRRES DB 5 DUP (?) ; ;AC000; | ||
| 197 | DIRTIM DW ? ; | ||
| 198 | DIRDAT DW ? ; | ||
| 199 | DIRCLUS DW ? ; | ||
| 200 | DIRESIZ DD ? ; | ||
| 201 | DIRENT ENDS ; | ||
| 202 | ENTSIZ EQU SIZE DIRENT | ||
| 203 | |||
| 204 | ;------------------------------------------------------------------------------- | ||
| 205 | |||
| 206 | \ No newline at end of file | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKFAT.ASM b/v4.0/src/CMD/CHKDSK/CHKFAT.ASM new file mode 100644 index 0000000..badd48c --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKFAT.ASM | |||
| @@ -0,0 +1,1064 @@ | |||
| 1 | TITLE CHKFAT - procedures that acces the fat and/or fatmap | ||
| 2 | page ,132 ; | ||
| 3 | |||
| 4 | .xlist | ||
| 5 | include chkseg.inc ;an005;bgb | ||
| 6 | INCLUDE CHKCHNG.inc | ||
| 7 | INCLUDE DOSSYM.inc | ||
| 8 | INCLUDE CHKEQU.inc | ||
| 9 | INCLUDE CHKMACRO.inc | ||
| 10 | include pathmac.inc | ||
| 11 | |||
| 12 | |||
| 13 | CONST SEGMENT PUBLIC PARA 'DATA' | ||
| 14 | EXTRN CREATMES:byte,FIXMES_ARG:word | ||
| 15 | EXTRN FREEMES:byte | ||
| 16 | EXTRN BADW_ARG:word,FATAL_END:word | ||
| 17 | EXTRN badrw_num:word,BADRW_STR:WORD,HAVFIX:byte | ||
| 18 | EXTRN FREEBYMES1:byte,FREEBYMES2:byte | ||
| 19 | EXTRN FREE_ARG1:WORD,FREE_ARG2:WORD,FREE_ARG3:WORD,ORPHCNT:dword | ||
| 20 | EXTRN DIRTYFAT:byte,CROSSCNT:dword,DOFIX:byte,SECONDPASS:byte | ||
| 21 | EXTRN BADSIZ:word,ORPHSIZ:word,LCLUS:word,ORPHFCB:byte | ||
| 22 | EXTRN HECODE:byte,USERDIR:byte,FRAGMENT:byte | ||
| 23 | EXTRN ORPHEXT:byte,ALLDRV:byte,FIXMFLG:byte,DIRCHAR:byte | ||
| 24 | EXTRN BIGFAT:byte,EOFVAL:word,BADVAL:word | ||
| 25 | extrn fTrunc:BYTE, rarg1:word ;an018;bgb | ||
| 26 | extrn temp_dd:dword ;an049;bgb | ||
| 27 | CONST ENDS | ||
| 28 | |||
| 29 | DATA SEGMENT PUBLIC PARA 'DATA' | ||
| 30 | extrn fatcnt:byte ;an005;bgb | ||
| 31 | EXTRN THISDPB:dword,NUL_ARG:byte | ||
| 32 | EXTRN NAMBUF:byte,SRFCBPT:word,FATMAP:word | ||
| 33 | EXTRN MCLUS:word,CSIZE:byte,SSIZE:word | ||
| 34 | EXTRN DSIZE:word,ARG1:word,ARG_BUF:byte,ERRCNT:byte | ||
| 35 | EXTRN USERDEV:byte,HARDCH:dword,CONTCH:dword | ||
| 36 | EXTRN ExitStatus:Byte,Read_Write_Relative:Byte | ||
| 37 | extrn bytes_per_sector:word, fattbl:word ;an005;bgb | ||
| 38 | extrn sec_count:word, secs_per_64k:word, paras_per_64k:word ;an005;bgb | ||
| 39 | extrn fattbl_seg:word, fatsiz:word, paras_per_fat:word ;an005;bgb | ||
| 40 | extrn end_of_fatmap:word ;an030;bgb | ||
| 41 | extrn root_entries:word ;ac048;bgb;an047;bgb | ||
| 42 | DATA ENDS | ||
| 43 | |||
| 44 | CODE SEGMENT PUBLIC PARA 'CODE' | ||
| 45 | ASSUME CS:DG,DS:DG,ES:DG,SS:DG | ||
| 46 | EXTRN PRINTF_CRLF:NEAR,FCB_TO_ASCZ:NEAR, recover:near | ||
| 47 | EXTRN EPRINT:NEAR, makorphnam:near | ||
| 48 | EXTRN DOINT26:NEAR,PROMPTYN:NEAR,CHECKFILES:NEAR,DIRPROC:NEAR | ||
| 49 | EXTRN DOCRLF:NEAR, getfilsiz:near, fatal:near, write_disk:near | ||
| 50 | EXTRN GETENT:NEAR,CHECKNOFMES:NEAR, systime:near | ||
| 51 | EXTRN multiply_32_bits:near ;an049;bgb | ||
| 52 | |||
| 53 | public calc_fatmap_seg, MARKMAP, CHKMAP, CHKMAPLP, ORPHAN, CONTLP, RET18 | ||
| 54 | public PromptRecover, NOCHAINREC, CHKMAPLP2, NEXTCLUS | ||
| 55 | public DISPFRB, FINDCHAIN, CHKMAPLP3, CHAINLP, INSERTEOF, FAT12_4, CHKCHHEAD | ||
| 56 | public ADDCHAIN, CHGOON, NEXTCLUS2, | ||
| 57 | public CHAINREC, MAKFILLP, GOTENT, OPAGAIN, GOTORPHNAM, ENTMADE, NEXTENT | ||
| 58 | public NXTORP, RET100, nextorph | ||
| 59 | public AMDONE, REWRITE, WRTLOOP | ||
| 60 | public WRTOK, NOWRITE, DONE, CROSSCHK, calc_fat_addr, pack, unpack | ||
| 61 | .list | ||
| 62 | PHONEY_STACK DW 5 DUP(0) ;ac048;bgb | ||
| 63 | |||
| 64 | pathlabl chkfat | ||
| 65 | ;***************************************************************************** ;an005;bgb | ||
| 66 | ; CALC-FAT-ADDR - calculate the seg/off of the fat cell from the cell number ;an005;bgb | ||
| 67 | ; ;an005;bgb | ||
| 68 | ; Inputs: es - fat table segment | ||
| 69 | ; si - cluster number | ||
| 70 | ; | ||
| 71 | ; Outputs: es - fat table segment + cluster seg | ||
| 72 | ; di - cluster offset | ||
| 73 | ; ;an005;bgb | ||
| 74 | ; LARGE FAT SUPPORT ;an005;bgb | ||
| 75 | ;******************* ;an005;bgb | ||
| 76 | ; the offset into the fat table is cluster number times 2 (2 bytes per fat entry) ;an005;bgb | ||
| 77 | ; This will result not only in the segment boundary being passed, but also in ;an005;bgb | ||
| 78 | ; a single-word math overflow. So, we calculate the the address as follows: ;an005;bgb | ||
| 79 | ; 0. start with cluster number (1-65535) ;an005;bgb | ||
| 80 | ; 1. divide by 8 to get the number of paragraphs per fat-cell (0-8191) ;an005;bgb | ||
| 81 | ; remainder = (0-7) ;an005;bgb | ||
| 82 | ; 2. multiply the remainder by 2 to get offset in bytes (0-15) ;an005;bgb | ||
| 83 | ; You now have a paragraph-offset number that you can use to calc the addr into ;an005;bgb | ||
| 84 | ; the fat table. To get the physical addr you must add it to the offset of the ;an005;bgb | ||
| 85 | ; table in memory. ;an005;bgb | ||
| 86 | ; 3. add the paras to the segment register ;an005;bgb | ||
| 87 | ; 4. add the offset to the offset register ;an005;bgb | ||
| 88 | ;****************************************************************************** ;an005;bgb | ||
| 89 | Procedure calc_fat_addr,near ;an005;bgb | ||
| 90 | savereg <ax,bx,dx> ; ;an005;bgb | ||
| 91 | mov ax,si ;get cluster number from si | ||
| 92 | mov bx,0008h ; div by para (* 2 bytes per clus) ;an005;bgb | ||
| 93 | xor dx,dx ; zero dx for word divide ;an005;bgb | ||
| 94 | div bx ; do it ;an022;bgb;bgb | ||
| 95 | mov bx,es ; get fat table segment ;an005;bgb | ||
| 96 | add bx,ax ; add number of paras to the cluster ;an005;bgb | ||
| 97 | mov es,bx ; move it back ;an005;bgb | ||
| 98 | shl dx,1 ; remainder times 2 ;an005;bgb | ||
| 99 | mov di,dx ; offset = 00 + remainder ;an005;bgb | ||
| 100 | restorereg <dx,bx,ax> ;an005;bgb | ||
| 101 | return ;an005;bgb | ||
| 102 | EndProc calc_fat_addr ;an005;bgb | ||
| 103 | |||
| 104 | ;========================================================================= | ||
| 105 | ; UNPACK : This routine calculates the position in the FAT | ||
| 106 | ; where the cluster number resides and obtains | ||
| 107 | ; its contents. | ||
| 108 | ; | ||
| 109 | ; Inputs : SI - Cluster number | ||
| 110 | ; Outputs : DI - Cluster contents | ||
| 111 | ; zero flag is set if fat cell = zero | ||
| 112 | ; | ||
| 113 | ; LOGIC | ||
| 114 | ; - get addr of fat table | ||
| 115 | ; - if 16-bit fat, | ||
| 116 | ; then get the address of the cell (calc_fat_addr) | ||
| 117 | ; mov it into di | ||
| 118 | ; set the zero flag | ||
| 119 | ; else multiply the cluster-number by 1.5 to get the byte-offset | ||
| 120 | ; move the contents of the cluster into di | ||
| 121 | ; if the cluster-number is odd, | ||
| 122 | ; then shift it right by 1 nibble | ||
| 123 | ; set the zero flag | ||
| 124 | ; else (its already shifted right) | ||
| 125 | ; set the zero flag | ||
| 126 | ;========================================================================= | ||
| 127 | UNPACK proc near ;ac005; dms;unpack FAT | ||
| 128 | push es ;an005;bgb | ||
| 129 | mov es,fattbl_seg ;point to FAT in memory ;an005;bgb | ||
| 130 | mov DI,SI ;put cluster number in DI | ||
| 131 | cmp [BIGFAT],0 ;big fat? | ||
| 132 | ; $IF nz ;yes | ||
| 133 | JZ $$IF1 | ||
| 134 | call calc_fat_addr ;calc addr of cluster ;an005;bgb | ||
| 135 | mov di,word ptr es:[di] ;es:bx points to fat cluster ;an005;bgb | ||
| 136 | or DI,DI ; Set zero | ||
| 137 | ; $ELSE ;small fat | ||
| 138 | JMP SHORT $$EN1 | ||
| 139 | $$IF1: | ||
| 140 | SHR DI,1 | ||
| 141 | ADD DI,SI ; Mult by 1.5 | ||
| 142 | mov DI,word ptr es:[di] | ||
| 143 | TEST SI,1 ;is the cluster number odd? | ||
| 144 | ; $IF nz ;last bit is non-zero; means it is odd | ||
| 145 | JZ $$IF3 | ||
| 146 | SHR DI,1 ;shift by 1 nibble | ||
| 147 | SHR DI,1 | ||
| 148 | SHR DI,1 | ||
| 149 | SHR DI,1 | ||
| 150 | and di,0fffh ;ac005; dms; | ||
| 151 | ; $ELSE ;ac005; dms;even cluster bound. | ||
| 152 | JMP SHORT $$EN3 | ||
| 153 | $$IF3: | ||
| 154 | AND DI,0FFFH | ||
| 155 | ; $ENDIF | ||
| 156 | $$EN3: | ||
| 157 | ; $ENDIF | ||
| 158 | $$EN1: | ||
| 159 | pop es | ||
| 160 | return | ||
| 161 | UNPACK endp ;ac005; dms; | ||
| 162 | |||
| 163 | ;========================================================================= | ||
| 164 | ; PACK : This routine puts data into the FAT. | ||
| 165 | ; | ||
| 166 | ; Inputs : SI - Cluster number to be packed | ||
| 167 | ; dx - Data to be packed | ||
| 168 | ; | ||
| 169 | ; Outputs : Altered FAT | ||
| 170 | ; LOGIC | ||
| 171 | ; - set the fat-changed-flags | ||
| 172 | ; - get the seg of the fat-table | ||
| 173 | ; - if 16-bit fat, | ||
| 174 | ; then get the address of the cell (calc_fat_addr) | ||
| 175 | ; mov the new value into it | ||
| 176 | ; else multiply the cluster-number by 1.5 to get the byte-offset | ||
| 177 | ; move the contents of the cluster into di | ||
| 178 | ; if the cluster-number is odd, | ||
| 179 | ; then shift it right by 1 nibble | ||
| 180 | ; set the zero flag | ||
| 181 | ; else (its already shifted right) | ||
| 182 | ; set the zero flag | ||
| 183 | ;========================================================================= | ||
| 184 | PACK proc near ;ac005; dms; | ||
| 185 | savereg <si,di,es> ;ac048;bgb | ||
| 186 | mov [DIRTYFAT],1 ;Set FAT dirty byte | ||
| 187 | mov [HAVFIX],1 ;Indicate a fix | ||
| 188 | mov es,fattbl_seg ; ;an005;bgb | ||
| 189 | mov DI,SI | ||
| 190 | cmp [BIGFAT],0 | ||
| 191 | ; $IF nz ;ac005; dms;big fat? | ||
| 192 | JZ $$IF7 | ||
| 193 | call calc_fat_addr ;calc addr of cluster ;an005;bgb | ||
| 194 | mov es:[di],dx ;move dx into cluster ;an005;bgb | ||
| 195 | ; $ELSE | ||
| 196 | JMP SHORT $$EN7 | ||
| 197 | $$IF7: | ||
| 198 | shr di,1 ;offset = clus-num * 1.5 | ||
| 199 | add di,si ;offset = clus-num * 1.5 | ||
| 200 | push di ;save cluster offset | ||
| 201 | mov DI,es:[di] ;get previous value, 4 nibbles | ||
| 202 | test si,1 ;is the cluster number odd? | ||
| 203 | ; $IF nz ;last bit is non-zero; means it is odd | ||
| 204 | JZ $$IF9 | ||
| 205 | SHL dx,1 ;shift by 1 nibble | ||
| 206 | SHL dx,1 | ||
| 207 | SHL dx,1 | ||
| 208 | SHL dx,1 | ||
| 209 | AND DI,0FH ;zero out 1st 3 nibbles '000f' | ||
| 210 | ; $ELSE ;even cluster number | ||
| 211 | JMP SHORT $$EN9 | ||
| 212 | $$IF9: | ||
| 213 | AND DI,0F000H ;zero out last 3 nibbles 'f000' | ||
| 214 | ; $ENDIF | ||
| 215 | $$EN9: | ||
| 216 | or DI,dx ;put new value in with old | ||
| 217 | pop si ;get cluster offset | ||
| 218 | mov es:[SI],DI | ||
| 219 | ; $ENDIF | ||
| 220 | $$EN7: | ||
| 221 | restorereg <es,di,si> ;ac048;bgb | ||
| 222 | ret | ||
| 223 | PACK endp ;ac005; dms; | ||
| 224 | |||
| 225 | ;========================================================================= ;an005;bgb | ||
| 226 | ; CROSSCHK : this proc gets the value of the fatmap entry that is pointed ;an005;bgb | ||
| 227 | ; to by an orphan ;an005;bgb | ||
| 228 | ; ;an005;bgb | ||
| 229 | ; Inputs : si - cluster number of the orphan ;an005;bgb | ||
| 230 | ; ;an005;bgb | ||
| 231 | ; Outputs : ah - contents of the fatmap pointed to by di ;an005;bgb | ||
| 232 | ; LOGIC ;an005;bgb | ||
| 233 | ; ***** ;an005;bgb | ||
| 234 | ;========================================================================= ;an005;bgb | ||
| 235 | procedure CROSSCHK ;an005;bgb | ||
| 236 | push es | ||
| 237 | mov es,fatmap ;an005;bgb | ||
| 238 | xor di,di ;an005;bgb | ||
| 239 | ADD DI,SI | ||
| 240 | mov ah,es:[di] ;an005;bgb | ||
| 241 | TEST AH,10H | ||
| 242 | pop es | ||
| 243 | ret | ||
| 244 | EndProc CROSSCHK ;an005;bgb | ||
| 245 | |||
| 246 | ;***************************************************************************** ;an005;bgb | ||
| 247 | ; INIT_FATMAP ;an005;bgb | ||
| 248 | ; description: initialize the fatmap area to all zeros ;an005;bgb | ||
| 249 | ; ;an005;bgb | ||
| 250 | ; called from: main-routine ;an005;bgb | ||
| 251 | ; ;an005;bgb | ||
| 252 | ;Change History: Created 8/31/87 bgb ;an005;bgb | ||
| 253 | ; ;an005;bgb | ||
| 254 | ;Input: segment addr of the fatmap ;an005;bgb | ||
| 255 | ; number of clusters in the fat (1-65535) ;an005;bgb | ||
| 256 | ; ;an005;bgb | ||
| 257 | ;Output: fatmap ;an005;bgb | ||
| 258 | ; ;an005;bgb | ||
| 259 | ; LOGIC ;an005;bgb | ||
| 260 | ;---------- ;an005;bgb | ||
| 261 | ;***************************************************************************** ;an005;bgb | ||
| 262 | Procedure init_fatmap,Near ;AN000;bgb ;an005;bgb | ||
| 263 | savereg <es,di,ax,cx> | ||
| 264 | mov es,fatmap ;get seg of the fatmap ;an005;bgb | ||
| 265 | xor di,di ;get off of the fatmap ;an005;bgb | ||
| 266 | mov cx,[MCLUS] ;do once for each cluster | ||
| 267 | xor AL,AL ;zero means free | ||
| 268 | REP STOSB ;Initialize fatmap to all free | ||
| 269 | mov byte ptr es:[di],al ; ;an010;bgb | ||
| 270 | restorereg <cx,ax,di,es> | ||
| 271 | return | ||
| 272 | endproc init_fatmap ; ;AN000; | ||
| 273 | ; | ||
| 274 | ;***************************************************************************** ;an005;bgb | ||
| 275 | ; CALC_FATMAP_SEG ;an005;bgb | ||
| 276 | ; description: calculate the segment of the fatmap for addressing purposes ;an005;bgb | ||
| 277 | ; ;an005;bgb | ||
| 278 | ; called from: main-routine ;an005;bgb | ||
| 279 | ; ;an005;bgb | ||
| 280 | ;Change History: Created 8/31/87 bgb ;an005;bgb | ||
| 281 | ; ;an005;bgb | ||
| 282 | ;Input: bytes-per-sector ;an005;bgb | ||
| 283 | ; fatsiz ;an005;bgb | ||
| 284 | ; ;an005;bgb | ||
| 285 | ;Output: ram-based fat table ;an005;bgb | ||
| 286 | ; paras-per-fat - number of paragraphs of mem in the fat | ||
| 287 | ; fattbl-seg - segment number of fat table | ||
| 288 | ; fatmap - segment number of the fat map table | ||
| 289 | ; ;an005;bgb | ||
| 290 | ; LOGIC ;an005;bgb | ||
| 291 | ;---------- ;an005;bgb | ||
| 292 | ; - calc length fat-table (in paras) ;an005;bgb | ||
| 293 | ; = bytes-per-sector / 16 * sectors-per-fat ;an005;bgb | ||
| 294 | ; - calc segment of fat table in memory ;an005;bgb | ||
| 295 | ; = es + 64k ;an005;bgb | ||
| 296 | ; - calc segment of fatmap area in memory ;an005;bgb | ||
| 297 | ; = es + 64k + length of fat-table ;an005;bgb | ||
| 298 | ;***************************************************************************** ;an005;bgb | ||
| 299 | Procedure calc_fatmap_seg,Near ;AN000;bgb ;an005;bgb | ||
| 300 | ; calc fat table length ;an005;bgb | ||
| 301 | push es | ||
| 302 | mov ax,bytes_per_sector ; bytes per sector ;an005;bgb | ||
| 303 | xor dx,dx ;an005;bgb | ||
| 304 | mov bx,16 ;an005;bgb | ||
| 305 | div bx ; paras per sector ;an022;bgb;bgb | ||
| 306 | mov cx,fatsiz ;2 ; get sectors per fat ;an005;bgb | ||
| 307 | xor dx,dx ;an005;bgb | ||
| 308 | mul cx ; paras per fat ;an005;bgb | ||
| 309 | mov paras_per_fat,ax ;an005;bgb | ||
| 310 | ; calc fat table segment ;an005;bgb | ||
| 311 | mov bx,es ;get seg of fat-table ;an005;bgb | ||
| 312 | add bx,01000h ;add 64k for end of pgm seg ;an005;bgb | ||
| 313 | mov fattbl_seg,bx ;starting segment of fattbl ;an005;bgb | ||
| 314 | ; calc fatmap segment :an005;bgb | ||
| 315 | add ax,bx ;seg of fatmap= seg of fattbl + size of fattbl ;an005;bgb | ||
| 316 | mov fatmap,ax ;this is the seg of the fatmap ;an005;bgb | ||
| 317 | ; find segment number of end of fatmap ;an030;bgb | ||
| 318 | ;ptm p5000 mov bx,paras_per_fat ;each fat cell is 2 bytes ;an030;bgb | ||
| 319 | ;ptm p5000 shr bx,1 ;each fatmap cell is 1 byte = ;an030;bgb | ||
| 320 | mov bx, [MCLUS] ;P5000 INIT_FATMAP use [MCLUS] | ||
| 321 | shr bx, 1 ;P5000 convert it to para. | ||
| 322 | shr bx, 1 ;P5000 | ||
| 323 | shr bx, 1 ;P5000 | ||
| 324 | shr bx, 1 ;P5000 | ||
| 325 | add ax,bx ;add in fatmap seg = ;an030;bgb | ||
| 326 | inc ax ;P5000 | ||
| 327 | mov end_of_fatmap,ax ;last seg value ;an030;bgb | ||
| 328 | pop es | ||
| 329 | ret ; ;AN000; | ||
| 330 | endproc calc_fatmap_seg ; ;AN000; | ||
| 331 | ; | ||
| 332 | ;ac048;bgb | ||
| 333 | ;***************************************************************************** ;ac048;bgb | ||
| 334 | ; FIX_ENTRY - fill in the dir entry with the lost cluster information, give it ;ac048;bgb | ||
| 335 | ; unique filename, and write it back to disk. ;ac048;bgb | ||
| 336 | ; ;ac048;bgb | ||
| 337 | ; WARNING!! NOTE!! --> ;ac048;bgb | ||
| 338 | ; ;ac048;bgb | ||
| 339 | ; called by - CHAINREC ;ac048;bgb | ||
| 340 | ; ;ac048;bgb | ||
| 341 | ; inputs: AX - drive number ;ac048;bgb | ||
| 342 | ; BX - ram offset of beginning of sector ;ac048;bgb | ||
| 343 | ; CX - ;ac048;bgb | ||
| 344 | ; DX - sector number low ;ac048;bgb | ||
| 345 | ; SP - ;ac048;bgb | ||
| 346 | ; BP - ;ac048;bgb | ||
| 347 | ; SI - cluster number of first cluster in this lost chain ;ac048;bgb | ||
| 348 | ; DI - points to entry in ram ;ac048;bgb | ||
| 349 | ; ;ac048;bgb | ||
| 350 | ; output: AX - ;ac048;bgb | ||
| 351 | ; BX - ;ac048;bgb | ||
| 352 | ; CX - ;ac048;bgb | ||
| 353 | ; DX - ;ac048;bgb | ||
| 354 | ; SP - ;ac048;bgb | ||
| 355 | ; BP - ;ac048;bgb | ||
| 356 | ; SI - ;ac048;bgb | ||
| 357 | ; DI- ;ac048;bgb | ||
| 358 | ; ;ac048;bgb | ||
| 359 | ; Regs abused - di,si,cx ;ac048;bgb | ||
| 360 | ; ;ac048;bgb | ||
| 361 | ;logic: 1. save the starting cluster number ;ac048;bgb | ||
| 362 | ; ;ac048;bgb | ||
| 363 | ; 2. if the recovered file name already exists, then use the next one. ;ac048;bgb | ||
| 364 | ; do this until the name is unique. ;ac048;bgb | ||
| 365 | ; ;ac048;bgb | ||
| 366 | ; 3. move all the pertinant info into the dir entry. ;ac048;bgb | ||
| 367 | ; ;ac048;bgb | ||
| 368 | ; 4. write the dir entry out to disk. ;ac048;bgb | ||
| 369 | ;***************************************************************************** ;ac048;bgb | ||
| 370 | procedure fix_entry,near ;ac048;bgb | ||
| 371 | mov ds:[DI+26],SI ;move 1st clus num into dir entry ;ac048;bgb ;an005;bgb | ||
| 372 | savereg <ax,dx,bx> ;Save INT 26 data ;ac048;bgb | ||
| 373 | ;make sure this name is unique ;ac048;bgb | ||
| 374 | DOS_Call Disk_Reset ;func 0d - flush buffers ;AC000;ac048;bgb; | ||
| 375 | mov dx,OFFSET DG:ORPHFCB ;point to filename file0000.chk ;ac048;bgb | ||
| 376 | mov AH,FCB_OPEN ;open the file just put into the dir ;ac048;bgb | ||
| 377 | OPAGAIN: ;ac048;bgb | ||
| 378 | ; $do ;ac048;bgb | ||
| 379 | $$DO13: | ||
| 380 | INT 21H ;ac048;bgb | ||
| 381 | or AL,AL ;did the open fail? ;ac048;bgb | ||
| 382 | ; $leave nz ;ac048;bgb | ||
| 383 | JNZ $$EN13 | ||
| 384 | call MAKORPHNAM ;Try next name ;ac048;bgb | ||
| 385 | ; $enddo ;ac048;bgb | ||
| 386 | JMP SHORT $$DO13 | ||
| 387 | $$EN13: | ||
| 388 | GOTORPHNAM: ;di still points to entry ;ac048;bgb | ||
| 389 | mov SI,OFFSET DG:ORPHFCB + 1 ;ORPHFCB Now has good name ;ac048;bgb | ||
| 390 | mov cx,11 ;move filename, ext ;ac048;bgb | ||
| 391 | REP MOVSB ;ac048;bgb | ||
| 392 | call MAKORPHNAM ;Make next name ;ac048;bgb | ||
| 393 | xor ax,ax ;fill dir entry with zeros ;ac048;bgb | ||
| 394 | mov cx,11 ;ac048;bgb | ||
| 395 | REP STOSB ;ac048;bgb | ||
| 396 | ; Add in time for orphan file - BAS July 17/85 ;ac048;bgb | ||
| 397 | push dx ;save starting sector number ;ac048;bgb;an045;bgb | ||
| 398 | call SYSTIME ;ac048;bgb | ||
| 399 | STOSW ; Time ;ac048;bgb | ||
| 400 | mov ax,dx ;ac048;bgb | ||
| 401 | STOSW ; Date ;ac048;bgb | ||
| 402 | pop dx ;restore starting sector number ;ac048;bgb ;an045;bgb | ||
| 403 | mov SI,ds:[DI] ;get starting cluster number ;ac048;bgb ;an005;bgb | ||
| 404 | inc DI ;skip firstclus in entry ;ac048;bgb | ||
| 405 | inc DI ;ac048;bgb | ||
| 406 | PUSH DI ;save it from getfilsiz ;ac048;bgb | ||
| 407 | call GETFILSIZ ;calc file size from number of clus ;ac048;bgb | ||
| 408 | POP DI ;restore di ;ac048;bgb | ||
| 409 | STOSW ;ax=file size low ;ac048;bgb | ||
| 410 | mov ax,dx ;dx=filesize high ;ac048;bgb | ||
| 411 | STOSW ; ;ac048;bgb | ||
| 412 | restorereg <bx,dx,ax> ;offset, sector num, drive num ;ac048;bgb | ||
| 413 | mov cx,1 ;number of sectors = 1 ;ac048;bgb | ||
| 414 | call DOINT26 ;write it out to disk ;ac048;bgb | ||
| 415 | ret ;ac048;bgb | ||
| 416 | endproc fix_entry ;ac048;bgb | ||
| 417 | ;ac048;bgb | ||
| 418 | ;***************************************************************************** ;ac048;bgb;an047;bgb | ||
| 419 | ; NEXTORPH - find the cluster number of the next orphan. This assumes that ;ac048;bgb;an047;bgb | ||
| 420 | ; there is at least one lost cluster available. ;ac048;bgb;an047;bgb | ||
| 421 | ; ;ac048;bgb;an047;bgb | ||
| 422 | ; WARNING!! NOTE!! --> ;ac048;bgb;an047;bgb | ||
| 423 | ; ;ac048;bgb;an047;bgb | ||
| 424 | ; called by - PROCEDURE NAME ;ac048;bgb;an047;bgb | ||
| 425 | ; ;ac048;bgb;an047;bgb | ||
| 426 | ; inputs: AX - ;ac048;bgb;an047;bgb | ||
| 427 | ; BX - ;ac048;bgb;an047;bgb | ||
| 428 | ; CX - ;ac048;bgb;an047;bgb | ||
| 429 | ; DX - ;a;ac048;bgbn047;bgb | ||
| 430 | ; SP - ;;ac048;bgban047;bgb | ||
| 431 | ; BP - ;a;ac048;bgbn047;bgb | ||
| 432 | ; SI - cluster number of the previous orphan ;a;ac048;bgbn047;bgb | ||
| 433 | ; DI - ;a;ac048;bgbn047;bgb | ||
| 434 | ; DS - ;a;ac048;bgbn047;bgb | ||
| 435 | ; ES - points to one byte map of the fat ;a;ac048;bgbn047;bgb | ||
| 436 | ; ;a;ac048;bgbn047;bgb | ||
| 437 | ; output: AX - ;;ac048;bgban047;bgb | ||
| 438 | ; BX - ;a;ac048;bgbn047;bgb | ||
| 439 | ; CX - ;;ac048;bgban047;bgb | ||
| 440 | ; DX - ;a;ac048;bgbn047;bgb | ||
| 441 | ; SP - ;a;ac048;bgbn047;bgb | ||
| 442 | ; BP - ;a;ac048;bgbn047;bgb | ||
| 443 | ; SI - cluster number of one past the orphan ;ac048;bgb;an047;bgb | ||
| 444 | ; DI - cluster number of the orphan ;a;ac048;bgbn047;bgb | ||
| 445 | ; DS - ;a;ac048;bgbn047;bgb | ||
| 446 | ; ES - ;a;ac048;bgbn047;bgb | ||
| 447 | ; ;a;ac048;bgbn047;bgb | ||
| 448 | ; Regs abused - none ;ac048;bgb;an047;bgb | ||
| 449 | ; ;;ac048;bgban047;bgb | ||
| 450 | ;logic: 1. save ax & es, and point to fat map ;ac048;bgb;an047;bgb | ||
| 451 | ; ;a;ac048;bgbn047;bgb | ||
| 452 | ; 2. do until the head of a chain is found: ;ac048;bgb ;an047;bgb | ||
| 453 | ; ;;ac048;bgban047;bgb | ||
| 454 | ; 3. get the next cell ;ac048;bgb ;an047;bgb | ||
| 455 | ; ;;ac048;bgban047;bgb | ||
| 456 | ; 4. bump pointers into fat map ;ac048;bgb ;an047;bgb | ||
| 457 | ; ;;ac048;bgban047;bgb | ||
| 458 | ; 5. restore ax & es ;;ac048;bgban047;bgb | ||
| 459 | ;*****************************************************************************;a;ac048;bgbn047;bgb | ||
| 460 | procedure NEXTORPH,near ;a;ac048;bgbn047;bgb | ||
| 461 | savereg <ax,es> ;save regs abused ;ac048;bgb | ||
| 462 | mov es,[FATMAP] ;point to fat map ;ac048;bgb | ||
| 463 | ; $do ;ac048;bgb | ||
| 464 | $$DO16: | ||
| 465 | loopno: mov al,byte ptr es:[si] ;get the indicated fatmap entry ;ac048;bgb ;an005;bgb | ||
| 466 | inc si ;point to the next one ;ac048;bgb ;an005;bgb | ||
| 467 | inc di ;point to the next one ;ac048;bgb ;an005;bgb | ||
| 468 | cmp AL,89H ;stop when you find an 89 ;ac048;bgb | ||
| 469 | ; $leave z ;this means head(80), found(1), and orphan(8) ;ac048;bgb | ||
| 470 | JZ $$EN16 | ||
| 471 | ; $enddo ;ac048;bgb | ||
| 472 | JMP SHORT $$DO16 | ||
| 473 | $$EN16: | ||
| 474 | restorereg <es,ax> ;restore regs ;ac048;bgb | ||
| 475 | return ;ac048;bgb | ||
| 476 | endproc nextorph ;ac048;bgb | ||
| 477 | ;ac048;bgb | ||
| 478 | ;ac048;bgb | ||
| 479 | |||
| 480 | ;**************************************************************************** | ||
| 481 | ; MARKMAP - make a mark in the fat map for every cluster encountered | ||
| 482 | ; | ||
| 483 | ; called by - markfat, | ||
| 484 | ; | ||
| 485 | ; inputs - AL - the mark | ||
| 486 | ; DI - cluster number | ||
| 487 | ; | ||
| 488 | ; outputs - CY if crosslink found | ||
| 489 | ; - AH - previous mark | ||
| 490 | ; - crosscnt (count of number of crosslinks found) | ||
| 491 | ; - fatmap marked | ||
| 492 | ; | ||
| 493 | ; LOGIC | ||
| 494 | ;****** | ||
| 495 | ; - point to fatmap with es | ||
| 496 | ; - if that cell has been found before, | ||
| 497 | ; then mark it crossed x'10' | ||
| 498 | ; else mark it found al | ||
| 499 | ;**************************************************************************** | ||
| 500 | markmap: savereg <si,es> ;Save registers ;AN000; | ||
| 501 | xor si,si ;Get addr of map ;an005;bgb | ||
| 502 | mov es,[FATMAP] ;Get addr of map ;an005;bgb | ||
| 503 | mov ah,es:[di] ;Get entry at that spot ;an005;bgb | ||
| 504 | or ah,ah ;Is it zero? ; ; | ||
| 505 | ; $IF NZ ;already found - mark crossed;If not, we got crosslink ;AC000; | ||
| 506 | JZ $$IF19 | ||
| 507 | add word ptr crosscnt,1 ;Count the crosslink ; ; | ||
| 508 | adc word ptr crosscnt+2,0 ;Count the crosslink ; ; | ||
| 509 | or byte ptr es:[di],10H ;Resets zero in map ;An005;bgb | ||
| 510 | stc ;Indicate crosslink on ret ; ; | ||
| 511 | ; $ELSE ;not found - mark found ;No crosslink ; ; | ||
| 512 | JMP SHORT $$EN19 | ||
| 513 | $$IF19: | ||
| 514 | mov es:[di],al ;Set mark in map ;Ac005;bgb | ||
| 515 | clc ;Indicate things okay ; ; | ||
| 516 | ; $ENDIF ; ;AN000; | ||
| 517 | $$EN19: | ||
| 518 | restorereg <es,si> ; ;AN005;bgb | ||
| 519 | ret ; ; ; | ||
| 520 | |||
| 521 | |||
| 522 | ;**************************************************************************** | ||
| 523 | ; CHKMAP - Compare FAT and FATMAP looking for badsectors and orphans | ||
| 524 | ; | ||
| 525 | ; called by - | ||
| 526 | ; | ||
| 527 | ; inputs - fatmap | ||
| 528 | ; - dsize - number of clusters on the disk | ||
| 529 | ; | ||
| 530 | ; outputs - badsiz - | ||
| 531 | ; - | ||
| 532 | ; - | ||
| 533 | ; LOGIC | ||
| 534 | ;****** | ||
| 535 | ; - get addr of fatmap | ||
| 536 | ; - get offset of 1st cluster in fatmap | ||
| 537 | ; - do for all the clusters on the disk: | ||
| 538 | ; - if the cluster has been found | ||
| 539 | ; then get the next cluster in its chain | ||
| 540 | ; if the cell was never pointed to by anyone (0) | ||
| 541 | ; then get the contents of that cell from the fat | ||
| 542 | ; (the contents of the fat cell should be zero, too) | ||
| 543 | ; if the fat-cell is not zero | ||
| 544 | ; then (it should only be a bad sector) | ||
| 545 | ; if it is a bad sector, inc the bad-sector-counter | ||
| 546 | ; otherwise, we have found an orphan sector | ||
| 547 | ; end-of-loop | ||
| 548 | ; - if there are any orphans, | ||
| 549 | ; then recover them | ||
| 550 | ;**************************************************************************** | ||
| 551 | CHKMAP: | ||
| 552 | push es ;an014;bgb | ||
| 553 | mov es,fatmap ;get segment of the fatmap ;an005;bgb | ||
| 554 | xor si,si ;get the offset of the fatmap ;an005;bgb | ||
| 555 | mov si,2 ;go past the first two (invalid) entries;an005;bgb | ||
| 556 | ;do for all the clusters on the disk | ||
| 557 | mov cx,[DSIZE] ;loop for the number of clusters on the disk | ||
| 558 | CHKMAPLP: | ||
| 559 | mov al,es:[si] ;move a byte from the fatmap to al ;an005;bgb | ||
| 560 | or al,al ;is the cluster found already? | ||
| 561 | ; $IF Z ;fatmap cell is zero | ||
| 562 | JNZ $$IF22 | ||
| 563 | call unpack ;get the contents of it | ||
| 564 | ; $IF NZ ;is there something in the cell? | ||
| 565 | JZ $$IF23 | ||
| 566 | cmp di,[badval] ;is the fat cell pointing to a bad sector? fff7 | ||
| 567 | ; $IF Z ; yes | ||
| 568 | JNZ $$IF24 | ||
| 569 | inc [badsiz] ;inc the bad sector counter | ||
| 570 | mov byte ptr es:[si],4 ;Flag the map ;an005;bgb | ||
| 571 | ; $ELSE ; no, not a bad sector | ||
| 572 | JMP SHORT $$EN24 | ||
| 573 | $$IF24: | ||
| 574 | orphan: inc [orphsiz] ; then its an orphan | ||
| 575 | mov byte ptr es:[si],8 ;Flag it ;an005;bgb | ||
| 576 | ; $ENDIF | ||
| 577 | $$EN24: | ||
| 578 | ; $ENDIF | ||
| 579 | $$IF23: | ||
| 580 | ; $ENDIF | ||
| 581 | $$IF22: | ||
| 582 | CONTLP: | ||
| 583 | inc si ;point si to next cluster | ||
| 584 | loop chkmaplp | ||
| 585 | cmp [orphsiz],0 ;an005;bgb | ||
| 586 | ; $IF A ;if there are any orphans, go recover them ;an005;bgb | ||
| 587 | JNA $$IF29 | ||
| 588 | call recover | ||
| 589 | ; $ENDIF | ||
| 590 | $$IF29: | ||
| 591 | pop es ;an014;bgb | ||
| 592 | RET18: ret | ||
| 593 | |||
| 594 | ;***************************************************************************** | ||
| 595 | ; PROMPTRECOVER - do the actual recovering of files | ||
| 596 | ; | ||
| 597 | ; inputs: es - points to fatmap | ||
| 598 | ; ax - | ||
| 599 | ; bx - | ||
| 600 | ; cx - | ||
| 601 | ; dx - | ||
| 602 | ; | ||
| 603 | ; outputs: | ||
| 604 | ; LOGIC | ||
| 605 | ; - ask the user if he wants to convert the orphans to files | ||
| 606 | ; - | ||
| 607 | ; - | ||
| 608 | ;*************************************************************************** | ||
| 609 | PromptRecover: | ||
| 610 | mov dx,OFFSET DG:FREEMES | ||
| 611 | call PROMPTYN ;Ask user | ||
| 612 | ; $IF Z | ||
| 613 | JNZ $$IF31 | ||
| 614 | jmp CHAINREC | ||
| 615 | ; $ENDIF | ||
| 616 | $$IF31: | ||
| 617 | NOCHAINREC: | ||
| 618 | mov es,[fatmap] ;Free all orphans ;an005;bgb | ||
| 619 | mov si,2 ;an005;bgb | ||
| 620 | mov cx,[dsize] | ||
| 621 | xor dx,dx ;dx is the new value (free) | ||
| 622 | CHKMAPLP2: | ||
| 623 | mov al,es:[si] ;get next byte from fatmap into al | ||
| 624 | TEST AL,8 ; is it an orphan? | ||
| 625 | ; $IF NZ ;yes | ||
| 626 | JZ $$IF33 | ||
| 627 | call PACK ;si=cluster number dx=new value | ||
| 628 | ; $ENDIF | ||
| 629 | $$IF33: | ||
| 630 | NEXTCLUS: | ||
| 631 | inc si | ||
| 632 | loop CHKMAPLP2 | ||
| 633 | xor ax,ax | ||
| 634 | XCHG ax,[ORPHSIZ] ;number of orphans = zero | ||
| 635 | mov cx,OFFSET DG:FREEBYMES1 ;print msg | ||
| 636 | cmp [DOFIX],0 | ||
| 637 | ; $IF Z | ||
| 638 | JNZ $$IF35 | ||
| 639 | mov cx,OFFSET DG:FREEBYMES2 | ||
| 640 | mov [LCLUS],ax ;move number of lost clust would be ;an049;bgb | ||
| 641 | ; $ENDIF | ||
| 642 | $$IF35: | ||
| 643 | DISPFRB: ;ax=lost clusters (1-fff6) | ||
| 644 | push bx ;save it ;an049;bgb | ||
| 645 | push cx ;save it ;an049;bgb | ||
| 646 | mov cl,[csize] ;get sectors per cluster (1-32) ;an049;bgb | ||
| 647 | xor ch,ch ;zero out high byte ;an049;bgb | ||
| 648 | xor dx,dx ;zero out hi word for word mult ;an049;bgb | ||
| 649 | mul cx ;cx*ax=dx:ax lost sectors (1-1ffec0);an049;bgb | ||
| 650 | mov bx,dx ;move high word for call ;an049;bgb | ||
| 651 | mov cx,ssize ;word to mult with ;an049;bgb | ||
| 652 | call multiply_32_bits ;bx:ax is result ;an049;bgb | ||
| 653 | mov word ptr rarg1,ax ;low word into low word ;an049;bgb | ||
| 654 | mov word ptr rarg1+2,bx ;hi word into hi word ;an049;bgb | ||
| 655 | mov [free_arg1],ax | ||
| 656 | mov [free_arg2],bx ;an049;bgb | ||
| 657 | mov [free_arg3],cx | ||
| 658 | pop cx | ||
| 659 | pop bx | ||
| 660 | mov dx,cx ;Point to right message;an049;bgb | ||
| 661 | call printf_crlf | ||
| 662 | ret | ||
| 663 | |||
| 664 | |||
| 665 | |||
| 666 | |||
| 667 | ;***************************************************************************** | ||
| 668 | ; FINDCHAIN - | ||
| 669 | ; | ||
| 670 | ; called by - recover | ||
| 671 | ; | ||
| 672 | ; inputs: | ||
| 673 | ; | ||
| 674 | ; outputs: | ||
| 675 | ; LOGIC - search thru entire fatmap | ||
| 676 | ; - | ||
| 677 | ; - | ||
| 678 | ;*************************************************************************** | ||
| 679 | lostdeb equ 0 ;set private build version on ;an047;bgb | ||
| 680 | lost_str db '00000' ;max size of cluster number | ||
| 681 | FINDCHAIN: | ||
| 682 | ;Do chain recovery on orphans | ||
| 683 | mov es,[FATMAP] ; point to fatmap | ||
| 684 | mov SI,2 ; point to fatmap | ||
| 685 | mov dx,si ; point to fatmap | ||
| 686 | mov cx,[DSIZE] ;get total number of clusters on disk | ||
| 687 | CHKMAPLP3: | ||
| 688 | mov al,es:[si] ;get next fatmap entry | ||
| 689 | inc si ;point to next fatmap entry | ||
| 690 | ;has to be an orphan(08) | ||
| 691 | TEST AL,8 ;Orphan? | ||
| 692 | jz NEXTCLUS2 ;Nope | ||
| 693 | ;make sure its not a regular file entry | ||
| 694 | TEST AL,1 ;Seen before ? | ||
| 695 | jnz NEXTCLUS2 ;Yup | ||
| 696 | ;recover this chain | ||
| 697 | savereg <si,cx,dx> ;Save search environment | ||
| 698 | dec SI | ||
| 699 | or byte ptr es:[si],81H ;Mark as seen and head | ||
| 700 | |||
| 701 | |||
| 702 | IF LOSTDEB ;is this private build version? | ||
| 703 | call lostdisp ;display lost cluster numbers | ||
| 704 | ENDIF | ||
| 705 | |||
| 706 | add word ptr orphcnt,1 ;Found a chain | ||
| 707 | adc word ptr orphcnt+2,0 ;Found a chain | ||
| 708 | mov SI,dx ;point to the next fatmap entry | ||
| 709 | CHAINLP: | ||
| 710 | call UNPACK ;si = fat cell | ||
| 711 | XCHG SI,DI ;si=contents, di=cell number | ||
| 712 | cmp SI,[EOFVAL] ;is this the end of the file? | ||
| 713 | JAE CHGOON ;yes, then we are done | ||
| 714 | PUSH DI ;no, not eof | ||
| 715 | ;dont do this next part if any of two conditions: | ||
| 716 | ; 1. invalid cluster number | ||
| 717 | ; 2. points to itself | ||
| 718 | cmp SI,2 ;well, is it a valid cluster number? | ||
| 719 | JB INSERTEOF ;Bad cluster number | ||
| 720 | cmp SI,[dsize] | ||
| 721 | JA INSERTEOF ;Bad cluster number | ||
| 722 | cmp SI,DI ;how bout if it points to itself? | ||
| 723 | jz INSERTEOF ;Tight loop | ||
| 724 | ; find out what it points TO | ||
| 725 | call CROSSCHK | ||
| 726 | TEST AH,8 ;Points to a non-orphan? | ||
| 727 | jnz CHKCHHEAD ;Nope | ||
| 728 | ;orphan points to nothing | ||
| 729 | INSERTEOF: | ||
| 730 | ; you come here if: | ||
| 731 | ; 1. invalid cluster number | ||
| 732 | ; 2. points to itself | ||
| 733 | ; 3. points to nothing | ||
| 734 | POP SI ;the previous cluster number | ||
| 735 | mov dx,0FFFH ;get eof value (12-bit) | ||
| 736 | cmp [BIGFAT],0 | ||
| 737 | jz FAT12_4 | ||
| 738 | mov dx,0FFFFH ;get eof value (16-bit) | ||
| 739 | FAT12_4: | ||
| 740 | call PACK ;stick it in! | ||
| 741 | jmp SHORT CHGOON ;and we are done | ||
| 742 | ; orphan point to a head entry | ||
| 743 | CHKCHHEAD: | ||
| 744 | TEST AH,80H ;Previosly marked head? | ||
| 745 | jz ADDCHAIN ;Nope | ||
| 746 | AND BYTE PTR es:[DI],NOT 80H ;Turn off head bit | ||
| 747 | sub word ptr orphcnt,1 ;Wasn't really a head | ||
| 748 | sbb word ptr orphcnt+2,0 ;Wasn't really a head | ||
| 749 | POP DI ;Clean stack | ||
| 750 | jmp SHORT CHGOON | ||
| 751 | ADDCHAIN: | ||
| 752 | TEST AH,1 ;Previosly seen? | ||
| 753 | jnz INSERTEOF ;Yup, don't make a cross link | ||
| 754 | or BYTE PTR es:[DI],1 ;Mark as seen | ||
| 755 | POP DI ;Clean stack | ||
| 756 | jmp CHAINLP ;Follow chain | ||
| 757 | CHGOON: | ||
| 758 | POP dx ;Restore search | ||
| 759 | POP cx | ||
| 760 | POP SI | ||
| 761 | NEXTCLUS2: | ||
| 762 | inc dx | ||
| 763 | loop CHKMAPLP3 | ||
| 764 | ret | ||
| 765 | |||
| 766 | |||
| 767 | |||
| 768 | ;***************************************************************************** ;ac048;bgb | ||
| 769 | ; CHAINREC - the user has requested us to recover the lost clusters ;ac048;bgb | ||
| 770 | ; ;ac048;bgb | ||
| 771 | ; inputs: ;ac048;bgb | ||
| 772 | ; note: although called from PROMPTRECOVER, this routine returns control to ;ac048;bgb | ||
| 773 | ; recover via the ret instruction. ;ac048;bgb | ||
| 774 | ;***************************************************************************** ;ac048;bgb | ||
| 775 | ;ac048;bgb | ||
| 776 | ;***************************************************************************** ;ac048;bgb | ||
| 777 | ; CHAINREC - The user has requested us to recover the lost clusters ;ac048;bgb | ||
| 778 | ; ;ac048;bgb | ||
| 779 | ; WARNING!! NOTE!! --> the count of the number of lost cluster chains remains, | ||
| 780 | ; for this proc, a single word. More than 64k chains | ||
| 781 | ; will cause this proc to fail. | ||
| 782 | ; ;ac048;bgb | ||
| 783 | ; called by - PROCEDURE NAME ;ac048;bgb | ||
| 784 | ; ;ac048;bgb | ||
| 785 | ; inputs: AX - N/A ;ac048;bgb | ||
| 786 | ; bx - ;ac048;bgb | ||
| 787 | ; cx - N/A ;ac048;bgb | ||
| 788 | ; dx - N/A ;ac048;bgb | ||
| 789 | ; SP - ;ac048;bgb | ||
| 790 | ; BP - N/A ;ac048;bgb | ||
| 791 | ; SI - N/A ;ac048;bgb | ||
| 792 | ; DI - N/A ;ac048;bgb | ||
| 793 | ; data: root_entries ;ac048;bgb | ||
| 794 | ; orphcnt ;ac048;bgb | ||
| 795 | ; ;ac048;bgb | ||
| 796 | ; output: AX - ;ac048;bgb | ||
| 797 | ; bx - ;ac048;bgb | ||
| 798 | ; cx - ;ac048;bgb | ||
| 799 | ; dx - ;ac048;bgb | ||
| 800 | ; SP - ;ac048;bgb | ||
| 801 | ; BP - ;ac048;bgb | ||
| 802 | ; SI - ;ac048;bgb | ||
| 803 | ; DI- ;ac048;bgb | ||
| 804 | ; ;ac048;bgb | ||
| 805 | ; Regs abused - ;ac048;bgb | ||
| 806 | ; ;ac048;bgb | ||
| 807 | ;logic: 1. ;ac048;bgb | ||
| 808 | ;***************************************************************************** ;ac048;bgb | ||
| 809 | CHAINREC: ;ac048;bgb | ||
| 810 | push es ;save es if it is used for anything ;ac048;bgb | ||
| 811 | push ds ;make es point to data ;ac048;bgb | ||
| 812 | pop es ;ac048;bgb | ||
| 813 | ;find the cluster number of the orphan ;ac048;bgb | ||
| 814 | mov SI,2 ;start at first cluster ;an005;bgb ;ac048;bgb | ||
| 815 | mov DI,1 ;point to previous cluster? ;ac048;bgb | ||
| 816 | call NEXTORPH ;di points to orphan ;ac048;bgb | ||
| 817 | ;init for loop ;ac048;bgb | ||
| 818 | savereg <si,di> ;save orphan, orphan+1 ;ac048;bgb | ||
| 819 | mov SI,DI ;si point to orphan ;ac048;bgb | ||
| 820 | xor ax,ax ;set count of dir entries processed to zero;ac048;bgb | ||
| 821 | mov dx,word ptr orphcnt ;get low word of lost clusters ;ac048;bgb;an049;bgb | ||
| 822 | mov word ptr temp_dd,dx ;get low word of lost clusters ;an049;bgb | ||
| 823 | mov dx,word ptr orphcnt+2 ;get hi word of lost clusters ;an049;bgb | ||
| 824 | mov word ptr temp_dd+2,dx ;get hi word of lost clusters ;an049;bgb | ||
| 825 | mov BP,OFFSET DG:PHONEY_STACK ;Set BP to point to "root" ;ac048;bgb | ||
| 826 | ;do for all dir entries: ;ac048;bgb | ||
| 827 | MAKFILLP: ;ac048;bgb | ||
| 828 | ; $DO ;do for all root entries ;ac048;bgb | ||
| 829 | $$DO37: | ||
| 830 | savereg <ax> ;cnt of entries processed, num orphans ;ac048;bgb;an049;bgb | ||
| 831 | call GETENT ;DI points to entry ;ac048;bgb | ||
| 832 | cmp BYTE PTR ds:[DI],0E5H ;is this dir entry erased? ;an;ac048;bgb005;bgb | ||
| 833 | ; $if z,or ;ac048;bgb | ||
| 834 | JZ $$LL38 | ||
| 835 | cmp BYTE PTR ds:[DI],0 ;is this dir entry empty? ;an;ac048;bgb005;bgb | ||
| 836 | ; $if z ;ac048;bgb | ||
| 837 | JNZ $$IF38 | ||
| 838 | $$LL38: | ||
| 839 | GOTENT: mov [HAVFIX],1 ;Making a fix ;ac048;bgb | ||
| 840 | cmp [DOFIX],0 ;/f parameter specified? ;ac048;bgb | ||
| 841 | ; $if NZ ;yes- do the fix ;ac048;bgb | ||
| 842 | JZ $$IF39 | ||
| 843 | call fix_entry ;ac048;bgb | ||
| 844 | ; $endif ;ac048;bgb | ||
| 845 | $$IF39: | ||
| 846 | ENTMADE: restorereg <ax,di,si> ;ac048;bgb;an049;bgb | ||
| 847 | sub word ptr temp_dd,1 ;finished with one orphan ;ac048;bgb;an049;bgb | ||
| 848 | sbb word ptr temp_dd+2,0 ;finished with one orphan ;ac048;bgb;an049;bgb | ||
| 849 | cmp word ptr temp_dd,0 ;is that the last one? ;ac048;bgb;an049;bgb | ||
| 850 | ; $IF Z,AND ;no, check the hi word ;an049;bgb | ||
| 851 | JNZ $$IF41 | ||
| 852 | cmp word ptr temp_dd+2,0;is that the last one? ;ac048;bgb;an049;bgb | ||
| 853 | ; $IF Z ;neither are zero ;an049;bgb | ||
| 854 | JNZ $$IF41 | ||
| 855 | jmp RET100 ; yes,we are done ;ac048;bgb;an049;bgb | ||
| 856 | ; $endif ;an049;bgb | ||
| 857 | $$IF41: | ||
| 858 | call NEXTORPH ;get the cluster of the next one ;ac048;bgb | ||
| 859 | savereg <si,di> ;ac048;bgb | ||
| 860 | mov SI,DI ;ac048;bgb | ||
| 861 | ; $else ;dir entry was not erased or zero ;ac048;bgb | ||
| 862 | JMP SHORT $$EN38 | ||
| 863 | $$IF38: | ||
| 864 | NEXTENT: restorereg <ax> ;ac048;bgb;an049;bgb | ||
| 865 | ; $endif ;ac048;bgb | ||
| 866 | $$EN38: | ||
| 867 | NXTORP: inc ax ;ac048;bgb | ||
| 868 | cmp ax,root_entries ;do for 0 to (root_entries - 1) ;ac048;bgb | ||
| 869 | ; $leave z ;ac048;bgb | ||
| 870 | JZ $$EN37 | ||
| 871 | ; $ENDDO ;ac048;bgb | ||
| 872 | JMP SHORT $$DO37 | ||
| 873 | $$EN37: | ||
| 874 | restorereg <ax,ax> ;Clean Stack from si,di ;ac048;bgb | ||
| 875 | sub word ptr orphcnt,dx ;Couldn't make them all ;ac048;bgb | ||
| 876 | sbb word ptr orphcnt+2,0 ;Couldn't make them all ;ac048;bgb | ||
| 877 | mov dx,OFFSET DG:CREATMES ;ac048;bgb | ||
| 878 | mov byte ptr [arg_buf],0 ;ac048;bgb | ||
| 879 | call EPRINT ;ac048;bgb | ||
| 880 | RET100: pop es ;restore es ;ac048;bgb | ||
| 881 | ret ;ac048;bgb | ||
| 882 | ;ac048;bgb | ||
| 883 | ;ac048;bgb | ||
| 884 | ;ac048;bgb | ||
| 885 | |||
| 886 | ;***************************************************************************** | ||
| 887 | ;***************************************************************************** | ||
| 888 | SUBTTL AMDONE - Finish up routine | ||
| 889 | PAGE | ||
| 890 | Public AmDone | ||
| 891 | AMDONE: | ||
| 892 | ASSUME DS:NOTHING | ||
| 893 | cmp [DIRTYFAT],0 | ||
| 894 | jz NOWRITE ;FAT not dirty | ||
| 895 | cmp [DOFIX],0 | ||
| 896 | jz NOWRITE ;Not supposed to fix | ||
| 897 | REWRITE: | ||
| 898 | LDS bx,[THISDPB] | ||
| 899 | ASSUME DS:NOTHING | ||
| 900 | mov cx,[bx.dpb_FAT_size] ;Sectors for one fat (DCR) ;AC000; | ||
| 901 | mov DI,cx | ||
| 902 | mov CL,[bx.dpb_FAT_count] ;Number of FATs | ||
| 903 | mov dx,[bx.dpb_first_FAT] ;First sector of FAT | ||
| 904 | PUSH CS | ||
| 905 | POP DS | ||
| 906 | ASSUME DS:DG | ||
| 907 | mov [ERRCNT],0 | ||
| 908 | ; set up to write to the disk | ||
| 909 | xor bx,bx ;offset of the fat-table ;an005;bgb | ||
| 910 | mov es,fattbl_seg ;segment of the fat-table ;an005;bgb | ||
| 911 | mov AL,[ALLDRV] | ||
| 912 | dec AL | ||
| 913 | mov AH,1 | ||
| 914 | PUSH cx | ||
| 915 | WRTLOOP: | ||
| 916 | XCHG cx,DI | ||
| 917 | PUSH dx | ||
| 918 | PUSH cx | ||
| 919 | PUSH DI | ||
| 920 | PUSH ax | ||
| 921 | |||
| 922 | call Write_Disk ;Do relative sector write ;AC000; | ||
| 923 | |||
| 924 | JNC WRTOK | ||
| 925 | inc [ERRCNT] | ||
| 926 | ;mov [badrw_str],offset dg:writing | ||
| 927 | POP ax ; Get fat # in AH | ||
| 928 | PUSH ax ; Back on stack | ||
| 929 | xchg al,ah ; Fat # to AL | ||
| 930 | xor ah,ah ; Make it a word | ||
| 931 | mov [badrw_num],ax | ||
| 932 | mov dx,offset dg:badw_arg | ||
| 933 | call PRINTf_crlf | ||
| 934 | WRTOK: | ||
| 935 | POP ax | ||
| 936 | POP cx | ||
| 937 | POP DI | ||
| 938 | POP dx | ||
| 939 | inc AH | ||
| 940 | ADD dx,DI | ||
| 941 | loop WRTLOOP ;Next FAT | ||
| 942 | POP cx ;Number of FATs | ||
| 943 | cmp CL,[ERRCNT] ;Error on all? | ||
| 944 | ; $if e | ||
| 945 | JNE $$IF47 | ||
| 946 | jmp fatal | ||
| 947 | ; $endif | ||
| 948 | $$IF47: | ||
| 949 | ; make sure that the data fields are always adressable, because | ||
| 950 | ;we can come here after a ctl - break has happened. so point to them w/ cs: | ||
| 951 | NOWRITE: | ||
| 952 | DOS_Call Disk_Reset ; ;AC000; | ||
| 953 | mov dx,OFFSET DG:USERDIR ;Recover users directory | ||
| 954 | DOS_Call ChDir ; ;AC000; | ||
| 955 | cmp BYTE PTR cs:[FRAGMENT],1 ;Check for any fragmented files? ;an029;bgb | ||
| 956 | jnz DONE ;No -- we're finished | ||
| 957 | call CHECKFILES ;Yes -- report any fragments | ||
| 958 | Public Done | ||
| 959 | DONE: | ||
| 960 | ASSUME DS:NOTHING | ||
| 961 | mov DL,cs:[USERDEV] ;Recover users drive ;an029;bgb | ||
| 962 | DOS_Call Set_Default_Drive ; ;AC000; | ||
| 963 | ret | ||
| 964 | |||
| 965 | |||
| 966 | |||
| 967 | |||
| 968 | |||
| 969 | |||
| 970 | |||
| 971 | |||
| 972 | |||
| 973 | IF LOSTDEB ;is this private build version? | ||
| 974 | Procedure lostdisp,near ;an005;bgb | ||
| 975 | savereg <ax,bx,cx,dx,si,di> ; ;an005;bgb | ||
| 976 | mov ax,dx ;save orig value | ||
| 977 | |||
| 978 | mov cl,12 ;shift 3 nibbles | ||
| 979 | shr dx,cl ;remove al but last nibble | ||
| 980 | and dx,000fh | ||
| 981 | cmp dx,0ah | ||
| 982 | ; $IF B | ||
| 983 | JNB $$IF49 | ||
| 984 | add dx,30h ;make it char | ||
| 985 | ; $ELSE | ||
| 986 | JMP SHORT $$EN49 | ||
| 987 | $$IF49: | ||
| 988 | add dx,37h | ||
| 989 | ; $ENDIF | ||
| 990 | $$EN49: | ||
| 991 | push ax | ||
| 992 | mov ah,2 | ||
| 993 | int 21h | ||
| 994 | pop ax | ||
| 995 | |||
| 996 | mov dx,ax ;get orig value | ||
| 997 | mov cl,8 | ||
| 998 | shr dx,cl | ||
| 999 | and dx,000fh | ||
| 1000 | cmp dx,0ah | ||
| 1001 | ; $IF B | ||
| 1002 | JNB $$IF52 | ||
| 1003 | add dx,30h ;make it char | ||
| 1004 | ; $ELSE | ||
| 1005 | JMP SHORT $$EN52 | ||
| 1006 | $$IF52: | ||
| 1007 | add dx,37h | ||
| 1008 | ; $ENDIF | ||
| 1009 | $$EN52: | ||
| 1010 | push ax | ||
| 1011 | mov ah,2 | ||
| 1012 | int 21h | ||
| 1013 | pop ax | ||
| 1014 | |||
| 1015 | mov dx,ax ;get orig value | ||
| 1016 | mov cl,4 | ||
| 1017 | shr dx,cl | ||
| 1018 | and dx,000fh | ||
| 1019 | cmp dx,0ah | ||
| 1020 | ; $IF B | ||
| 1021 | JNB $$IF55 | ||
| 1022 | add dx,30h ;make it char | ||
| 1023 | ; $ELSE | ||
| 1024 | JMP SHORT $$EN55 | ||
| 1025 | $$IF55: | ||
| 1026 | add dx,37h | ||
| 1027 | ; $ENDIF | ||
| 1028 | $$EN55: | ||
| 1029 | push ax | ||
| 1030 | mov ah,2 | ||
| 1031 | int 21h | ||
| 1032 | pop ax | ||
| 1033 | |||
| 1034 | mov dx,ax ;get orig value | ||
| 1035 | and dx,000fh | ||
| 1036 | cmp dx,0ah | ||
| 1037 | ; $IF B | ||
| 1038 | JNB $$IF58 | ||
| 1039 | add dx,30h ;make it char | ||
| 1040 | ; $ELSE | ||
| 1041 | JMP SHORT $$EN58 | ||
| 1042 | $$IF58: | ||
| 1043 | add dx,37h | ||
| 1044 | ; $ENDIF | ||
| 1045 | $$EN58: | ||
| 1046 | mov ah,2 | ||
| 1047 | int 21h | ||
| 1048 | |||
| 1049 | mov dl,' ' ;space after last number | ||
| 1050 | mov ah,2 | ||
| 1051 | int 21h | ||
| 1052 | |||
| 1053 | restorereg <di,si,dx,bx,cx,ax> ;an005;bgb | ||
| 1054 | return ;an005;bgb | ||
| 1055 | EndProc lostdisp ;an005;bgb | ||
| 1056 | ENDIF | ||
| 1057 | |||
| 1058 | |||
| 1059 | pathlabl chkfat | ||
| 1060 | |||
| 1061 | |||
| 1062 | CODE ENDS | ||
| 1063 | END | ||
| 1064 | \ No newline at end of file | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKINIT.ASM b/v4.0/src/CMD/CHKDSK/CHKINIT.ASM new file mode 100644 index 0000000..d904553 --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKINIT.ASM | |||
| @@ -0,0 +1,1548 @@ | |||
| 1 | page ,132 ; | ||
| 2 | ;***************************************************************************** | ||
| 3 | ;***************************************************************************** | ||
| 4 | ;UTILITY NAME: CHKOVER.COM | ||
| 5 | ; | ||
| 6 | ;MODULE NAME: CHKINIT.SAL | ||
| 7 | ; | ||
| 8 | ;ÚÄÄÄÄÄÄÄÄÄÄÄ¿ | ||
| 9 | ;³ Main_Init ³ | ||
| 10 | ;ÀÄÂÄÄÄÄÄÄÄÄÄÙ | ||
| 11 | ; ³ | ||
| 12 | ; ³ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ | ||
| 13 | ; ôInit_Input_OutputÃÄÄÄÄ´Preload_Messages³ | ||
| 14 | ; ³ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ | ||
| 15 | ; ³ ³ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ | ||
| 16 | ; ³ ôParse_Drive_Letter ³ | ||
| 17 | ; ³ ³ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ | ||
| 18 | ; ³ ³ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ | ||
| 19 | ; ³ ôParse_Command_Line ³ | ||
| 20 | ;; ³ ³ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ | ||
| 21 | ; ³ ³ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ | ||
| 22 | ; ³ À´Interpret_Parse³ | ||
| 23 | ; ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ | ||
| 24 | ; ³ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ | ||
| 25 | ; ôValidate_Target_DriveôCheck_Target_Drive³ | ||
| 26 | ; ³ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ³ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ | ||
| 27 | ; ³ ³ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ | ||
| 28 | ; ³ ôCheck_For_Network³ | ||
| 29 | ; ³ ³ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ | ||
| 30 | ; ³ ³ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ | ||
| 31 | ; ³ À´Check_Translate_Drive³ | ||
| 32 | ; ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ | ||
| 33 | ; ³ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ | ||
| 34 | ; ôHook_Interrupts³ | ||
| 35 | ; ³ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ | ||
| 36 | ; ³ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ | ||
| 37 | ; ôClear_Append_X³ | ||
| 38 | ; ³ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ | ||
| 39 | ; ³ÚÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ | ||
| 40 | ; ôCHKDSK_IFSôEXEC_FS_CHKDSK³ | ||
| 41 | ; ³ÀÄÄÄÄÄÄÄÄÄÄÙ³ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ | ||
| 42 | ; ³ ³ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿ | ||
| 43 | ; ³ À´Main_Routine³ | ||
| 44 | ; ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ | ||
| 45 | ; ³ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ | ||
| 46 | ; À´Reset_Append_X³ | ||
| 47 | ; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ | ||
| 48 | ;***************************************************************************** | ||
| 49 | ;;an099;dcl for p3202 | ||
| 50 | ;***************************************************************************** | ||
| 51 | |||
| 52 | ; | ||
| 53 | ;***************************************************************************** | ||
| 54 | ; Include files | ||
| 55 | ;***************************************************************************** | ||
| 56 | .xlist ;an000;bgb | ||
| 57 | include chkseg.inc ;an005;bgb ;an000;bgb | ||
| 58 | include pathmac.inc ;an000;bgb | ||
| 59 | INCLUDE CHKEQU.INC ; ;an000;bgb;AN000; | ||
| 60 | INCLUDE CHKCHNG.INC ;List of changes ;an000;bgb | ||
| 61 | include dossym.inc ;an000;bgb | ||
| 62 | INCLUDE SYSCALL.INC ; ;an000;bgb;AN000; | ||
| 63 | INCLUDE CHKMACRO.INC ; ;an000;bgb;AN000; | ||
| 64 | INCLUDE CHKPARSE.INC ; ;an000;bgb;AN000; | ||
| 65 | INCLUDE IOCTL.INC ;an000;bgb | ||
| 66 | .list ;an000;bgb | ||
| 67 | ;an000;bgb | ||
| 68 | ;an000;bgb | ||
| 69 | ;an000;bgb | ||
| 70 | psp segment public para 'DUMMY' ;an000;bgb | ||
| 71 | org 05Ch ;an000;bgb | ||
| 72 | FCB1 label byte ;an000;bgb | ||
| 73 | org 06Ch ;an000;bgb | ||
| 74 | FCB2 label byte ;an000;bgb | ||
| 75 | psp ends ;an000;bgb | ||
| 76 | ;an000;bgb | ||
| 77 | ; ;an000;bgb | ||
| 78 | DATA segment public para 'DATA' ;an000;bgb | ||
| 79 | ;***************************************************************************** ;an000;bgb | ||
| 80 | ; Data Area ;an000;bgb | ||
| 81 | ;***************************************************************************** ;an000;bgb | ||
| 82 | old_drive db 0 ;an000;bgb | ||
| 83 | |||
| 84 | include version.inc | ||
| 85 | |||
| 86 | IF IBMCOPYRIGHT | ||
| 87 | |||
| 88 | ELSE | ||
| 89 | |||
| 90 | myramdisk db 'RDV 1.20' | ||
| 91 | |||
| 92 | ENDIF | ||
| 93 | |||
| 94 | myvdisk db 'VDISK' ;an000;bgb | ||
| 95 | bytes_per_sector dw 0 ;an005;bgb ;an000;bgb | ||
| 96 | BPB_Buffer A_DeviceParameters <> ; ;an000;bgb;AN000; | ||
| 97 | ;an000;bgb | ||
| 98 | Data_Start_Low dw ? ; ;an000;bgb;AN000; | ||
| 99 | Data_Start_High dw ? ; ;an000;bgb | ||
| 100 | ;an000;bgb | ||
| 101 | public command_line_buffer ;an046;bgb | ||
| 102 | Command_Line_Buffer db 128 dup(0) ; ;an000;bgb;AN000; | ||
| 103 | Command_Line_Length equ $ - Command_Line_Buffer ; ;an000;bgb;AN000; | ||
| 104 | ;an046;bgb | ||
| 105 | Fatal_Error db 0 ; ;an000;bgb;AN000; | ||
| 106 | ;an000;bgb | ||
| 107 | Command_Line db NO ; ;an000;bgb | ||
| 108 | Append db 0 ; ;an000;bgb | ||
| 109 | ;an000;bgb | ||
| 110 | ifdef fsexec ;an038;bgb | ||
| 111 | ;These should stay together ; ;an038;bgb | ||
| 112 | ; --------------------------------------- ; ; ;an038;bgb | ||
| 113 | FS_String_Buffer db 13 dup(" ") ; ;an038;bgb | ||
| 114 | FS_String_End db "CHK.EXE",0 ; ;an038;bgb | ||
| 115 | Len_FS_String_End equ $ - FS_String_End ; ;an038;bgb | ||
| 116 | ;---------------------------------------- ; ;an038;bgb | ||
| 117 | FS_Not_Fat db 0 ; ;an038;bgb | ||
| 118 | FAT12_String db "FAT12 " ; ;an038;bgb | ||
| 119 | FAT16_String db "FAT16 " ; ;an038;bgb | ||
| 120 | Len_FS_ID_String equ $ - FAT16_String ; ;an038;bgb | ||
| 121 | Media_ID_Buffer Media_ID <> ; ;an038;bgb | ||
| 122 | endif ;an038;bgb | ||
| 123 | |||
| 124 | ExitStatus db 0 ; ;an000;bgb;AN000; | ||
| 125 | ;an000;bgb | ||
| 126 | PSP_Segment dw 0 ; ;an000;bgb;AN000; | ||
| 127 | tot_bytes_lo dw 0 ; low word of number of sectors in disk ;an000;bgb;an006;bgb | ||
| 128 | tot_bytes_hi dw 0 ;high word of number of sectors in disk ;an000;bgb;an006;bgb | ||
| 129 | fat_dir_secs dw 0 ;sectors in fat, directory and resvd ;an000;bgb;an006;bgb | ||
| 130 | ;an000;bgb | ||
| 131 | ;***************************************************************************** ;an000;bgb | ||
| 132 | ; Public Data Declarations ;an000;bgb | ||
| 133 | ;***************************************************************************** ;an000;bgb | ||
| 134 | public bpb_buffer ;an000;bgb;an006;bgb | ||
| 135 | public tot_bytes_lo ;an000;bgb;an006;bgb | ||
| 136 | public tot_bytes_hi ;an000;bgb;an006;bgb | ||
| 137 | public fat_dir_secs ;an000;bgb;an006;bgb | ||
| 138 | public bytes_per_sector ;an000;bgb;an005;bgb | ||
| 139 | Public Data_Start_Low ;an000;bgb | ||
| 140 | Public Data_Start_High ;an000;bgb | ||
| 141 | Public Fatal_Error ;an000;bgb | ||
| 142 | Public ExitStatus ;an000;bgb | ||
| 143 | Public PSP_Segment ;an000;bgb | ||
| 144 | ifdef fsexec ;an038;bgb | ||
| 145 | Public FS_String_Buffer ;an038;bgb | ||
| 146 | endif ;an038;bgb | ||
| 147 | ; ;an000;bgb | ||
| 148 | ;***************************************************************************** ;an000;bgb | ||
| 149 | ; External Data Declarations ;an000;bgb | ||
| 150 | ;***************************************************************************** ;an000;bgb | ||
| 151 | EXTRN movsi:word ;move si pointer here for display of invalid parm ;an046;bgb;an000;bgb;an005;bgb | ||
| 152 | EXTRN fatcnt:Byte ;an000;bgb;an005;bgb | ||
| 153 | EXTRN AllDrv:Byte ;an000;bgb | ||
| 154 | EXTRN VolNam:Byte ;an000;bgb | ||
| 155 | EXTRN BadDrvM:Byte ;an000;bgb | ||
| 156 | EXTRN OrphFCB:Byte ;an000;bgb | ||
| 157 | EXTRN Arg_Buf:Byte ;an000;bgb | ||
| 158 | EXTRN Noisy:Byte ;an000;bgb | ||
| 159 | EXTRN DoFix:Byte ;an000;bgb | ||
| 160 | EXTRN SubstErr:Byte ;an000;bgb | ||
| 161 | EXTRN No_Net_Arg:Byte ;an000;bgb | ||
| 162 | EXTRN UserDev:Byte ;an000;bgb | ||
| 163 | EXTRN BadDrv_Arg:Byte ;an000;bgb | ||
| 164 | EXTRN TranSrc:Byte ;an000;bgb | ||
| 165 | EXTRN ContCh:Word ;an000;bgb | ||
| 166 | EXTRN HardCh:Word ;an000;bgb | ||
| 167 | EXTRN Fragment:Byte ;an000;bgb | ||
| 168 | EXTRN Parse_Error_Msg:Byte ;an000;bgb | ||
| 169 | EXTRN Chkprmt_End:Byte ;an000;bgb | ||
| 170 | extrn save_drive:byte ;an000;bgb | ||
| 171 | EXTRN Read_Write_Relative:Byte ;an000;bgb | ||
| 172 | EXTRN inval_media:byte ;an000;bgb;an033;bgb | ||
| 173 | data ends ;an000;bgb | ||
| 174 | ;an000;bgb | ||
| 175 | ;an000;bgb | ||
| 176 | code segment public para 'CODE' ;an000;bgb | ||
| 177 | ;***************************************************************************** ;an000;bgb | ||
| 178 | ; External Routine Declarations ;an000;bgb | ||
| 179 | ;***************************************************************************** ;an000;bgb | ||
| 180 | ifdef fsexec ;an038;bgb | ||
| 181 | EXTRN Exec_FS_CHKDSK:Near ;an000;bgb | ||
| 182 | endif | ||
| 183 | EXTRN SysLoadMsg:Near ;an000;bgb | ||
| 184 | EXTRN SysDispMsg:Near ;an000;bgb | ||
| 185 | EXTRN Done:Near ;an000;bgb | ||
| 186 | EXTRN Main_Routine:Near ;an000;bgb | ||
| 187 | EXTRN INT_23:Near ;an000;bgb | ||
| 188 | EXTRN INT_24:Near ;an000;bgb | ||
| 189 | EXTRN Path_Name:Near ;an000;bgb | ||
| 190 | extrn read_once:near ;an000;bgb | ||
| 191 | |||
| 192 | public p97, multiply_32_bits ;an000;bgb | ||
| 193 | public func60 ;an000;bgb | ||
| 194 | public hook_interrupts ;an000;bgb | ||
| 195 | public get_bpb ;an000;bgb | ||
| 196 | |||
| 197 | pathlabl chkinit ;an000;bgb | ||
| 198 | ;***************************************************************************** ;an000;bgb | ||
| 199 | ;Routine name: Main_Init ;an000;bgb | ||
| 200 | ;***************************************************************************** ;an000;bgb | ||
| 201 | ; ;an000;bgb | ||
| 202 | ;Description: Main control routine for init section ;an000;bgb | ||
| 203 | ; ;an000;bgb | ||
| 204 | ;Called Procedures: Check_DOS_Version ;an000;bgb | ||
| 205 | ; Init_Input_Output ;an000;bgb | ||
| 206 | ; Validate_Target_Drive ;an000;bgb | ||
| 207 | ; Hook_Interrupts ;an000;bgb | ||
| 208 | ; Clear_Append_X ;an000;bgb | ||
| 209 | ; CHKDSK_IFS ;an000;bgb | ||
| 210 | ; Reset_Append_X ;an000;bgb | ||
| 211 | ; ;an000;bgb | ||
| 212 | ;Input: None ;an000;bgb | ||
| 213 | ; ;an000;bgb | ||
| 214 | ;Output: None ;an000;bgb | ||
| 215 | ; ;an000;bgb | ||
| 216 | ;Change History: Created 5/8/87 MT ;an000;bgb | ||
| 217 | ; ;an000;bgb | ||
| 218 | ;Psuedocode ;an000;bgb | ||
| 219 | ;---------- ;an000;bgb | ||
| 220 | ; ;an000;bgb | ||
| 221 | ; Set segregs to DATA ;an000;bgb | ||
| 222 | ; Get segment of PSP ;an000;bgb | ||
| 223 | ; Fatal_Error = NO ;an000;bgb | ||
| 224 | ; Flush all buffers (INT 21h AH=0Dh) ;an000;bgb | ||
| 225 | ; Parse input and load messages (CALL Init_Input_Output) ;an000;bgb | ||
| 226 | ; IF !Fatal_Error ;an000;bgb | ||
| 227 | ; Check target drive letter (CALL Validate_Target_Drive) ;an000;bgb | ||
| 228 | ; IF !Fatal_Error ;an000;bgb | ||
| 229 | ; Set up Control Break (CALL Hook_Interrupts) ;an000;bgb | ||
| 230 | ; IF !Fatal_Error ;an000;bgb | ||
| 231 | ; CALL Clear_Append_X ;an000;bgb | ||
| 232 | ; CALL CHKDSK_IFS ;an000;bgb | ||
| 233 | ; CALL Reset_Append_X ;an000;bgb | ||
| 234 | ; ENDIF ;an000;bgb | ||
| 235 | ; ENDIF ;an000;bgb | ||
| 236 | ; ENDIF ;an000;bgb | ||
| 237 | ; Exit program ;an000;bgb | ||
| 238 | ;***************************************************************************** ;an000;bgb | ||
| 239 | ;an000;bgb | ||
| 240 | Procedure Main_Init ; ;an000;bgb;AN000; | ||
| 241 | Set_Data_Segment ;Setup addressibility ;an000;bgb;AN000; | ||
| 242 | call get_psp ;an000;bgb | ||
| 243 | ;;;;;;;;DOS_Call GetCurrentPSP ;Get PSP segment address ;an000;bgb;ac034;bgb | ||
| 244 | ;;;;;;;;mov PSP_Segment,bx ;Save it for later ;an000;bgb;ac034;bgb | ||
| 245 | mov Fatal_Error,No ;Init the error flag ;an000;bgb;AN000; | ||
| 246 | Dos_Call Disk_Reset ;Flush all buffers ;an000;bgb | ||
| 247 | call Init_IO ;Setup messages and parse ;an000;bgb;AN000; | ||
| 248 | cmp Fatal_Error,Yes ;Error occur? ;an000;bgb;AN000; | ||
| 249 | ; $IF NE ;Nope, keep going ;an000;bgb;AN000; | ||
| 250 | JE $$IF1 | ||
| 251 | call Validate_Target_Drive ;Check drive letter ;an000;bgb;AN000; | ||
| 252 | cmp Fatal_Error,Yes ;Error occur? ;an000;bgb;AN000; | ||
| 253 | ; $IF NE ;Nope, keep going ;an000;bgb;AN000; | ||
| 254 | JE $$IF2 | ||
| 255 | ;;;;;;;;;;;;;;call Hook_Interrupts ;Set CNTRL -Break hook ;an000;bgb;AN000; | ||
| 256 | call Clear_Append_X ; ;an000;bgb;AN000; | ||
| 257 | call CHKDSK_IFS ;Chkdsk correct file system ;an000;bgb;AN000; | ||
| 258 | call Reset_Append_X ; ;an000;bgb;AN000; | ||
| 259 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 260 | $$IF2: | ||
| 261 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 262 | $$IF1: | ||
| 263 | mov al,ExitStatus ;Get Errorlevel ;an000;bgb;AN000; | ||
| 264 | DOS_Call Exit ;Exit program ;an000;bgb;AN000; | ||
| 265 | int 20h ;If other exit fails ;an000;bgb;AN000; | ||
| 266 | Main_Init endp ; ;an000;bgb;AN000; | ||
| 267 | ;an000;bgb | ||
| 268 | ;***************************************************************************** ;an000;bgb | ||
| 269 | ;Routine name: get_psp ;an000;bgb | ||
| 270 | ;***************************************************************************** ;an000;bgb | ||
| 271 | ;Description: get info from the psp area ;an000;bgb | ||
| 272 | ; ;an000;bgb | ||
| 273 | ;Called Procedures: get_drive ;an000;bgb | ||
| 274 | ; ;an000;bgb | ||
| 275 | ;Change History: Created 8/7/87 bgb ;an000;bgb | ||
| 276 | ; ;an000;bgb | ||
| 277 | ;Input: none ;an000;bgb | ||
| 278 | ; ;an000;bgb | ||
| 279 | ;Output: psp_segment ;an000;bgb | ||
| 280 | ; command_line_buffer ;an000;bgb | ||
| 281 | ; ;an000;bgb | ||
| 282 | ;Psuedocode ;an000;bgb | ||
| 283 | ;---------- ;an000;bgb | ||
| 284 | ; get addr of psp ;an000;bgb | ||
| 285 | ; move command line into data seg ;an000;bgb | ||
| 286 | ; get drive number of target ;an000;bgb | ||
| 287 | ; get addr of data seg ;an000;bgb | ||
| 288 | ; call get_drive ;an000;bgb | ||
| 289 | ; ret ;an000;bgb | ||
| 290 | ;***************************************************************************** ;an000;bgb | ||
| 291 | Procedure get_psp ;;AN000; ;an000;bgb | ||
| 292 | ;;;;;;;;DOS_Call GetCurrentPSP ;Get PSP segment address :AN035;b;an000;bgbgb | ||
| 293 | ;;;;;;;;mov PSP_Segment,bx ;Save it for later ;AN035;b;an000;bgbgb | ||
| 294 | ; get command line from psp ;an000;bgb;AN000;bgb | ||
| 295 | mov cx,PSP_Segment ;point ds to data seg ;an000;bgb;AN000;bgb | ||
| 296 | mov ds,cx ; " " " " " ;an000;bgb;AN000;bgb | ||
| 297 | assume ds:NOTHING,es:dg ; " " " " " ;an000;bgb;AN000;bgb | ||
| 298 | ; get the drive number of the target from the psp (0=default, a=1, b=2, c=3) ;AN;an000;bgb000;bgb | ||
| 299 | mov bl,ds:[FCB1] ;Get target drive from FCB -74 ;AN0;an000;bgb00; | ||
| 300 | Set_Data_Segment ;Set DS,ES to Data segment ;AN0;an000;bgb00;bgb | ||
| 301 | call get_drive ;an000;bgb | ||
| 302 | ret ;an000;bgb | ||
| 303 | get_psp endp ; ;AN000; ;an000;bgb | ||
| 304 | ;an000;bgb | ||
| 305 | ;an000;bgb | ||
| 306 | ;***************************************************************************** ;an000;bgb | ||
| 307 | ;Routine name: get_drive ;an000;bgb | ||
| 308 | ;***************************************************************************** ;an000;bgb | ||
| 309 | ;Description: get drive letter from reg bl ;an000;bgb | ||
| 310 | ; ;an000;bgb | ||
| 311 | ;Change History: Created 8/7/87 bgb ;an000;bgb | ||
| 312 | ; ;an000;bgb | ||
| 313 | ;Input: bl = drive num (default=0) ;an000;bgb | ||
| 314 | ; ;an000;bgb | ||
| 315 | ;Output: driveletter ;an000;bgb | ||
| 316 | ; user_drive ;an000;bgb | ||
| 317 | ; ;an000;bgb | ||
| 318 | ;Psuedocode ;an000;bgb | ||
| 319 | ;---------- ;an000;bgb | ||
| 320 | ; IF drive-num = default ;an000;bgb | ||
| 321 | ; get default drive number (a=1) ;an000;bgb | ||
| 322 | ; convert to letter ;an000;bgb | ||
| 323 | ; ELSE ;an000;bgb | ||
| 324 | ; convert to letter ;an000;bgb | ||
| 325 | ; ENDIF ;an000;bgb | ||
| 326 | ; move letter into data areas ;an000;bgb | ||
| 327 | ; ret ;an000;bgb | ||
| 328 | ;***************************************************************************** ;an000;bgb | ||
| 329 | Procedure get_drive ;;AN000; ;an000;bgb | ||
| 330 | ; convert drive number to drive letter ;an000;bgb | ||
| 331 | cmp bl,0 ;a=1 b=2 c=3 ;Is it default drive? 0=default ;AN000; ;an000;bgb | ||
| 332 | ; $IF E ;Yes, turn it into drive letter ;AN000; ;an000;bgb | ||
| 333 | JNE $$IF5 | ||
| 334 | ; get default drive number ;an000;bgb | ||
| 335 | DOS_Call Get_Default_Drive ;Get default drive num in al ;AN00;an000;bgb0; | ||
| 336 | ;a=0, b=1, c=2 ;an000;bgb | ||
| 337 | ; $ELSE ;Not default, A=1 ;AN000; ;an000;bgb | ||
| 338 | JMP SHORT $$EN5 | ||
| 339 | $$IF5: | ||
| 340 | ; bl already contains the correct drive number - save it ;an000;bgb | ||
| 341 | dec bl ;make it zero based ;an000;bgb | ||
| 342 | mov al,bl ;an000;bgb | ||
| 343 | ; $ENDIF ; 74+40=b4 ;an000;bgb | ||
| 344 | $$EN5: | ||
| 345 | mov BadDrvm+1,al ; " " " " ;an000;bgb ;AN000; | ||
| 346 | inc al ;an000;bgb | ||
| 347 | mov byte ptr Buffer.drnum_stroff,al ; ;an000;bgb ; | ||
| 348 | mov AllDrv,al ; ;an000;bgb ;AC000; | ||
| 349 | mov VolNam,al ; ;an000;bgb ;AC000; | ||
| 350 | mov OrphFCB,al ; ;an000;bgb ;AC000; | ||
| 351 | dec al ;an000;bgb | ||
| 352 | add al,"A" ;convert it to letter ;AN000; ;an000;bgb | ||
| 353 | mov arg_buf,al ;set up prompt msg ;AN0;an000;bgb00;bgb | ||
| 354 | ret ;an000;bgb | ||
| 355 | get_drive endp ; ;AN000; ;an000;bgb | ||
| 356 | ;an000;bgb | ||
| 357 | ;***************************************************************************** ;an000;bgb | ||
| 358 | ;Routine name: Init_Input_Output ;an000;bgb | ||
| 359 | ;***************************************************************************** ;an000;bgb | ||
| 360 | ; ;an000;bgb | ||
| 361 | ;description: Initialize messages, Parse command line if FAT file system ;an000;bgb | ||
| 362 | ; ;an000;bgb | ||
| 363 | ;Called Procedures: Preload_Messages ;an000;bgb | ||
| 364 | ; Parse_Command_Line ;an000;bgb | ||
| 365 | ; ;an000;bgb | ||
| 366 | ;Change History: Created 5/10/87 MT ;an000;bgb | ||
| 367 | ; ;an000;bgb | ||
| 368 | ;Input: PSP command line at 81h and length at 80h ;an000;bgb | ||
| 369 | ; ;an000;bgb | ||
| 370 | ;Output: FS_Not_FAT = YES/NO ;an000;bgb | ||
| 371 | ; ;an000;bgb | ||
| 372 | ;Psuedocode ;an000;bgb | ||
| 373 | ;---------- ;an000;bgb | ||
| 374 | ; ;an000;bgb | ||
| 375 | ; FS_Not_FAT = NO ;an000;bgb | ||
| 376 | ; Load messages (CALL Preload_Messages) ;an000;bgb | ||
| 377 | ; IF !Fatal_Error ;an000;bgb | ||
| 378 | ; Get file system type (INT 21h AX=440Dh, CX=084Eh GET MEDIA_ID) ;an000;bgb | ||
| 379 | ; IF CY (Old type diskette),OR ;an000;bgb | ||
| 380 | ; IF "FAT_12 ",OR ;an000;bgb | ||
| 381 | ; IF "FAT_16 " ;an000;bgb | ||
| 382 | ; CALL Parse_Command_Line ;an000;bgb | ||
| 383 | ; IF !Fatal_Error ;an000;bgb | ||
| 384 | ; Interpret_Parse ;an000;bgb | ||
| 385 | ; ENDIF ;an000;bgb | ||
| 386 | ; ELSE ;an000;bgb | ||
| 387 | ; Get drive letter only (CALL Parse_Drive_Letter) ;an000;bgb | ||
| 388 | ; FS_Not_FAT = YES ;an000;bgb | ||
| 389 | ; ENDIF ;an000;bgb | ||
| 390 | ; ENDIF ;an000;bgb | ||
| 391 | ; ret ;an000;bgb | ||
| 392 | ;***************************************************************************** ;an000;bgb | ||
| 393 | ;an000;bgb | ||
| 394 | Procedure Init_IO ; ;AN000; ;an000;bgb | ||
| 395 | ;an000;bgb | ||
| 396 | call Preload_Messages ;Load up message retriever ;an000;bgb;AN000; | ||
| 397 | ifdef fsexec ;an038;bgb | ||
| 398 | mov FS_Not_FAT,No ;an038;bgb | ||
| 399 | cmp Fatal_Error,YES ;Quit? ;an038;bgb;AN000; | ||
| 400 | ; $IF NE ;Nope, keep going ;an038;bgb;AN000; | ||
| 401 | JE $$IF8 | ||
| 402 | mov al,GENERIC_IOCTL ;Generic IOCtl call ;an038;bgb;AN000; | ||
| 403 | push ds ; ;an038;bgb;AN000; | ||
| 404 | mov bx,PSP_Segment ; ;an038;bgb;AN000; | ||
| 405 | mov ds,bx ; ;an038;bgb;AN000; | ||
| 406 | assume ds:nothing ; ;an038;bgb;AN000; | ||
| 407 | ;an038;bgb | ||
| 408 | mov bl,ds:FCB1 ;Get drive (A=1) ;an038;bgb;AN000; | ||
| 409 | ;an038;bgb | ||
| 410 | pop ds ; ;an038;bgb;AN000; | ||
| 411 | assume ds:dg ; ;an038;bgb;AN000; | ||
| 412 | xor bh,bh ;Set bh=0 ;an038;bgb;AN000; | ||
| 413 | mov ch,RawIO ;Get Media ID call ;an038;bgb;AN000; | ||
| 414 | mov cl,GET_MEDIA_ID ; ;an038;bgb;AN000; | ||
| 415 | lea dx,Media_ID_Buffer ;Point at buffer ;an038;bgb;AN000; | ||
| 416 | DOS_Call IOCtl ;Do function call ;an038;bgb;AN000; | ||
| 417 | ; $IF C,OR ;Old style diskette, OR ;an038;bgb;AN000; | ||
| 418 | JC $$LL9 | ||
| 419 | lea si,FAT12_String ;Check for FAT_12 string ;an038;bgb;AN000; | ||
| 420 | lea di,Media_ID_Buffer.Media_ID_File_System ; ;AN000;;an038;bgb | ||
| 421 | mov cx,Len_FS_ID_String ;Length of compare ;an038;bgb;AN000; | ||
| 422 | repe cmpsb ;Find it? ;an038;bgb;AN000; | ||
| 423 | ; $IF E,OR ;Nope, keep going ;an038;bgb;AN000; | ||
| 424 | JE $$LL9 | ||
| 425 | lea si,FAT16_String ;Check for FAT_16 string ;an038;bgb;AN000; | ||
| 426 | lea di,Media_ID_Buffer.Media_ID_File_System ; ;AN000;;an038;bgb | ||
| 427 | mov cx,Len_FS_ID_String ;Length of compare ;an038;bgb;AN000; | ||
| 428 | repe cmpsb ;Do compare ;an038;bgb;AN000; | ||
| 429 | ; $IF E ;Find it? ;an038;bgb;AN000; | ||
| 430 | JNE $$IF9 | ||
| 431 | $$LL9: | ||
| 432 | endif ;an038;bgb | ||
| 433 | call Parse_Command_Line ;Parse in command line input ;an038;bgb;AN000; | ||
| 434 | ifdef fsexec ;an038;bgb | ||
| 435 | ; $ELSE ;We got FS other than FAT ;an038;bgb;AN000; | ||
| 436 | JMP SHORT $$EN9 | ||
| 437 | $$IF9: | ||
| 438 | ;;;;;;;;;;;;;;call Parse_Drive_Letter ;Only look for drive letter ;an038;bgb;AN000; | ||
| 439 | mov FS_Not_FAT,Yes ;Indicate exec file system ;an038;bgb;AN000; | ||
| 440 | mov cx,8 ;an038;bgb;an027;bgb | ||
| 441 | lea si,Media_ID_Buffer.Media_ID_File_System ;get file system;an038;bgb ;an027;bgb | ||
| 442 | lea di,fs_string_buffer ;put it here ;an038;bgb;an027;bgb | ||
| 443 | rep movsb ;an038;bgb;an027;bgb | ||
| 444 | lea di,fs_string_buffer ;point to beginning again ;an038;bgb;an027;bgb | ||
| 445 | ; $DO COMPLEX ;search th string until eol found ;an038;bgb;an027;bgb | ||
| 446 | JMP SHORT $$SD11 | ||
| 447 | $$DO11: | ||
| 448 | inc di ;next char ;an038;bgb;an027;bgb | ||
| 449 | ; $STRTDO ;start loop here ;an038;bgb;an027;bgb | ||
| 450 | $$SD11: | ||
| 451 | cmp byte ptr [di],' ' ;end of string ? ;an038;bgb;an027;bgb | ||
| 452 | ; $ENDDO E ;end loop when eol found ;an038;bgb;an027;bgb | ||
| 453 | JNE $$DO11 | ||
| 454 | lea si,fs_string_end ;get end of string - rec.exe ;an038;bgb;an027;bgb | ||
| 455 | mov cx,8 ; 8 more chars ;an038;bgb;an027;bgb | ||
| 456 | rep movsb ;move it in ;an038;bgb;an027;bgb | ||
| 457 | ; $ENDIF ; ;an038;bgb;AN000; | ||
| 458 | $$EN9: | ||
| 459 | ; $ENDIF ; ;an038;bgb;AN000; | ||
| 460 | $$IF8: | ||
| 461 | endif ;an038;bgb | ||
| 462 | ret ; ;an000;bgb;AN000; | ||
| 463 | ;an000;bgb | ||
| 464 | Init_IO endp ; ;AN000; ;an000;bgb | ||
| 465 | ;an000;bgb | ||
| 466 | ;***************************************************************************** ;an000;bgb | ||
| 467 | ;Routine name: Preload_Messages ;an000;bgb | ||
| 468 | ;***************************************************************************** ;an000;bgb | ||
| 469 | ; ;an000;bgb | ||
| 470 | ;Description: Preload messages using common message retriever routines. ;an000;bgb | ||
| 471 | ; ;an000;bgb | ||
| 472 | ;Called Procedures: SysLoadMsg ;an000;bgb | ||
| 473 | ; ;an000;bgb | ||
| 474 | ; ;an000;bgb | ||
| 475 | ;Change History: Created 5/1/87 MT ;an000;bgb | ||
| 476 | ; ;an000;bgb | ||
| 477 | ;Input: Fatal_Error = NO ;an000;bgb | ||
| 478 | ; ;an000;bgb | ||
| 479 | ;Output: Fatal_Error = YES/NO ;an000;bgb | ||
| 480 | ; ;an000;bgb | ||
| 481 | ;Psuedocode ;an000;bgb | ||
| 482 | ;---------- ;an000;bgb | ||
| 483 | ; ;an000;bgb | ||
| 484 | ; Preload All messages (Call SysLoadMsg) ;an000;bgb | ||
| 485 | ; IF error ;an000;bgb | ||
| 486 | ; Display SysLoadMsg error message ;an000;bgb | ||
| 487 | ; Fatal_Error = YES ;an000;bgb | ||
| 488 | ; ENDIF ;an000;bgb | ||
| 489 | ; ret ;an000;bgb | ||
| 490 | ;***************************************************************************** ;an000;bgb | ||
| 491 | ;an000;bgb | ||
| 492 | Procedure Preload_Messages ; ;an000;bgb;AN000; | ||
| 493 | ; ;an000;bgb | ||
| 494 | call SysLoadMsg ;Preload the messages ;an000;bgb;AN000; | ||
| 495 | ; $IF C ;Error? ;an000;bgb;AN000; | ||
| 496 | JNC $$IF16 | ||
| 497 | call SysDispMsg ;Display preload msg ;an000;bgb;AN000; | ||
| 498 | mov Fatal_Error, YES ;Indicate error exit ;an000;bgb;AN000; | ||
| 499 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 500 | $$IF16: | ||
| 501 | ret ; ;an000;bgb;AN000; | ||
| 502 | ;an000;bgb | ||
| 503 | Preload_Messages endp ; ;an000;bgb;AN000; | ||
| 504 | ;an000;bgb | ||
| 505 | ;***************************************************************************** ;an000;bgb | ||
| 506 | ;Routine name: Parse_Drive_Letter ;an000;bgb | ||
| 507 | ;***************************************************************************** ;an000;bgb | ||
| 508 | ; ;an000;bgb | ||
| 509 | ;Description: Copy the command line - then parse looking only for drive ;an000;bgb | ||
| 510 | ; letter. Ignore errors, because this is only called to get ;an000;bgb | ||
| 511 | ; the drive letter for non-FAT chkdsk ;an000;bgb | ||
| 512 | ; ;an000;bgb | ||
| 513 | ;Called Procedures: SysParse ;an000;bgb | ||
| 514 | ; ;an000;bgb | ||
| 515 | ;Change History: Created 5/12/87 MT ;an000;bgb | ||
| 516 | ; ;an000;bgb | ||
| 517 | ;Input: Command line input at 81h ;an000;bgb | ||
| 518 | ; ;an000;bgb | ||
| 519 | ;Output: None ;an000;bgb | ||
| 520 | ; ;an000;bgb | ||
| 521 | ; ;an000;bgb | ||
| 522 | ;Psuedocode ;an000;bgb | ||
| 523 | ;---------- ;an000;bgb | ||
| 524 | ; Copy command line to buffer ;an000;bgb | ||
| 525 | ; DO ;an000;bgb | ||
| 526 | ; Parse buffer line (CALL SysParse) using drive letter only tables ;an000;bgb | ||
| 527 | ; LEAVE end of parse ;an000;bgb | ||
| 528 | ; ENDDO missing operand ;an000;bgb | ||
| 529 | ; ret ;an000;bgb | ||
| 530 | ;***************************************************************************** ;an000;bgb | ||
| 531 | ;an000;bgb | ||
| 532 | ;Procedure Parse_Drive_Letter ; ;an000;bgb;AN000; | ||
| 533 | ; Set_Data_Segment ;Set DS,ES to Data segment ;an000;bgb;AN000; | ||
| 534 | ; mov cx,PSP_Segment ;Get segment of PSP ;an000;bgb;AN000; | ||
| 535 | ; mov ds,cx ; " " " " ;an000;bgb;AN000; | ||
| 536 | ; assume ds:nothing ; ;an000;bgb;AN000; | ||
| 537 | ; mov si,Command_Line_Parms ;Point to command line ;an000;bgb;AN000; | ||
| 538 | ; lea di,Command_Line_Buffer ;Point to buffer to save to ;an000;bgb;AN000; | ||
| 539 | ; mov cx,Command_Line_Length ;Number of bytes to move ;an000;bgb;AN000; | ||
| 540 | ; rep movsb ;Copy the entire buffer ;an000;bgb;AN000; | ||
| 541 | ; Set_Data_Segment ; ;an000;bgb;AN000; | ||
| 542 | ; lea si,Command_Line_Buffer ;Pointer to parse line ;an000;bgb;AN000; | ||
| 543 | ; lea di,input_table ;Pointer to control table ;an000;bgb;AN000; | ||
| 544 | ; $DO ;Parse for drive letter ;an000;bgb;AN000; | ||
| 545 | ; xor dx,dx ;Parse line @SI ;an000;bgb;AN000; | ||
| 546 | ; xor cx,cx ;Parse table @DI ;an000;bgb;AN000; | ||
| 547 | ; call SysParse ;Go parse ;an000;bgb;AN000; | ||
| 548 | ; cmp ax,End_Of_Parse ;Check for end of parse ;an000;bgb;AN000; | ||
| 549 | ; $LEAVE E ;In other words, no drive letter;an000;bgb;AN000; | ||
| 550 | ; cmp ax,Operand_Missing ; exit if positional missing ;an000;bgb;AN000; | ||
| 551 | ; $ENDDO E ;Ignore errors!!! ;an000;bgb;AN000; | ||
| 552 | ; Set_Data_Segment ; ;an000;bgb;AN000; | ||
| 553 | ; ret ; ;an000;bgb;AN000; | ||
| 554 | ; ;an000;bgb | ||
| 555 | ;Parse_Drive_Letter endp ; ;an000;bgb;AN000; | ||
| 556 | ;an000;bgb | ||
| 557 | ;***************************************************************************** ;an000;bgb | ||
| 558 | ;Routine name: Parse_Command_Line ;an000;bgb | ||
| 559 | ;***************************************************************************** ;an000;bgb | ||
| 560 | ; ;an000;bgb | ||
| 561 | ;Description: Parse the command line. Check for errors, and display error and ;an000;bgb | ||
| 562 | ; exit program if found. Use parse error messages except in case ;an000;bgb | ||
| 563 | ; of no parameters, which has its own message ;an000;bgb | ||
| 564 | ; ;an000;bgb | ||
| 565 | ;Called Procedures: Message (macro) ;an000;bgb | ||
| 566 | ; SysParse ;an000;bgb | ||
| 567 | ; Interpret_Parse ;an000;bgb | ||
| 568 | ; ;an000;bgb | ||
| 569 | ;Change History: Created 5/1/87 MT ;an000;bgb | ||
| 570 | ; ;an000;bgb | ||
| 571 | ;Input: Fatal_Error = NO ;an000;bgb | ||
| 572 | ; PSP_Segment ;an000;bgb | ||
| 573 | ; ;an000;bgb | ||
| 574 | ;Output: Fatal_Error = YES/NO ;an000;bgb | ||
| 575 | ; Parse output buffers set up ;an000;bgb | ||
| 576 | ; ;an000;bgb | ||
| 577 | ; ;an000;bgb | ||
| 578 | ;Psuedocode ;an000;bgb | ||
| 579 | ;---------- ;an000;bgb | ||
| 580 | ; SEARCH ;an000;bgb | ||
| 581 | ; Parse command line (CALL SysParse) ;an000;bgb | ||
| 582 | ; EXITIF end of parsing command line ;an000;bgb | ||
| 583 | ; Figure out last thing parsed (Call Interpret_Parse) ;an000;bgb | ||
| 584 | ; ORELSE ;an000;bgb | ||
| 585 | ; See if parse error ;an000;bgb | ||
| 586 | ; ENDLOOP parse error ;an000;bgb | ||
| 587 | ; See what was parsed (Call Interpret_Parse) ;an000;bgb | ||
| 588 | ; Fatal_Error = YES ;an000;bgb | ||
| 589 | ; ENDSRCH ;an000;bgb | ||
| 590 | ; ret ;an000;bgb | ||
| 591 | ;***************************************************************************** ;an000;bgb | ||
| 592 | ;an000;bgb | ||
| 593 | Procedure Parse_Command_Line ; ;an000;bgb;AN000; | ||
| 594 | ;an000;bgb | ||
| 595 | push ds ;Save data segment ;an000;bgb;AN000; | ||
| 596 | Set_Data_Segment ; ;an000;bgb;AN000; | ||
| 597 | mov cx,PSP_Segment ;Get segment of PSP ;an000;bgb;AN000; | ||
| 598 | mov ds,cx ; " " " " ;an000;bgb;AN000; | ||
| 599 | ;an000;bgb | ||
| 600 | assume ds:nothing,es:dg ; ;an000;bgb;AN000; | ||
| 601 | ;an000;bgb | ||
| 602 | mov si,Command_Line_Parms ;Point at command line ;an000;bgb;AN000; | ||
| 603 | lea di,Command_Line_Buffer ;Where to put a copy of it ;an000;bgb;AN000; | ||
| 604 | mov cx,Command_Line_Length ;How long was input? ;an000;bgb;AN000; | ||
| 605 | repnz movsb ;Copy it ;an000;bgb;AN000; | ||
| 606 | lea Di,Command_Line_Buffer ; ;an046;bgb | ||
| 607 | public nextdi ;an046;bgb | ||
| 608 | nextdi: ;an046;bgb | ||
| 609 | mov al,0dh ;search for end of line ;an046;bgb | ||
| 610 | cmp al,ES:[Di] ;zero terminate string ;an046;bgb | ||
| 611 | ; $IF NZ ;an046;bgb | ||
| 612 | JZ $$IF18 | ||
| 613 | inc di ;an046;bgb | ||
| 614 | jmp nextdi ;an046;bgb | ||
| 615 | ; $ELSE ;an046;bgb | ||
| 616 | JMP SHORT $$EN18 | ||
| 617 | $$IF18: | ||
| 618 | mov byte ptr ES:[di+1],00 ;an046;bgb | ||
| 619 | ; $ENDIF ;an046;bgb | ||
| 620 | $$EN18: | ||
| 621 | ;an046;bgb | ||
| 622 | Set_Data_Segment ;Set DS,ES to Data segment ;an000;bgb;AN000; | ||
| 623 | xor cx,cx ; ;an000;bgb;AN000; | ||
| 624 | xor dx,dx ;Required for SysParse call ;;an000;bgbAN000; | ||
| 625 | lea si,Command_Line_Buffer ;Pointer to parse line ;an000;bgb ;AN000; | ||
| 626 | lea di,input_table ;Pointer to control table ;an000;bgb ;AN000; | ||
| 627 | ; $SEARCH ;Loop until all parsed ;an000;bgb;AN000; | ||
| 628 | $$DO21: | ||
| 629 | cmp Fatal_Error,Yes ;Interpret something bad? ;an000;bgb;AN000; | ||
| 630 | ; $EXITIF E,OR ;If so, don't parse any more ;an000;bgb;AN000; | ||
| 631 | JE $$LL22 | ||
| 632 | call SysParse ;Go parse ;an000;bgb;AN000; | ||
| 633 | cmp ax,End_Of_Parse ;Check for end of parse ;an000;bgb;AN000; | ||
| 634 | ; $EXITIF E ;Is it? ;an000;bgb;AN000; | ||
| 635 | JNE $$IF21 | ||
| 636 | $$LL22: | ||
| 637 | ;All done ;an000;bgb;AN000; | ||
| 638 | ; $ORELSE ;Not end ;an000;bgb;AN000; | ||
| 639 | JMP SHORT $$SR21 | ||
| 640 | $$IF21: | ||
| 641 | cmp ax,0 ;Check for parse error ;an000;bgb;AN000; | ||
| 642 | ; $LEAVE NE ;Stop if there was one ;an000;bgb;AN000; | ||
| 643 | JNE $$EN21 | ||
| 644 | call Interpret_Parse ;Go find what we parsed ;an000;bgb;AN000; | ||
| 645 | ; $ENDLOOP ;Parse error, see what it was ;an000;bgb;AN000; | ||
| 646 | JMP SHORT $$DO21 | ||
| 647 | $$EN21: | ||
| 648 | |||
| 649 | dec si ;point to last byte of invalid parm | ||
| 650 | public decsi | ||
| 651 | decsi: cmp byte ptr [si],' ' ;are we pointing to a space? ;an046;bgb | ||
| 652 | ; $IF E,OR ;if so, we dont want to do that | ||
| 653 | JE $$LL26 | ||
| 654 | cmp byte ptr [si],0dh ;are we pointing to CR? ;an046;bgb | ||
| 655 | ; $IF E ;if so, we dont want to do that | ||
| 656 | JNE $$IF26 | ||
| 657 | $$LL26: | ||
| 658 | dec si ;find the last byte of parm | ||
| 659 | jmp decsi | ||
| 660 | ; $ENDIF | ||
| 661 | $$IF26: | ||
| 662 | mov byte ptr [si+1],00 ;zero terminate display string ;an046;bgb | ||
| 663 | nextsi: | ||
| 664 | public nextsi | ||
| 665 | dec si ;look at previous char ;an046;bgb | ||
| 666 | cmp byte ptr [si],' ' ;find parm separator ;an046;bgb | ||
| 667 | jnz nextsi ;loop until begin of parm found | ||
| 668 | mov movsi,si ;mov si into display parms ;an046;bgb | ||
| 669 | PARSE_MESSAGE ;Display parse error ;an000;bgb;AN000; | ||
| 670 | mov Fatal_Error,YES ;Indicate death! ;an000;bgb;AN000; | ||
| 671 | ; $ENDSRCH ; ;an000;bgb;AN000; | ||
| 672 | $$SR21: | ||
| 673 | pop ds ; ;an000;bgb;AN000; | ||
| 674 | ret ; ;an000;bgb;AN000; | ||
| 675 | ;an000;bgb | ||
| 676 | Parse_Command_Line endp ; ;an000;bgb;AN000; | ||
| 677 | ;an000;bgb | ||
| 678 | ;***************************************************************************** ;an000;bgb | ||
| 679 | ;Routine name: Interpret_Parse ;an000;bgb | ||
| 680 | ;***************************************************************************** ;an000;bgb | ||
| 681 | ; ;an000;bgb | ||
| 682 | ;description: Get any switches entered, and dr ;an000;bgb | ||
| 683 | ; ;an000;bgb | ||
| 684 | ; ;an000;bgb | ||
| 685 | ;Called Procedures: Message (macro) ;an000;bgb | ||
| 686 | ; ;an000;bgb | ||
| 687 | ;Change History: Created 5/1/87 MT ;an000;bgb | ||
| 688 | ; ;an000;bgb | ||
| 689 | ;Input: DS:DrNum (FCB at 5Ch) ;an000;bgb | ||
| 690 | ; ;an000;bgb | ||
| 691 | ;Output: Noisy = ON/OFF ;an000;bgb | ||
| 692 | ; DoFix = ON/OFF ;an000;bgb | ||
| 693 | ; ALLDRV = Target drive, A=1 ;an000;bgb | ||
| 694 | ; VOLNAM = Target drive, A=1 ;an000;bgb | ||
| 695 | ; ORPHFCB = Target drive, A=1 ;an000;bgb | ||
| 696 | ; BADDRVm+1 = Target drive, A=0 ;an000;bgb | ||
| 697 | ; Arg_Buf = Target drive letter ;an000;bgb | ||
| 698 | ; Fragment > 1 if filespec entered ;an000;bgb | ||
| 699 | ; ;an000;bgb | ||
| 700 | ;Psuedocode ;an000;bgb | ||
| 701 | ;---------- ;an000;bgb | ||
| 702 | ; ;an000;bgb | ||
| 703 | ; Noisy = OFF ;an000;bgb | ||
| 704 | ; DoFix = OFF ;an000;bgb | ||
| 705 | ; IF /V ;an000;bgb | ||
| 706 | ; Noisy = ON ;an000;bgb | ||
| 707 | ; ENDIF ;an000;bgb | ||
| 708 | ; IF /F ;an000;bgb | ||
| 709 | ; DoFix = ON ;an000;bgb | ||
| 710 | ; ENDIF ;an000;bgb | ||
| 711 | ; IF file spec entered ;an000;bgb | ||
| 712 | ; Build filename ;an000;bgb | ||
| 713 | ; Fragment = 1 ;an000;bgb | ||
| 714 | ; ENDIF ;an000;bgb | ||
| 715 | ; ret ;an000;bgb | ||
| 716 | ;***************************************************************************** ;an000;bgb | ||
| 717 | ;an000;bgb | ||
| 718 | Procedure Interpret_Parse ; ;an000;bgb;AN000; | ||
| 719 | ;an000;bgb | ||
| 720 | push ds ;Save segment ;an000;bgb;AN000; | ||
| 721 | push si ;Restore SI for parser ;an000;bgb;AN000; | ||
| 722 | push cx ; ;an000;bgb;AN000; | ||
| 723 | push di ; ;an000;bgb | ||
| 724 | Set_Data_Segment ; ;an000;bgb | ||
| 725 | cmp byte ptr Buffer.dfType,Type_Drive ;Have drive letter? ;AN000; ;an000;bgb | ||
| 726 | ; $IF E ;Yes, save info ;an000;bgb;AN000; | ||
| 727 | JNE $$IF29 | ||
| 728 | and word ptr dfcontrol,filespec ;dont let another drive letter ;an000;bgb | ||
| 729 | mov al,byte ptr Buffer.Drnum_stroff ;Get drive entered ;;an000;bgbAN000; | ||
| 730 | mov AllDrv,al ; ;an000;bgb;AC000; | ||
| 731 | mov VolNam,al ; ;an000;bgb;AC000; | ||
| 732 | mov OrphFCB,al ; ;an000;bgb;AC000; | ||
| 733 | dec al ;Make it 0 based ;an000;bgb;AN000; | ||
| 734 | mov BadDrvm+1,al ; " " " " ;an000;bgb;AN000; | ||
| 735 | add al,'A' ;Make it a drive letter ;an000;bgb;AN000; | ||
| 736 | mov Arg_Buf,al ;Save it ;an000;bgb;AN000; | ||
| 737 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 738 | $$IF29: | ||
| 739 | cmp SwBuffer.Switch_Pointer,offset Sw_v ;AN020;;an000;bgbbgb | ||
| 740 | ; $IF E ; ;an000;bgb;AN000; | ||
| 741 | JNE $$IF31 | ||
| 742 | mov Noisy,ON ;Set flag ;an000;bgb;AC000; | ||
| 743 | mov byte ptr sw_v,blank ;an000;bgb;an020;bgb | ||
| 744 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 745 | $$IF31: | ||
| 746 | cmp SwBuffer.Switch_Pointer,offset sw_f ;AN020;;an000;bgbbgb | ||
| 747 | ; $IF E ; ;an000;bgb;AN000; | ||
| 748 | JNE $$IF33 | ||
| 749 | mov DoFix,ON ;Set flag ;an000;bgb;AC000; | ||
| 750 | mov byte ptr sw_f,blank ;;an000;bgban020;bgb | ||
| 751 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 752 | $$IF33: | ||
| 753 | ;;;;;;; cmp FileSpec_Buffer.FileSpec_Pointer,offset FileSpec_Control.Keyword;an000;bgb ;AN000; | ||
| 754 | cmp buffer.dftype, type_filespec ;an000;bgb | ||
| 755 | ; $IF E ; ;an000;bgb;AN000; | ||
| 756 | JNE $$IF35 | ||
| 757 | mov word ptr dfcontrol,0 ;dont let another drive letter or filesp;an000;bgbec | ||
| 758 | mov si,Buffer.drnum_StrOff ; ;AN000; ;an000;bgb | ||
| 759 | lea di,Path_Name ;Point to where to build path ;an000;bgb;AN000; | ||
| 760 | cld ;SI-DI dir is up ;an000;bgb;AN000; | ||
| 761 | ; $DO ;Move string one char at a time ;an000;bgb;AN000; | ||
| 762 | $$DO36: | ||
| 763 | cmp byte ptr [si],Asciiz_End ;Is it the end? ;an000;bgb;AN000; | ||
| 764 | ; $LEAVE E ;You got it ;an000;bgb;AN000; | ||
| 765 | JE $$EN36 | ||
| 766 | movsb ;Nope, move the character ;an000;bgb;AN000; | ||
| 767 | ; $ENDDO ;And keep crusin ;an000;bgb;AN000; | ||
| 768 | JMP SHORT $$DO36 | ||
| 769 | $$EN36: | ||
| 770 | inc fragment ;To be compat with old code ;an000;bgb;AN000; | ||
| 771 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 772 | $$IF35: | ||
| 773 | pop di ;Restore parse regs ;an000;bgb;AN000; | ||
| 774 | pop cx ; ;an000;bgb;AN000; | ||
| 775 | pop si ; ;an000;bgb;AN000; | ||
| 776 | pop ds ; ;an000;bgb;AN000; | ||
| 777 | ret ; ;an000;bgb;AN000; | ||
| 778 | ;an000;bgb | ||
| 779 | ;an000;bgb | ||
| 780 | Interpret_Parse endp ; ;an000;bgb;AN000; | ||
| 781 | ;an000;bgb | ||
| 782 | ;an000;bgb | ||
| 783 | ;an000;bgb | ||
| 784 | ;***************************************************************************** ;an000;bgb | ||
| 785 | ;Routine name: Validate_Target_Drive ;an000;bgb | ||
| 786 | ;***************************************************************************** ;an000;bgb | ||
| 787 | ; ;an000;bgb | ||
| 788 | ;Description: Control routine for validating the specified format target drive. ;an000;bgb | ||
| 789 | ; If any of the called routines find an error, they will print ;an000;bgb | ||
| 790 | ; message and terminate program, without returning to this routine ;an000;bgb | ||
| 791 | ; ;an000;bgb | ||
| 792 | ;Called Procedures: Check_Target_Drive ;an000;bgb | ||
| 793 | ; Check_For_Network ;an000;bgb | ||
| 794 | ; Check_Translate_Drive ;an000;bgb | ||
| 795 | ; ;an000;bgb | ||
| 796 | ;Change History: Created 5/1/87 MT ;an000;bgb | ||
| 797 | ; ;an000;bgb | ||
| 798 | ;Input: Fatal_Error = NO ;an000;bgb | ||
| 799 | ; ;an000;bgb | ||
| 800 | ;Output: Fatal_Error = YES/NO ;an000;bgb | ||
| 801 | ; ;an000;bgb | ||
| 802 | ;Psuedocode ;an000;bgb | ||
| 803 | ;---------- ;an000;bgb | ||
| 804 | ; ;an000;bgb | ||
| 805 | ; CALL Check_Target_Drive ;an000;bgb | ||
| 806 | ; IF !Fatal_Error ;an000;bgb | ||
| 807 | ; CALL Check_For_Network ;an000;bgb | ||
| 808 | ; IF !Fatal_Error ;an000;bgb | ||
| 809 | ; CALL Check_Translate_Drive ;an000;bgb | ||
| 810 | ; ENDIF ;an000;bgb | ||
| 811 | ; ENDIF ;an000;bgb | ||
| 812 | ; ret ;an000;bgb | ||
| 813 | ;***************************************************************************** ;an000;bgb | ||
| 814 | ;an000;bgb | ||
| 815 | Procedure Validate_Target_Drive ; ;an000;bgb;AN000; | ||
| 816 | call Check_For_Network ;See if Network drive letter ;an000;;an043;bgbbgb;AN000; | ||
| 817 | cmp Fatal_Error,YES ;Can we continue? ;an0;an043;bgb00;bgb;AN000; | ||
| 818 | ; $IF NE ;Yep ;an0;an043;bgb00;bgb;AN000; | ||
| 819 | JE $$IF40 | ||
| 820 | call Check_Target_Drive ;See if valid drive letter ;an000;bgb;AN000; | ||
| 821 | cmp Fatal_Error,YES ;Can we continue? ;an000;bgb;AN000; | ||
| 822 | ; $IF NE ;Yep ;an000;bgb;AN000; | ||
| 823 | JE $$IF41 | ||
| 824 | call Check_For_Network ;See if Network drive letter ;an000;bgb;AN000; | ||
| 825 | cmp Fatal_Error,YES ;Can we continue? ;an000;bgb;AN000; | ||
| 826 | ; $IF NE ;Yep ;an000;bgb;AN000; | ||
| 827 | JE $$IF42 | ||
| 828 | call Check_Translate_Drive ;See if Subst, Assigned ;an000;bgb;AN000; | ||
| 829 | ; $ENDIF ;- Fatal_Error passed back ;an000;bgb;AN000; | ||
| 830 | $$IF42: | ||
| 831 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 832 | $$IF41: | ||
| 833 | ; $ENDIF ;an000;bgb | ||
| 834 | $$IF40: | ||
| 835 | ret ; ;an000;bgb;AN000; | ||
| 836 | ;an000;bgb | ||
| 837 | Validate_Target_Drive endp ; ;an000;bgb;AN000; | ||
| 838 | ;an000;bgb | ||
| 839 | ;***************************************************************************** ;an000;bgb | ||
| 840 | ;Routine name: Check_Target_Drive ;an000;bgb | ||
| 841 | ;***************************************************************************** ;an000;bgb | ||
| 842 | ; ;an000;bgb | ||
| 843 | ;Description: Check to see if valid DOS drive by checking if drive is ;an000;bgb | ||
| 844 | ; removable. If error, the drive is invalid. Save default ;an000;bgb | ||
| 845 | ; drive info. Also get target drive BPB information, and compute ;an000;bgb | ||
| 846 | ; the start of the data area ;an000;bgb | ||
| 847 | ; ;an000;bgb | ||
| 848 | ;Called Procedures: Message (macro) ;an000;bgb | ||
| 849 | ; ;an000;bgb | ||
| 850 | ;Change History: Created 5/1/87 MT ;an000;bgb | ||
| 851 | ; ;an000;bgb | ||
| 852 | ;Input: Fatal_Error = NO ;an000;bgb | ||
| 853 | ; ;an000;bgb | ||
| 854 | ;Output: BIOSFile = default drive letter ;an000;bgb | ||
| 855 | ; DOSFile = default drive letter ;an000;bgb | ||
| 856 | ; CommandFile = default drive letter ;an000;bgb | ||
| 857 | ; Fatal_Error = YES/NO ;an000;bgb | ||
| 858 | ; ;an000;bgb | ||
| 859 | ;Psuedocode ;an000;bgb | ||
| 860 | ;---------- ;an000;bgb | ||
| 861 | ; ;an000;bgb | ||
| 862 | ; Get default drive (INT 21h, AH = 19h) ;an000;bgb | ||
| 863 | ; Convert it to drive letter ;an000;bgb | ||
| 864 | ; Save into BIOSFile,DOSFile,CommandFile ;an000;bgb | ||
| 865 | ; See if drive removable (INT 21h, AX=4409h IOCtl) ;an000;bgb | ||
| 866 | ; IF error - drive invalid ;an000;bgb | ||
| 867 | ; Display Invalid drive message ;an000;bgb | ||
| 868 | ; Fatal_Error= YES ;an000;bgb | ||
| 869 | ; ENDIF ;an000;bgb | ||
| 870 | ; Get BPB of target drive (Generic IOCtl Get Device parameters) ;an000;bgb | ||
| 871 | ; Compute start of data area ;an000;bgb | ||
| 872 | ; ret ;an000;bgb | ||
| 873 | ;***************************************************************************** ;an000;bgb | ||
| 874 | Procedure Check_Target_Drive ; ;an000;bgb;AN000; | ||
| 875 | call func60 ; ;an000;bgb | ||
| 876 | mov al,save_drive ;an000;bgb | ||
| 877 | cmp al,0ffh ;save drive spec ;an000;bgb | ||
| 878 | ; $IF E ;an000;bgb | ||
| 879 | JNE $$IF46 | ||
| 880 | Message BadDrv_Arg ;Print message ;an000;bgb;AC000; | ||
| 881 | mov Fatal_Error,Yes ;Indicate error ;an000;bgb;AN000; | ||
| 882 | jmp Exit_Baddrv ;dont do rest of proc ;an000;bgb;an021;bgb;an099; | ||
| 883 | ; $ENDIF ;an000;bgb | ||
| 884 | $$IF46: | ||
| 885 | DOS_Call Get_Default_Drive ;Find the current drive 19 ;an000;bgb;AC000; | ||
| 886 | mov UserDev,al ;Save it ;an000;bgb; ; | ||
| 887 | cmp AllDrv,0 ;Was drive entered? ;an000;bgb;AN002; | ||
| 888 | ; $IF E ;No ;an000;bgb;AN002; | ||
| 889 | JNE $$IF48 | ||
| 890 | mov BadDrvm+1,al ;Save 0 based number ;an000;bgb;AN002; | ||
| 891 | inc al ;Make 1 based ;an000;bgb;AN002; | ||
| 892 | mov byte ptr Buffer.Drnum_stroff,al ; ;an000;bgb ; | ||
| 893 | mov AllDrv,al ;Use default drive for ;an000;bgb;AN002; | ||
| 894 | mov VolNam,al ;entries for drive fields ;an000;bgb;AN002; | ||
| 895 | mov OrphFCB,al ; ;an000;bgb;AN002; | ||
| 896 | add al,'A'-1 ;Make it a drive letter ;an000;bgb;AN002; | ||
| 897 | mov Arg_Buf,al ;Save it ;an000;bgb;AN002; | ||
| 898 | ; $ENDIF ; ;an000;bgb;AN002; | ||
| 899 | $$IF48: | ||
| 900 | mov bl,alldrv ;Get drive number (A=1) ;AN00;an044;bgb;an000;bgb0; | ||
| 901 | mov al,09h ;See if drive is local ;an000;bgb;AC000; | ||
| 902 | DOS_Call IOCtl ;-this will fail if bad drive ;an000;bgb;AC000; | ||
| 903 | ; $IF C ;CY means invalid drive ;an000;bgb;AC000; | ||
| 904 | JNC $$IF50 | ||
| 905 | Message BadDrv_Arg ;Print message ;an000;bgb;AC015;bgb | ||
| 906 | mov Fatal_Error,Yes ;Indicate error ;an000;bgb;AN015;bgb | ||
| 907 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 908 | $$IF50: | ||
| 909 | cmp fatal_error,no ;an000;bgb | ||
| 910 | ; $IF E ;an000;bgb | ||
| 911 | JNE $$IF52 | ||
| 912 | get_bpb: mov al,GENERIC_IOCTL ;Get BPB information ;an000;bgb ;AN000; | ||
| 913 | mov ch,RawIO ; " " " " ;an000;bgb ;AN000; | ||
| 914 | mov cl,GET_DEVICE_PARAMETERS ; ;an000;bgb ;AN000; | ||
| 915 | mov bl,AllDrv ; " " " " ;an000;bgb ;AN000; | ||
| 916 | lea dx,BPB_Buffer ; dx points to bpb area ;an000;bgb ;AN000; | ||
| 917 | mov byte ptr bpb_buffer, 0ffh ;turn bit 0 on to get bpb inf;an000;bgbo of disk ;an008;bgb | ||
| 918 | DOS_Call IOCtl ; " " " " ;an000;bgb ;AN000; | ||
| 919 | mov bx,dx ;use bx as the pointer to bpb;an000;bgb ;an015;bgb | ||
| 920 | ; $IF C ;is ioct not supported or bad? ;an000;bgb ;an015;bgb | ||
| 921 | JNC $$IF53 | ||
| 922 | mov al,BadDrvm+1 ; drive number a=0 ;an000;bgb ;AN015;bgb | ||
| 923 | lea bx,chkprmt_end ; transfer address es:bx ;an000;bgb ;an015;bgb | ||
| 924 | ;warning! this label must be the last in the code segment ;an000;bgb | ||
| 925 | mov cx,1 ; 1 sector - boot record ;an000;bgb ;an015;bgb | ||
| 926 | mov dx,0 ; logical sector 0 ;an000;bgb ;an015;bgb | ||
| 927 | mov Read_Write_Relative.Start_Sector_High,0 ; ;an000;bgb ;an015;bgb | ||
| 928 | call read_once ;an000;bgb ;an015;bgb | ||
| 929 | ; $IF C ;couldnt read the boot? ;an000;bgb ;an015;bgb | ||
| 930 | JNC $$IF54 | ||
| 931 | Message BadDrv_Arg ;Print message ;an000;bgb ;AC015;bgb | ||
| 932 | mov Fatal_Error,Yes ;Indicate error ;an000;bgb ;AN015;bgb | ||
| 933 | ; $ELSE ;ioct not supported - is it vdisk ;an000;bgb ;an015;bgb | ||
| 934 | JMP SHORT $$EN54 | ||
| 935 | $$IF54: | ||
| 936 | ; mov di,bx ;an000;bgb;an022;bgb | ||
| 937 | ; add di,3 ;es:di --> to vdisk area in boot rcd ;an000;bgb;an022;bgb | ||
| 938 | ; lea si,myvdisk ;ds:si --> proper vdisk string ;an000;bgb;an022;bgb | ||
| 939 | ; mov cx,5 ; compare 5 bytes ;an000;bgb;an022;bgb | ||
| 940 | ; repe cmpsb ;compare both strings ;an000;bgb;an022;bgb | ||
| 941 | IF IBMCOPYRIGHT | ||
| 942 | ; $IF NE ;an000;bgb;an022;bgb | ||
| 943 | ; jmp baddrv ;an000;bgb | ||
| 944 | ; $ENDIF ;an000;bgb;an022;bgb | ||
| 945 | ELSE | ||
| 946 | ; $IF NE | ||
| 947 | mov di,bx | ||
| 948 | add di,3 | ||
| 949 | lea si,myramdisk | ||
| 950 | mov cx,8 | ||
| 951 | repe cmpsb | ||
| 952 | |||
| 953 | ; $IF NE | ||
| 954 | JE $$IF56 | ||
| 955 | jmp baddrv | ||
| 956 | ; $ENDIF | ||
| 957 | $$IF56: | ||
| 958 | ; $ENDIF | ||
| 959 | ENDIF | ||
| 960 | ; $ENDIF ;an000;bgb;an022;bgb | ||
| 961 | $$EN54: | ||
| 962 | add bx,4 ;boot-record-offset - device-paramete;an000;bgbr offset ;an015;bgb | ||
| 963 | ; $ENDIF ;an000;bgb ;an015;bgb | ||
| 964 | $$IF53: | ||
| 965 | ; $ENDIF ;an000;bgb | ||
| 966 | $$IF52: | ||
| 967 | cmp fatal_error,no ;an000;bgb | ||
| 968 | ; $IF E ;an000;bgb | ||
| 969 | JNE $$IF61 | ||
| 970 | call get_boot_info ;an053;bgb | ||
| 971 | call calc_space ;an000;bgb | ||
| 972 | ; $ENDIF ;an000;bgb | ||
| 973 | $$IF61: | ||
| 974 | cmp bytes_per_sector,0 ;an000;bgb;an033;bgb | ||
| 975 | ; $IF E ;an000;bgb;an033;bgb | ||
| 976 | JNE $$IF63 | ||
| 977 | baddrv: mov fatal_error,yes ;an000;bgb;an033;bgb | ||
| 978 | mov dx,offset dg:inval_media ;an000;bgb;an033;bgb | ||
| 979 | invoke printf_crlf ;an000;bgb;an033;bgb | ||
| 980 | ; $ENDIF ;an000;bgb;an033;bgb | ||
| 981 | $$IF63: | ||
| 982 | Exit_Baddrv: ;AN099; | ||
| 983 | ret ;And we're outa here ;an000;bgb;AN000; | ||
| 984 | Check_Target_Drive endp ; ;an000;bgb;AN000; | ||
| 985 | ;an000;bgb | ||
| 986 | ;an000;bgb | ||
| 987 | |||
| 988 | ;****************************************************************************** ;an053;bgb;an000;bgb | ||
| 989 | ; get_boot_info ;an053;bgb | ||
| 990 | ; ;an053;bgb | ||
| 991 | ; ;an053;bgb;an000;bgb | ||
| 992 | ; Inputs : none ;an053;bgb;an000;bgb | ||
| 993 | ; ;an053;bgb;an000;bgb | ||
| 994 | ; Outputs : ;an053;bgb | ||
| 995 | ;****************************************************************************** ;an053;bgb;an000;bgb | ||
| 996 | Procedure get_boot_info ; ;an053;bgb;an000;bgb | ||
| 997 | mov cx,[bx].BytePerSector ; usually 512 ;an053;bgb;an000;bgb ;an015;bgb | ||
| 998 | cmp cx,512 ;vdisk sizes ;an053;bgb | ||
| 999 | ; $IF NE,AND ;vdisk sizes ;an053;bgb | ||
| 1000 | JE $$IF65 | ||
| 1001 | cmp cx,256 ;vdisk sizes ;an053;bgb | ||
| 1002 | ; $IF NE,AND ;vdisk sizes ;an053;bgb | ||
| 1003 | JE $$IF65 | ||
| 1004 | cmp cx,128 ;vdisk sizes ;an053;bgb | ||
| 1005 | ; $IF NE ;vdisk sizes ;an053;bgb | ||
| 1006 | JE $$IF65 | ||
| 1007 | jmp baddrv ;an053;bgb | ||
| 1008 | ; $ENDIF ;an053;bgb | ||
| 1009 | $$IF65: | ||
| 1010 | mov bytes_per_sector,cx ; ; ;an053;bgb;an000;bgb ;an005;bgb | ||
| 1011 | ;an053;bgb | ||
| 1012 | xor cx,cx ;Find # sectors used by FA;an053;bgb;an000;bgbT's ;AN000; | ||
| 1013 | mov cl,[bx].NumberOfFats ; " " " " ;an053;bgb;an000;bgb ;an015;bgb | ||
| 1014 | cmp cx,2 ;make sure it is ok ;an053;bgb;an032;bgb | ||
| 1015 | ; $IF NE,AND ;an053;bgb | ||
| 1016 | JE $$IF67 | ||
| 1017 | cmp cx,1 ;make sure it is ok ;an053;bgb;an032;bgb | ||
| 1018 | ; $IF NE ;an053;bgb | ||
| 1019 | JE $$IF67 | ||
| 1020 | jmp baddrv ;must be 2 fats ;an053;bgb ;an032;bgb | ||
| 1021 | ; $ENDIF ;an053;bgb | ||
| 1022 | $$IF67: | ||
| 1023 | mov fatcnt,cl ;an053;bgb;an000;bgb ;an005;bgb | ||
| 1024 | ;an053;bgb | ||
| 1025 | ;an053;bgb | ||
| 1026 | xor ax,ax ;an053;bgb | ||
| 1027 | mov al,[bx].SectorsPerCluster ;get total sectors ;an053;bgb ;an000;bgb;an015;bgb | ||
| 1028 | cmp ax,1 ;make sure it is ok ;an053;bgb;an032;bgb | ||
| 1029 | ; $IF NE,AND ;an053;bgb | ||
| 1030 | JE $$IF69 | ||
| 1031 | cmp ax,2 ;make sure it is ok ;an053;bgb;an032;bgb | ||
| 1032 | ; $IF NE,AND ;an053;bgb | ||
| 1033 | JE $$IF69 | ||
| 1034 | cmp ax,4 ;make sure it is ok ;an053;bgb;an032;bgb | ||
| 1035 | ; $IF NE,AND ;an053;bgb | ||
| 1036 | JE $$IF69 | ||
| 1037 | cmp ax,8 ;make sure it is ok ;an053;bgb;an032;bgb | ||
| 1038 | ; $IF NE,AND ;an053;bgb | ||
| 1039 | JE $$IF69 | ||
| 1040 | cmp ax,16 ;make sure it is ok ;an053;bgb;an032;bgb | ||
| 1041 | ; $IF NE,AND ;an053;bgb | ||
| 1042 | JE $$IF69 | ||
| 1043 | cmp ax,32 ;make sure it is ok ;an053;bgb;an032;bgb | ||
| 1044 | ; $IF NE,AND ;an053;bgb | ||
| 1045 | JE $$IF69 | ||
| 1046 | cmp ax,64 ;make sure it is ok ;an053;bgb;an032;bgb | ||
| 1047 | ; $IF NE,AND ;an053;bgb | ||
| 1048 | JE $$IF69 | ||
| 1049 | cmp ax,128 ;make sure it is ok ;an053;bgb;an032;bgb | ||
| 1050 | ; $IF NE ;an053;bgb | ||
| 1051 | JE $$IF69 | ||
| 1052 | jmp baddrv ;this is not! ;an053;bgb ;an032;bgb | ||
| 1053 | ; $ENDIF ;an053;bgb | ||
| 1054 | $$IF69: | ||
| 1055 | ;an053;bgb | ||
| 1056 | mov ax,[bx].SectorsPerFAT ; " " " " ;an053;bgb;an000;bgb ;an015;bgb | ||
| 1057 | cmp ax,0 ;make sure it is ok ;an053;bgb;an032;bgb | ||
| 1058 | jz baddrv ;this is not! ;an053;bgb;an032;bgb | ||
| 1059 | mul cx ; " " " " ;an053;bgb;an000;bgb ;AN000; | ||
| 1060 | push bx ;save bpb pointer ;an053;bgb;an000;bgb ;an015;bgb | ||
| 1061 | push dx ;Save results ;an053;bgb;an000;bgb ;AN000; | ||
| 1062 | push ax ; " " ;an053;bgb;an000;bgb ;AN000; | ||
| 1063 | ;an053;bgb | ||
| 1064 | mov ax,[bx].RootEntries ;Find number of sectors in root ;an053;bgb;an000;bgb ;an015;bgb | ||
| 1065 | cmp ax,2 ;make sure it is ok ;an053;bgb;an032;bgb | ||
| 1066 | ; $IF B,OR ;this is not! ;an053;bgb;an032;bgb | ||
| 1067 | JB $$LL71 | ||
| 1068 | cmp ax,512 ;make sure it is ok ;an053;bgb;an032;bgb | ||
| 1069 | ; $IF A ;this is not! ;an053;bgb;an032;bgb | ||
| 1070 | JNA $$IF71 | ||
| 1071 | $$LL71: | ||
| 1072 | jmp baddrv ;an053;bgb | ||
| 1073 | ; $ENDIF ;an053;bgb | ||
| 1074 | $$IF71: | ||
| 1075 | ;an053;bgb | ||
| 1076 | mov cl,Dir_Entries_Per_Sector ; by dividing RootEntries ;an053;bgb;an000;bgb ;AN000; | ||
| 1077 | cmp cl,0 ;an053;bgb;an000;bgb;an022;bgb | ||
| 1078 | ; $IF NE ;an053;bgb;an000;bgb;an022;bgb | ||
| 1079 | JE $$IF73 | ||
| 1080 | div cl ; by (512/32) ;an053;bgb;an000;bgb;an022;bgb;AN000; | ||
| 1081 | ; $ENDIF ;an053;bgb;an000;bgb;an022;bgb | ||
| 1082 | $$IF73: | ||
| 1083 | pop bx ;Get low sectors per FAT b;an053;bgb;an000;bgback ;AN000; | ||
| 1084 | pop dx ;Get high part ;an053;bgb;an000;bgb ;AN000; | ||
| 1085 | add ax,bx ;Add to get FAT+Dir sector;an053;bgb;an000;bgbs ;AN000; | ||
| 1086 | adc dx,0 ;High part ;an053;bgb;an000;bgb ;AN000; | ||
| 1087 | mov fat_dir_secs,ax ;save it ;an053;bgb;an000;bgb ;an006;bgb | ||
| 1088 | inc fat_dir_secs ; 1 for reserved sector ;an053;bgb;an000;bgb ;an006;bgb | ||
| 1089 | pop bx ;restore bpb pointer ;an053;bgb;an000;bgb ;an015;bgb | ||
| 1090 | add ax,[bx].ReservedSectors ;Add in Boot record sectors ;an053;bgb;an000;bgb ;an015;bgb | ||
| 1091 | adc dx,0 ;to get start of data (DX:;an053;bgb;an000;bgbAX) ;AN000; | ||
| 1092 | mov Data_Start_Low,ax ;Save it ;an053;bgb;an000;bgb ;AN000; | ||
| 1093 | mov Data_Start_High,dx ; ;an053;bgb;an000;bgb ;AN000; | ||
| 1094 | ret ; ;an053;bgb;an000;bgb | ||
| 1095 | get_boot_info endp ; ;an053;bgb;an000;bgb | ||
| 1096 | |||
| 1097 | |||
| 1098 | |||
| 1099 | |||
| 1100 | |||
| 1101 | |||
| 1102 | |||
| 1103 | ;****************************************************************************** ;an000;bgb | ||
| 1104 | ; Calc_Space : Calculate the total space that is ;an000;bgb | ||
| 1105 | ; addressible on the the disk by DOS. ;an000;bgb | ||
| 1106 | ; ;an000;bgb | ||
| 1107 | ; Inputs : none ;an000;bgb | ||
| 1108 | ; ;an000;bgb | ||
| 1109 | ; Outputs : Fdsksiz - Size in bytes of the disk ;an000;bgb | ||
| 1110 | ;****************************************************************************** ;an000;bgb | ||
| 1111 | Procedure Calc_Space ; ;an000;bgb | ||
| 1112 | ; get the total number of clusters on the disk ;an000;bgb ;an006;bgb | ||
| 1113 | p97: xor ax,ax ;clear ax ;an000;bgb | ||
| 1114 | mov ah,36h ;Get disk free space ;an000;bgb | ||
| 1115 | mov dl,alldrv ; 1 based drive number ;an000;bgb | ||
| 1116 | push bx ;save bpb pointer ;an000;bgb;an015;bgb | ||
| 1117 | int 21h ;bx = total space avail ;an000;bgb | ||
| 1118 | ;multiply by sectors per cluster ;an000;bgb | ||
| 1119 | gtsecs: mov ax,dx ;get total clusters ;an000;bgb | ||
| 1120 | xor cx,cx ;clear cx ;an000;bgb | ||
| 1121 | pop bx ;restore bpb pointer ;an000;bgb;an015;bgb | ||
| 1122 | mov cl,[bx].SectorsPerCluster ;get total sectors ;an000;bgb;an015;bgb | ||
| 1123 | push bx ;save bpb pointer ;an000;bgb;an015;bgb | ||
| 1124 | xor bx,bx ;clear bx ;an000;bgb | ||
| 1125 | call Multiply_32_Bits ;multiply ;an000;bgb | ||
| 1126 | ;multiply by bytes per sector ;an000;bgb | ||
| 1127 | mov dx,bx ;save bx ;an000;bgb;an015;bgb | ||
| 1128 | pop bx ;get bpb addr ;an000;bgb;an015;bgb | ||
| 1129 | mov cx,[bx].BytePerSector ;get total bytes ;an000;bgb;an015;bgb | ||
| 1130 | mov bx,dx ;restore bx ;an000;bgb;an015;bgb | ||
| 1131 | call Multiply_32_Bits ; multiply ;an000;bgb | ||
| 1132 | ;result is bytes on disk ;an000;bgb | ||
| 1133 | mov tot_bytes_lo,ax ;save high word ;an000;bgb | ||
| 1134 | mov tot_bytes_hi,bx ;save low word ;an000;bgb | ||
| 1135 | ret ; ;an000;bgb | ||
| 1136 | Calc_Space endp ; ;an000;bgb | ||
| 1137 | |||
| 1138 | |||
| 1139 | ;***************************************************************************** ;an000;bgb | ||
| 1140 | ;Routine name: Check_For_Network ;an000;bgb | ||
| 1141 | ;***************************************************************************** ;an000;bgb | ||
| 1142 | ; ;an000;bgb | ||
| 1143 | ;Description: See if target drive isn't local, or if it is a shared drive. If ;an000;bgb | ||
| 1144 | ; so, exit with error message. The IOCtl call is not checked for ;an000;bgb | ||
| 1145 | ; an error because it is called previously in another routine, and ;an000;bgb | ||
| 1146 | ; invalid drive is the only error it can generate. That condition ;an000;bgb | ||
| 1147 | ; would not get this far ;an000;bgb | ||
| 1148 | ; ;an000;bgb | ||
| 1149 | ;Called Procedures: Message (macro) ;an000;bgb | ||
| 1150 | ; ;an000;bgb | ||
| 1151 | ;Change History: Created 5/1/87 MT ;an000;bgb | ||
| 1152 | ; ;an000;bgb | ||
| 1153 | ;Input: Drive_Letter_Buffer.Drive_Number ;an000;bgb | ||
| 1154 | ; Fatal_Error = NO ;an000;bgb | ||
| 1155 | ; ;an000;bgb | ||
| 1156 | ;Output: Fatal_Error = YES/NO ;an000;bgb | ||
| 1157 | ; ;an000;bgb | ||
| 1158 | ;Psuedocode ;an000;bgb | ||
| 1159 | ;---------- ;an000;bgb | ||
| 1160 | ; See if drive is local (INT 21h, AX=4409 IOCtl) ;an000;bgb | ||
| 1161 | ; IF not local ;an000;bgb | ||
| 1162 | ; Display network message ;an000;bgb | ||
| 1163 | ; Fatal_ERROR = YES ;an000;bgb | ||
| 1164 | ; ELSE ;an000;bgb | ||
| 1165 | ; IF 8000h bit set on return ;an000;bgb | ||
| 1166 | ; Display assign message ;an000;bgb | ||
| 1167 | ; Fatal_Error = YES ;an000;bgb | ||
| 1168 | ; ENDIF ;an000;bgb | ||
| 1169 | ; ENDIF ;an000;bgb | ||
| 1170 | ; ret ;an000;bgb | ||
| 1171 | ;***************************************************************************** ;an000;bgb | ||
| 1172 | ;an000;bgb | ||
| 1173 | Procedure Check_For_Network ; ;an000;bgb;AN000; | ||
| 1174 | ; ;an000;bgb | ||
| 1175 | mov bl,alldrv ;Drive is 1=A, 2=B ;an000;bgb; ; | ||
| 1176 | mov al,09h ;See if drive is local or remote;an000;bgb;AC000; | ||
| 1177 | DOS_CALL IOCtl ;We will not check for error ;an000;bgb;AC000; | ||
| 1178 | test dx,Net_Check ;if (x & 1200H)(redir or shared);an000;bgb; ; | ||
| 1179 | ; $IF NZ ;Found a net drive ;an000;bgb;AC000; | ||
| 1180 | JZ $$IF75 | ||
| 1181 | Message No_Net_Arg ;Tell 'em ;an000;bgb;AC000; | ||
| 1182 | mov Fatal_Error,Yes ;Indicate bad stuff ;an000;bgb;AN000; | ||
| 1183 | ; $ELSE ;Local drive, now check assign ;an000;bgb;AN000; | ||
| 1184 | JMP SHORT $$EN75 | ||
| 1185 | $$IF75: | ||
| 1186 | test dx,Assign_Check ;8000h bit is bad news ;an000;bgb; ; | ||
| 1187 | ; $IF NZ ;Found it ;an000;bgb;AC000; | ||
| 1188 | JZ $$IF77 | ||
| 1189 | Message SubstErr ;Tell error ;an000;bgb;AC000; | ||
| 1190 | mov Fatal_Error,Yes ;Indicate bad stuff ;an000;bgb;AN000; | ||
| 1191 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 1192 | $$IF77: | ||
| 1193 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 1194 | $$EN75: | ||
| 1195 | ret ; ;an000;bgb;AN000; | ||
| 1196 | ;an000;bgb | ||
| 1197 | Check_For_Network endp ; ;an000;bgb;AN000; | ||
| 1198 | ;an000;bgb | ||
| 1199 | ;***************************************************************************** ;an000;bgb | ||
| 1200 | ;Routine name: Check_Translate_Drive ;an000;bgb | ||
| 1201 | ;***************************************************************************** ;an000;bgb | ||
| 1202 | ; ;an000;bgb | ||
| 1203 | ;Description: Do a name translate call on the drive letter to see if it is ;an000;bgb | ||
| 1204 | ; assigned by SUBST or ASSIGN ;an000;bgb | ||
| 1205 | ; ;an000;bgb | ||
| 1206 | ;Called Procedures: Message (macro) ;an000;bgb | ||
| 1207 | ; ;an000;bgb | ||
| 1208 | ;Change History: Created 5/1/87 MT ;an000;bgb | ||
| 1209 | ; ;an000;bgb | ||
| 1210 | ;Input: Drive_Letter_Buffer.Drive_Number ;an000;bgb | ||
| 1211 | ; Fatal_Error = NO ;an000;bgb | ||
| 1212 | ; ;an000;bgb | ||
| 1213 | ;Output: Fatal_Error = YES/NO ;an000;bgb | ||
| 1214 | ; ;an000;bgb | ||
| 1215 | ;Psuedocode ;an000;bgb | ||
| 1216 | ;---------- ;an000;bgb | ||
| 1217 | ; Put drive letter in ASCIIZ string "d:\",0 ;an000;bgb | ||
| 1218 | ; Do name translate call (INT 21) ;an000;bgb | ||
| 1219 | ; IF drive not same ;an000;bgb | ||
| 1220 | ; Display assigned message ;an000;bgb | ||
| 1221 | ; Fatal_Error = YES ;an000;bgb | ||
| 1222 | ; ENDIF ;an000;bgb | ||
| 1223 | ; ret ;an000;bgb | ||
| 1224 | ;***************************************************************************** ;an000;bgb | ||
| 1225 | Procedure Check_Translate_Drive ; ;an000;bgb;AN000; | ||
| 1226 | call func60 ; ;an000;bgb | ||
| 1227 | mov bl,byte ptr [TranSrc] ;Get drive letter from path ;an000;bgb; ; | ||
| 1228 | cmp bl,byte ptr [Chkprmt_End] ;Did drive letter change? ;an000;bgb; ; | ||
| 1229 | ; $IF NE ;If not the same, it be bad ;an000;bgb;AC000; | ||
| 1230 | JE $$IF80 | ||
| 1231 | Message SubstErr ;Tell user ;an000;bgb;AC000; | ||
| 1232 | mov Fatal_Error,Yes ;Setup error flag ;an000;bgb;AN000; | ||
| 1233 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 1234 | $$IF80: | ||
| 1235 | ret ; ;an000;bgb;AN000; | ||
| 1236 | Check_Translate_Drive endp ; ;an000;bgb;AN000; | ||
| 1237 | ;an000;bgb | ||
| 1238 | ;an000;bgb | ||
| 1239 | Procedure func60 ; ;an000;bgb;AN000; | ||
| 1240 | ; PUSH DS ;ICE ;an000;bgb | ||
| 1241 | ; push bx ;ICE ;an000;bgb | ||
| 1242 | ; push ax ;ICE ;an000;bgb | ||
| 1243 | ; ;an000;bgb | ||
| 1244 | ; mov bx,0140H ;ICE ;an000;bgb | ||
| 1245 | ; xor ax,ax ;ICE ;an000;bgb | ||
| 1246 | ; mov ds,ax ;ICE ;an000;bgb | ||
| 1247 | ; mov ax,word ptr ds:[bx] ;ICE ;an000;bgb | ||
| 1248 | ; mov word ptr ds:[bx],ax ;ICE ;an000;bgb | ||
| 1249 | ; ;an000;bgb | ||
| 1250 | ; pop ax ;ICE ;an000;bgb | ||
| 1251 | ; pop bx ;ICE ;an000;bgb | ||
| 1252 | ; POP DS ;ICE ;an000;bgb | ||
| 1253 | ;an000;bgb | ||
| 1254 | mov byte ptr [transrc],'A' ;an000;bgb | ||
| 1255 | mov bl,alldrv ;Get drive ; ;an000;bgb ; | ||
| 1256 | dec bl ;Make it 0 based ;an000;bgb;AN001; | ||
| 1257 | add byte ptr [TranSrc],bl ;Make string "d:\" ;an000;bgb; ; | ||
| 1258 | lea si,TranSrc ;Point to translate string ;an000;bgb; ; | ||
| 1259 | push ds ;Set ES=DS (Data segment) ;an000;bgb; ; | ||
| 1260 | pop es ; " " " " ;an000;bgb; ; | ||
| 1261 | lea di,Chkprmt_End ;Point at output buffer ;an000;bgb; ; | ||
| 1262 | DOS_Call xNameTrans ;Get real path ;an000;bgb;AC000; | ||
| 1263 | ret ; ;an000;bgb;AN000; | ||
| 1264 | func60 endp ; ;AN000; ;an000;bgb | ||
| 1265 | ;an000;bgb | ||
| 1266 | ;an000;bgb | ||
| 1267 | ;***************************************************************************** ;an000;bgb | ||
| 1268 | ;Routine name: Hook_Interrupts ;an000;bgb | ||
| 1269 | ;***************************************************************************** ;an000;bgb | ||
| 1270 | ; ;an000;bgb | ||
| 1271 | ;Description: Change the interrupt handler for INT 13h to point to the ;an000;bgb | ||
| 1272 | ; ControlC_Handler routine ;an000;bgb | ||
| 1273 | ; ;an000;bgb | ||
| 1274 | ;Called Procedures: None ;an000;bgb | ||
| 1275 | ; ;an000;bgb | ||
| 1276 | ;Change History: Created 4/21/87 MT ;an000;bgb | ||
| 1277 | ; ;an000;bgb | ||
| 1278 | ;Input: None ;an000;bgb | ||
| 1279 | ; ;an000;bgb | ||
| 1280 | ;Output: None ;an000;bgb | ||
| 1281 | ; ;an000;bgb | ||
| 1282 | ;Psuedocode ;an000;bgb | ||
| 1283 | ;---------- ;an000;bgb | ||
| 1284 | ; ;an000;bgb | ||
| 1285 | ; Point at ControlC_Handler routine ;an000;bgb | ||
| 1286 | ; Set interrupt handler (INT 21h, AX=2523h) ;an000;bgb | ||
| 1287 | ; ret ;an000;bgb | ||
| 1288 | ;***************************************************************************** ;an000;bgb | ||
| 1289 | ;an000;bgb | ||
| 1290 | procedure Hook_Interrupts ; ;an000;bgb;AN000; | ||
| 1291 | ; ;an000;bgb | ||
| 1292 | mov al,23h ;an000;bgb | ||
| 1293 | DOS_Call Get_Interrupt_Vector ;Get the INT 23h handler ;an000;bgb;AC000; | ||
| 1294 | mov word ptr [CONTCH],bx ; ;an000;bgb | ||
| 1295 | mov bx,es ; ;an000;bgb;AN000; | ||
| 1296 | mov word ptr [CONTCH+2],bx ; ;an000;bgb | ||
| 1297 | mov al,23h ;Specify CNTRL handler ;an000;bgb; ; | ||
| 1298 | lea dx, INT_23 ;Point at it ;an000;bgb; ; | ||
| 1299 | push ds ;Save data seg ;an000;bgb; ; | ||
| 1300 | push cs ;Point to code segment ;an000;bgb; ; | ||
| 1301 | pop ds ; ;an000;bgb; ; | ||
| 1302 | DOS_Call Set_Interrupt_Vector ;Set the INT 23h handler ;an000;bgb;AC000; | ||
| 1303 | pop ds ;Get Data degment back ;an000;bgb; ; | ||
| 1304 | mov al,24h ; ;an000;bgb | ||
| 1305 | DOS_Call Get_Interrupt_Vector ;Get the INT 24h handler ;an000;bgb;AC000; | ||
| 1306 | mov word ptr [HardCh],bx ;Save it ;an000;bgb | ||
| 1307 | mov bx,es ; ;an000;bgb | ||
| 1308 | mov word ptr [HardCh+2],bx ; ;an000;bgb | ||
| 1309 | mov al,24h ;Specify handler ;an000;bgb ; ; | ||
| 1310 | lea dx, INT_24 ;Point at it ;an000;bgb; ; | ||
| 1311 | push ds ;Save data seg ;an000;bgb; ; | ||
| 1312 | push cs ;Point to code segment ;an000;bgb; ; | ||
| 1313 | pop ds ; ;an000;bgb; ; | ||
| 1314 | DOS_Call Set_Interrupt_Vector ;Set the INT 23h handler ;an000;bgb;AC000; | ||
| 1315 | pop ds ;Get Data degment back ;an000;bgb; ; | ||
| 1316 | ret ; ;an000;bgb;AN000; | ||
| 1317 | ;an000;bgb | ||
| 1318 | hook_Interrupts endp ; ;an000;bgb;AN000; | ||
| 1319 | ;an000;bgb | ||
| 1320 | ;***************************************************************************** ;an000;bgb | ||
| 1321 | ;Routine name: Clear_Append_X ;an000;bgb | ||
| 1322 | ;***************************************************************************** ;an000;bgb | ||
| 1323 | ; ;an000;bgb | ||
| 1324 | ;Description: Determine if Append /XA is turned on thru INT 2Fh, and shut ;an000;bgb | ||
| 1325 | ; off for life of CHKDSK if it is. ;an000;bgb | ||
| 1326 | ; ;an000;bgb | ||
| 1327 | ;Called Procedures: None ;an000;bgb | ||
| 1328 | ; ;an000;bgb | ||
| 1329 | ; ;an000;bgb | ||
| 1330 | ;Change History: Created 5/13/87 MT ;an000;bgb | ||
| 1331 | ; ;an000;bgb | ||
| 1332 | ;Input: None ;an000;bgb | ||
| 1333 | ; ;an000;bgb | ||
| 1334 | ;Output: APPEND = YES/NO ;an000;bgb | ||
| 1335 | ; ;an000;bgb | ||
| 1336 | ;Psuedocode ;an000;bgb | ||
| 1337 | ;---------- ;an000;bgb | ||
| 1338 | ; ;an000;bgb | ||
| 1339 | ; Append = NO ;an000;bgb | ||
| 1340 | ; See if APPEND /X is present (INT 2Fh, AX=0B706h) ;an000;bgb | ||
| 1341 | ; IF present ;an000;bgb | ||
| 1342 | ; Turn append /X off (INT 2Fh, AX=B707h, BX = 0) ;an000;bgb | ||
| 1343 | ; Append = YES ;an000;bgb | ||
| 1344 | ; ENDIF ;an000;bgb | ||
| 1345 | ; ret ;an000;bgb | ||
| 1346 | ;***************************************************************************** ;an000;bgb | ||
| 1347 | ;an000;bgb | ||
| 1348 | Procedure Clear_Append_X ; ;an000;bgb ;AN000; | ||
| 1349 | ;an000;bgb | ||
| 1350 | mov Append,NO ;Init the Append /X flag ;an000;bgb;AN000; | ||
| 1351 | mov ax,Append_X ;Is Append /X there? ;an000;bgb;AN000; | ||
| 1352 | int Multiplex ; " " " " ;an000;bgb;AN000; | ||
| 1353 | cmp bx,Append_X_Set ;Was it turned on? ;an000;bgb;AN000; | ||
| 1354 | ; $IF E ;Yep ;an000;bgb;AN000; | ||
| 1355 | JNE $$IF82 | ||
| 1356 | mov Append,YES ;Indicate that it was on ;an000;bgb;AN000; | ||
| 1357 | mov ax,Set_Append_X ;Turn Append /X off ;an000;bgb;AN000; | ||
| 1358 | mov bx,Append_Off ; " " " " ;an000;bgb;AN000; | ||
| 1359 | int Multiplex ; " " " " ;an000;bgb;AN000; | ||
| 1360 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 1361 | $$IF82: | ||
| 1362 | ret ; ;an000;bgb;AN000; | ||
| 1363 | ;an000;bgb | ||
| 1364 | Clear_Append_X endp ; ;an000;bgb;AN000; | ||
| 1365 | ;an000;bgb | ||
| 1366 | ;an000;bgb | ||
| 1367 | ;***************************************************************************** ;an000;bgb | ||
| 1368 | ;Routine name: CHKDSK_IFS ;an000;bgb | ||
| 1369 | ;***************************************************************************** ;an000;bgb | ||
| 1370 | ; ;an000;bgb | ||
| 1371 | ;Description: ;an000;bgb | ||
| 1372 | ; ;an000;bgb | ||
| 1373 | ;Called Procedures: Main_Routine ;an000;bgb | ||
| 1374 | ; EXEC_FS_CHKDSK ;an000;bgb | ||
| 1375 | ; Done ;an000;bgb | ||
| 1376 | ; ;an000;bgb | ||
| 1377 | ;Change History: Created 5/8/87 MT ;an000;bgb | ||
| 1378 | ; ;an000;bgb | ||
| 1379 | ;Input: FS_Not_FAT = Yes/No ;an000;bgb | ||
| 1380 | ; ;an000;bgb | ||
| 1381 | ;Output: None ;an000;bgb | ||
| 1382 | ; ;an000;bgb | ||
| 1383 | ;Psuedocode ;an000;bgb | ||
| 1384 | ;---------- ;an000;bgb | ||
| 1385 | ; ;an000;bgb | ||
| 1386 | ; IF File system other than FAT ;an000;bgb | ||
| 1387 | ; Go call file system specific CHKDSK (CALL Exec_FS_CHKDSK) ;an000;bgb | ||
| 1388 | ; ELSE ;an000;bgb | ||
| 1389 | ; Do FAT based CHKDSK (CALL Main_Routine) ;an000;bgb | ||
| 1390 | ; ENDIF ;an000;bgb | ||
| 1391 | ; Restore current drive (CALL Done) ;an000;bgb | ||
| 1392 | ; ret ;an000;bgb | ||
| 1393 | ;***************************************************************************** ;an000;bgb | ||
| 1394 | ;an000;bgb | ||
| 1395 | ;an000;bgb | ||
| 1396 | Procedure CHKDSK_IFS ; ;an000;bgb;AN000; | ||
| 1397 | ;an000;bgb | ||
| 1398 | ifdef fsexec ;an038;bgb | ||
| 1399 | cmp FS_Not_Fat,YES ;Is the target FS a FAT? ;an038;bgb;AN000; | ||
| 1400 | ; $IF E ;No, so need to exec the ;an038;bgb;AN000; | ||
| 1401 | JNE $$IF84 | ||
| 1402 | call EXEC_FS_CHKDSK ; file system specific prog. ;an038;bgb;AN000; | ||
| 1403 | ; $ELSE ;It's a FAT ;an038;bgb;AN000; | ||
| 1404 | JMP SHORT $$EN84 | ||
| 1405 | $$IF84: | ||
| 1406 | endif ;an038;bgb | ||
| 1407 | call Main_Routine ;Use canned code! ;an038;bgb;AN000; | ||
| 1408 | ifdef fsexec ;an038;bgb | ||
| 1409 | ; $ENDIF ; ;an038;bgb;AN000; | ||
| 1410 | $$EN84: | ||
| 1411 | endif ;an038;bgb | ||
| 1412 | call Done ;Restore current drive ;an000;bgb;AN000; | ||
| 1413 | ret ; ;an000;bgb;AN000; | ||
| 1414 | ;an000;bgb | ||
| 1415 | CHKDSK_IFS endp ; ;an000;bgb;AN000; | ||
| 1416 | ;an000;bgb | ||
| 1417 | ;***************************************************************************** ;an000;bgb | ||
| 1418 | ;Routine name: Reset_Append_X ;an000;bgb | ||
| 1419 | ;***************************************************************************** ;an000;bgb | ||
| 1420 | ; ;an000;bgb | ||
| 1421 | ;description: If APPEND /XA was on originally, turn it back on ;an000;bgb | ||
| 1422 | ; ;an000;bgb | ||
| 1423 | ;Called Procedures: None ;an000;bgb | ||
| 1424 | ; ;an000;bgb | ||
| 1425 | ; ;an000;bgb | ||
| 1426 | ;Change History: Created 5/13/87 MT ;an000;bgb | ||
| 1427 | ; ;an000;bgb | ||
| 1428 | ;Input: None ;an000;bgb | ||
| 1429 | ; ;an000;bgb | ||
| 1430 | ;Output: APPEND = YES/NO ;an000;bgb | ||
| 1431 | ; ;an000;bgb | ||
| 1432 | ;Psuedocode ;an000;bgb | ||
| 1433 | ;---------- ;an000;bgb | ||
| 1434 | ; ;an000;bgb | ||
| 1435 | ; IF APPEND = YES ;an000;bgb | ||
| 1436 | ; Turn append /X on (INT 2Fh, AX=B707h, BX = 1) ;an000;bgb | ||
| 1437 | ; ENDIF ;an000;bgb | ||
| 1438 | ; ret ;an000;bgb | ||
| 1439 | ;***************************************************************************** ;an000;bgb | ||
| 1440 | ;an000;bgb | ||
| 1441 | Procedure Reset_Append_X ; ;an000;bgb;AN000; | ||
| 1442 | ;an000;bgb | ||
| 1443 | cmp Append,Yes ;Was Append /X on to start with?;an000;bgb;AN000; | ||
| 1444 | ; $IF E ;Yep ;an000;bgb;AN000; | ||
| 1445 | JNE $$IF87 | ||
| 1446 | mov ax,Set_Append_X ;Turn Append /X off ;an000;bgb;AN000; | ||
| 1447 | mov bx,Append_On ; " " " " ;an000;bgb;AN000; | ||
| 1448 | int Multiplex ; " " " " ;an000;bgb;AN000; | ||
| 1449 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 1450 | $$IF87: | ||
| 1451 | ret ; ;an000;bgb;AN000; | ||
| 1452 | ;an000;bgb | ||
| 1453 | Reset_Append_X endp ; ;an000;bgb;AN000; | ||
| 1454 | ;an000;bgb | ||
| 1455 | ;***************************************************************************** ;an000;bgb | ||
| 1456 | ;Routine name: Multiply_32_Bits ;an000;bgb | ||
| 1457 | ;***************************************************************************** ;an000;bgb | ||
| 1458 | ; ;an000;bgb | ||
| 1459 | ;Description: A real sleazy 32 bit x 16 bit multiply routine. Works by adding ;an000;bgb | ||
| 1460 | ; the 32 bit number to itself for each power of 2 contained in the ;an000;bgb | ||
| 1461 | ; 16 bit number. Whenever a bit that is set in the multiplier (CX) ;an000;bgb | ||
| 1462 | ; gets shifted to the bit 0 spot, it means that that amount has ;an000;bgb | ||
| 1463 | ; been multiplied so far, and it should be added into the total ;an000;bgb | ||
| 1464 | ; value. Take the example CX = 12 (1100). Using the associative ;an000;bgb | ||
| 1465 | ; rule, this is the same as CX = 8+4 (1000 + 0100). The ;an000;bgb | ||
| 1466 | ; multiply is done on this principle - whenever a bit that is set ;an000;bgb | ||
| 1467 | ; is shifted down to the bit 0 location, the value in BX:AX is ;an000;bgb | ||
| 1468 | ; added to the running total in DI:SI. The multiply is continued ;an000;bgb | ||
| 1469 | ; until CX = 0. The routine will exit with CY set if overflow ;an000;bgb | ||
| 1470 | ; occurs. ;an000;bgb | ||
| 1471 | ; ;an000;bgb | ||
| 1472 | ; ;an000;bgb | ||
| 1473 | ;Called Procedures: None ;an000;bgb | ||
| 1474 | ; ;an000;bgb | ||
| 1475 | ;Change History: Created 7/23/87 MT ;an000;bgb | ||
| 1476 | ; ;an000;bgb | ||
| 1477 | ;Input: BX:AX = 32 bit number to be multiplied ;an000;bgb | ||
| 1478 | ; CX = 16 bit number to be multiplied. (Must be even number) ;an000;bgb | ||
| 1479 | ; ;an000;bgb | ||
| 1480 | ;Output: BX:AX = output. ;an000;bgb | ||
| 1481 | ; CY set if overflow ;an000;bgb | ||
| 1482 | ; ;an000;bgb | ||
| 1483 | ;Psuedocode ;an000;bgb | ||
| 1484 | ;---------- ;an000;bgb | ||
| 1485 | ; ;an000;bgb | ||
| 1486 | ; Point at ControlC_Handler routine ;an000;bgb | ||
| 1487 | ; Set interrupt handler (INT 21h, AX=2523h) ;an000;bgb | ||
| 1488 | ; ret ;an000;bgb | ||
| 1489 | ;***************************************************************************** ;an000;bgb | ||
| 1490 | ;an000;bgb | ||
| 1491 | Public Multiply_32_Bits ;an000;bgb | ||
| 1492 | Multiply_32_Bits proc ; ;an000;bgb;AN000; | ||
| 1493 | ;an000;bgb | ||
| 1494 | push di ; ;an000;bgb;AN000; | ||
| 1495 | push si ; ;an000;bgb;AN000; | ||
| 1496 | xor di,di ;Init result to zero ;an000;bgb | ||
| 1497 | xor si,si ; ;an000;bgb | ||
| 1498 | cmp cx,0 ;Multiply by 0? ;an000;bgb;AN000; | ||
| 1499 | ; $IF NE ;Keep going if not ;an000;bgb;AN000; | ||
| 1500 | JE $$IF89 | ||
| 1501 | ; $DO ;This works by adding the result;an000;bgb;AN000; | ||
| 1502 | $$DO90: | ||
| 1503 | test cx,1 ;Need to add in sum of this bit?;an000;bgb;AN000; | ||
| 1504 | ; $IF NZ ;Yes ;an000;bgb;AN000; | ||
| 1505 | JZ $$IF91 | ||
| 1506 | add si,ax ;Add in the total so far for ;an000;bgb;AN000; | ||
| 1507 | adc di,bx ; this bit multiplier (CY oflow);an000;bgb;AN000; | ||
| 1508 | ; $ELSE ;Don't split multiplier ;an000;bgb;AN000; | ||
| 1509 | JMP SHORT $$EN91 | ||
| 1510 | $$IF91: | ||
| 1511 | clc ;Force non exit ;an000;bgb;AN000; | ||
| 1512 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 1513 | $$EN91: | ||
| 1514 | ; $LEAVE C ;Leave on overflow ;an000;bgb;AN000; | ||
| 1515 | JC $$EN90 | ||
| 1516 | shr cx,1 ;See if need to multiply value ;an000;bgb;AN000; | ||
| 1517 | cmp cx,0 ;by 2 ;an000;bgb;AN000; | ||
| 1518 | ; $LEAVE E ;Done if cx shifted down to zero;an000;bgb;AN000; | ||
| 1519 | JE $$EN90 | ||
| 1520 | add ax,ax ;Each time cx is shifted, add ;an000;bgb;AN000; | ||
| 1521 | adc bx,bx ;value to itself (Multiply * 2) ;an000;bgb;AN000; | ||
| 1522 | ; $ENDDO C ;CY set on overflow ;an000;bgb;AN000; | ||
| 1523 | JNC $$DO90 | ||
| 1524 | $$EN90: | ||
| 1525 | ; $IF NC ;If no overflow, add in DI:SI ;an000;bgb;AN000; | ||
| 1526 | JC $$IF97 | ||
| 1527 | mov ax,si ; which contains the original ;an000;bgb;AN000; | ||
| 1528 | mov bx,di ; value if odd, 0 if even. This ;an000;bgb;AN000; | ||
| 1529 | clc ;Set no overflow flag ;an000;bgb;AN000; | ||
| 1530 | ; $ENDIF ; ;an000;bgb;AN000; | ||
| 1531 | $$IF97: | ||
| 1532 | ; $ELSE ; ;an000;bgb | ||
| 1533 | JMP SHORT $$EN89 | ||
| 1534 | $$IF89: | ||
| 1535 | xor ax,ax ; ;an000;bgb | ||
| 1536 | xor bx,bx ; ;an000;bgb | ||
| 1537 | ; $ENDIF ;Multiply by 0 ;an000;bgb;AN000; | ||
| 1538 | $$EN89: | ||
| 1539 | pop si ; ;an000;bgb;AN000; | ||
| 1540 | pop di ; ;an000;bgb;AN000; | ||
| 1541 | ret ; ;an000;bgb;AN000; | ||
| 1542 | ;an000;bgb | ||
| 1543 | Multiply_32_Bits endp ;an000;bgb | ||
| 1544 | pathlabl chkinit ;an000;bgb | ||
| 1545 | code ends ;an000;bgb | ||
| 1546 | end ;an000;bgb | ||
| 1547 | ;an000;bgb | ||
| 1548 | \ No newline at end of file | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKMACRO.INC b/v4.0/src/CMD/CHKDSK/CHKMACRO.INC new file mode 100644 index 0000000..f6ba6ac --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKMACRO.INC | |||
| @@ -0,0 +1,105 @@ | |||
| 1 | |||
| 2 | BREAK MACRO subtitle | ||
| 3 | SUBTTL subtitle | ||
| 4 | PAGE | ||
| 5 | ENDM | ||
| 6 | |||
| 7 | |||
| 8 | ; | ||
| 9 | ;****************************************************************************** | ||
| 10 | ; Message Macro Definitions | ||
| 11 | ;****************************************************************************** | ||
| 12 | ; | ||
| 13 | |||
| 14 | EXTRN Display_Interface:near | ||
| 15 | |||
| 16 | |||
| 17 | ;----------------------------------------------------------------------------- | ||
| 18 | |||
| 19 | Message macro Message_Name ; ;AN000; | ||
| 20 | ; | ||
| 21 | mov dx,offset dg:Message_Name ; ;AN000; | ||
| 22 | call Display_Interface ; ;AN000; | ||
| 23 | ; | ||
| 24 | endm ; ;AN000; | ||
| 25 | |||
| 26 | ;----------------------------------------------------------------------------- | ||
| 27 | |||
| 28 | Parse_Message macro ; ;AN000; | ||
| 29 | |||
| 30 | ; | ||
| 31 | push ds | ||
| 32 | mov dx,dg | ||
| 33 | mov ds,dx | ||
| 34 | mov word ptr Parse_Error_Msg,ax ; ;AN000; | ||
| 35 | mov dx,offset dg:Parse_Error_Msg ; ;AN000; | ||
| 36 | call Display_Interface ; ;AN000; | ||
| 37 | pop ds ; | ||
| 38 | endm ; ;AN000; | ||
| 39 | |||
| 40 | ;----------------------------------------------------------------------------- | ||
| 41 | |||
| 42 | Extended_Message macro ; ;AN000; | ||
| 43 | ; | ||
| 44 | |||
| 45 | push ds | ||
| 46 | mov dx,dg | ||
| 47 | mov ds,dx | ||
| 48 | mov word ptr Extended_Error_Msg,ax ; ;AN000; | ||
| 49 | mov dx,offset dg:Extended_Error_Msg ; ;AN000; | ||
| 50 | call Display_Interface ; ;AN000; | ||
| 51 | pop ds | ||
| 52 | endm ; ;AN000; | ||
| 53 | ; | ||
| 54 | ;***************************************************************************** | ||
| 55 | ; General Macro's | ||
| 56 | ;***************************************************************************** | ||
| 57 | ; | ||
| 58 | |||
| 59 | Procedure macro Proc_Name,Seg_Name ; ;AN000; | ||
| 60 | ; | ||
| 61 | Public Proc_Name ; ;AN000; | ||
| 62 | Proc_Name proc ; ;AN000; | ||
| 63 | |||
| 64 | endm ; ;AN000; | ||
| 65 | ;----------------------------------------------------------------------------- | ||
| 66 | |||
| 67 | DOS_Call macro Function ; ;AN000; | ||
| 68 | ; | ||
| 69 | mov ah,Function ; ;AN000; | ||
| 70 | int 21h ; ;AN000; | ||
| 71 | ; | ||
| 72 | endm ; ;AN000; | ||
| 73 | |||
| 74 | ;----------------------------------------------------------------------------- | ||
| 75 | |||
| 76 | Popff macro | ||
| 77 | |||
| 78 | Assume cs:DG | ||
| 79 | |||
| 80 | jmp $+3 | ||
| 81 | iret | ||
| 82 | push cs | ||
| 83 | call $-2 | ||
| 84 | |||
| 85 | Assume cs:code | ||
| 86 | |||
| 87 | endm | ||
| 88 | |||
| 89 | ;----------------------------------------------------------------------------- | ||
| 90 | |||
| 91 | Set_Data_Segment macro | ||
| 92 | |||
| 93 | push ax | ||
| 94 | mov ax,dg ;Point to data segment | ||
| 95 | mov ds,ax ; | ||
| 96 | push ds | ||
| 97 | pop es | ||
| 98 | pop ax | ||
| 99 | |||
| 100 | .LALL | ||
| 101 | assume ds:dg,es:dg | ||
| 102 | .XALL | ||
| 103 | endm | ||
| 104 | |||
| 105 | \ No newline at end of file | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKMSG.INC b/v4.0/src/CMD/CHKDSK/CHKMSG.INC new file mode 100644 index 0000000..6b75dad --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKMSG.INC | |||
| @@ -0,0 +1,1047 @@ | |||
| 1 | ;an000;bgb | ||
| 2 | ; ;an000;bgb | ||
| 3 | ;***************************************************************************** ;an000;bgb | ||
| 4 | ; Macro's ;an000;bgb | ||
| 5 | ;***************************************************************************** ;an000;bgb | ||
| 6 | ; ;an000;bgb | ||
| 7 | ;an000;bgb | ||
| 8 | ;an000;bgb | ||
| 9 | Define_Msg macro Message_Name ; ;AN000; | ||
| 10 | ; ;an000;bgb | ||
| 11 | Create_Msg Message_Name,Message_Number,Handle,Sublist,Count,Class,Function,Input;AN000; | ||
| 12 | ; ;an000;bgb | ||
| 13 | endm ; ;AN000; | ||
| 14 | ;an000;bgb | ||
| 15 | ;----------------------------------------------------------------------------- ;an000;bgb | ||
| 16 | ;an000;bgb | ||
| 17 | Create_Msg macro Parm1,Parm2,Parm3,Parm4,Parm5,Parm6,Parm7,Parm8; ;AN000; | ||
| 18 | ;an000;bgb | ||
| 19 | Public Parm1 ;an000;bgb | ||
| 20 | Parm1 label word ; ;AN000; | ||
| 21 | dw Parm2 ; ;AN000; | ||
| 22 | dw Parm3 ; ;AN000; | ||
| 23 | dw Parm4 ; ;AN000; | ||
| 24 | dw Parm5 ; ;AN000; | ||
| 25 | db Parm6 ; ;AN000; | ||
| 26 | db Parm7 ; ;AN000; | ||
| 27 | dw Parm8 ; ;AN000; | ||
| 28 | endm ; ;AN000; | ||
| 29 | ;an000;bgb | ||
| 30 | ;an000;bgb | ||
| 31 | ; ;an000;bgb | ||
| 32 | ;***************************************************************************** ;an000;bgb | ||
| 33 | ; External data declarations ;an000;bgb | ||
| 34 | ;***************************************************************************** ;an000;bgb | ||
| 35 | ; ;an000;bgb | ||
| 36 | ;an000;bgb | ||
| 37 | Extrn Arg_Buf:Byte ;an000;bgb | ||
| 38 | ifdef fsexec ;an038;bgb | ||
| 39 | Extrn Drive_Letter_Msg:Byte ;an038;bgb;an000;bgb | ||
| 40 | endif ;an038;bgb | ||
| 41 | Extrn TChar:Byte ;an000;bgb | ||
| 42 | Extrn Cross_Clus:Byte ;an000;bgb | ||
| 43 | extrn sernum:word ;an024;bgb | ||
| 44 | ; ;an000;bgb | ||
| 45 | ;***************************************************************************** ;an000;bgb | ||
| 46 | ; Public Data ;an000;bgb | ||
| 47 | ;***************************************************************************** ;an000;bgb | ||
| 48 | ; ;an000;bgb | ||
| 49 | ;an000;bgb | ||
| 50 | Public Sublist_msg_Idmes ;an000;bgb | ||
| 51 | Public BadDrvm ;an000;bgb | ||
| 52 | Public YES_BYTE ;an000;bgb | ||
| 53 | Public NO_BYTE ;an000;bgb | ||
| 54 | Public yn_arg ;an000;bgb | ||
| 55 | Public orphcnt ;an000;bgb | ||
| 56 | Public report_arg ;an000;bgb | ||
| 57 | Public rarg1 ;an000;bgb | ||
| 58 | Public rarg3 ;an000;bgb | ||
| 59 | Public badrw_str ;an000;bgb | ||
| 60 | Public badrw_num ;an000;bgb | ||
| 61 | Public block_num ;an000;bgb | ||
| 62 | Public fatal_arg1 ;an000;bgb | ||
| 63 | Public fatal_arg2 ;an000;bgb | ||
| 64 | Public file_arg1 ;an000;bgb | ||
| 65 | Public file_arg2 ;an000;bgb | ||
| 66 | Public free_arg1 ;an000;bgb | ||
| 67 | Public free_arg2 ;an000;bgb | ||
| 68 | Public free_arg3 ;an000;bgb | ||
| 69 | Public Fatal_End ;an000;bgb | ||
| 70 | Public MonTab ;an000;bgb | ||
| 71 | public fatmsg1 ;an024;bgb ;an000;bgb | ||
| 72 | public fatmsg2 ;an024;bgb ;an000;bgb | ||
| 73 | extrn orphsiz:word ;an049;bgb | ||
| 74 | ;an000;bgb | ||
| 75 | ; ;an000;bgb | ||
| 76 | ;***************************************************************************** ;an000;bgb | ||
| 77 | ; Message Retriever equates ;an000;bgb | ||
| 78 | ;***************************************************************************** ;an000;bgb | ||
| 79 | ; ;an000;bgb | ||
| 80 | ;an000;bgb | ||
| 81 | ;an000;bgb | ||
| 82 | Format_Msg equ 'C' ;an000;bgb | ||
| 83 | ;an000;bgb | ||
| 84 | N_A equ 0 ;an000;bgb | ||
| 85 | None equ 0 ;an000;bgb | ||
| 86 | ;an000;bgb | ||
| 87 | Blank equ " " ;an000;bgb | ||
| 88 | No_Function equ 0 ;an000;bgb | ||
| 89 | ;an000;bgb | ||
| 90 | ;an000;bgb | ||
| 91 | ;an000;bgb | ||
| 92 | ;an000;bgb | ||
| 93 | data segment public para 'data' ; AN000; ;an000;bgb | ||
| 94 | ;an000;bgb | ||
| 95 | ; ;an000;bgb | ||
| 96 | ;***************************************************************************** ;an000;bgb | ||
| 97 | ; Message Sublist Tables ;an000;bgb | ||
| 98 | ;***************************************************************************** ;an000;bgb | ||
| 99 | ; ;an000;bgb | ||
| 100 | ;The following control blocks are used for messages with ;an000;bgb | ||
| 101 | ;replaceable paramters. These control blocks are used by the ;an000;bgb | ||
| 102 | ;SysDispMsg routine. ;an000;bgb | ||
| 103 | ; ;an000;bgb | ||
| 104 | ;an000;bgb | ||
| 105 | ;--------------------------- ; ;an000;bgb | ||
| 106 | Sublist_msg_Orphmes2 label dword ; ;an000;bgb | ||
| 107 | Sublist_msg_Orphmes3 label dword ; ;an000;bgb | ||
| 108 | Sublist_msg_HidMes label dword ; ;an000;bgb | ||
| 109 | Sublist_msg_DirMes label dword ; ;an000;bgb | ||
| 110 | Sublist_msg_FileMes label dword ; ;an000;bgb | ||
| 111 | ;an000;bgb | ||
| 112 | db Sublist_Length ;0bh ;an000;bgb;an049;bgb | ||
| 113 | db Reserved ;00h ;an000;bgb;an049;bgb | ||
| 114 | dw rarg1 ;offset of value ;an000;bgb;an049;bgb | ||
| 115 | dw dg ;segment of value ;an000;bgb;an049;bgb | ||
| 116 | db 1 ;the first parm ;an000;bgb;an049;bgb | ||
| 117 | db Right_Align+Unsgn_Bin_DWord ;type of data ;an000;bgb;an049;bgb | ||
| 118 | db 10 ;max length of data ;an000;bgb;an049;bgb | ||
| 119 | db 10 ;min length of data ;an000;bgb;an049;bgb | ||
| 120 | db Blank ;pad character ;an000;bgb;an049;bgb | ||
| 121 | db Sublist_Length ;0bh ;an000;bgb;an049;bgb | ||
| 122 | db Reserved ;00h ;an000;bgb;an049;bgb | ||
| 123 | dw rarg3 ;offset of value ;an000;bgb;an049;bgb | ||
| 124 | dw dg ;segment of value ;an000;bgb;an049;bgb | ||
| 125 | db 2 ;the second parm ;an000;bgb;an049;bgb | ||
| 126 | db Left_Align+Unsgn_Bin_DWord;type of data ;an000;bgb;an049;bgb | ||
| 127 | db 10 ;max length of data ;an000;bgb;an049;bgb | ||
| 128 | db 1 ;min length of data ;an000;bgb;an049;bgb | ||
| 129 | db Blank ;pad character ;an000;bgb;an049;bgb | ||
| 130 | ;--------------------------- ; ;an000;bgb;an049;bgb | ||
| 131 | Sublist_msg_dskspc label dword ; ;an000;bgb;an049;bgb | ||
| 132 | Sublist_msg_badspc label dword ; ;an000;bgb;an049;bgb | ||
| 133 | Sublist_msg_frespc label dword ; ;an000;bgb;an049;bgb | ||
| 134 | Sublist_msg_totmem label dword ; ;an000;bgb;an049;bgb | ||
| 135 | Sublist_msg_fremem label dword ; ;an000;bgb;an049;bgb | ||
| 136 | Sublist_msg_Freebymes label dword ; ;an000;bgb;an049;bgb | ||
| 137 | Sublist_msg_alloc label dword ; ;an000;bgb;an049;bgb | ||
| 138 | ;an000;bgb;an049;bgb | ||
| 139 | db Sublist_Length ;0bh ;an000;bgb;an049;bgb | ||
| 140 | db Reserved ;00h ;an000;bgb;an049;bgb | ||
| 141 | dw dg:rarg1 ;offset of data ;an000;bgb;an049;bgb | ||
| 142 | dw dg ;segment of data ;an000;bgb;an049;bgb | ||
| 143 | db 1 ;1st parm ;an000;bgb;an049;bgb | ||
| 144 | db Right_Align+Unsgn_Bin_DWord ;type of data ;an000;bgb;an049;bgb | ||
| 145 | db 10 ;max length of data ;an000;bgb;an049;bgb | ||
| 146 | db 10 ;min length of data ;an000;bgb;an049;bgb | ||
| 147 | db Blank ;pad character ;an000;bgb;an049;bgb | ||
| 148 | ;--------------------------- ; ;an000;bgb;an049;bgb | ||
| 149 | Sublist_msg_Extents label dword ; ;an000;bgb | ||
| 150 | ;an000;bgb | ||
| 151 | db Sublist_Length ; ;an000;bgb | ||
| 152 | db Reserved ; ;an000;bgb | ||
| 153 | dw dg:arg_buf ; ;an000;bgb | ||
| 154 | dw dg ; ;an000;bgb | ||
| 155 | db 1 ; ;an000;bgb | ||
| 156 | db Left_Align+Char_Field_ASCIIZ ; ;an000;bgb | ||
| 157 | db 64 ; ;an000;bgb | ||
| 158 | db 1 ; ;an000;bgb | ||
| 159 | db Blank ; ;an000;bgb | ||
| 160 | db Sublist_Length ; ;an000;bgb | ||
| 161 | db Reserved ; ;an000;bgb | ||
| 162 | dw dg:rarg1 ; ;an000;bgb | ||
| 163 | dw dg ; ;an000;bgb | ||
| 164 | db 2 ; ;an000;bgb | ||
| 165 | db Left_Align+Unsgn_Bin_Word ; ;;an000;bgb | ||
| 166 | db 5 ; ;an000;bgb | ||
| 167 | db 1 ; ;an000;bgb | ||
| 168 | db Blank ; ;an000;bgb | ||
| 169 | ;an000;bgb | ||
| 170 | ;--------------------------- ; ;an000;bgb | ||
| 171 | Sublist_msg_Badr_arg label dword ; ;an000;bgb | ||
| 172 | Sublist_msg_Badw_arg label dword ; ;an000;bgb | ||
| 173 | ;an000;bgb | ||
| 174 | db Sublist_Length ; ;an000;bgb | ||
| 175 | db Reserved ; ;an000;bgb | ||
| 176 | dw dg:Badrw_Num ; ;an000;bgb | ||
| 177 | dw dg ; ;an000;bgb | ||
| 178 | db 1 ; ;an000;bgb | ||
| 179 | db Left_Align+Unsgn_Bin_Word ; ;;an000;bgb | ||
| 180 | db 5 ; ;an000;bgb | ||
| 181 | db 1 ; ;an000;bgb | ||
| 182 | db Blank ; ;an000;bgb | ||
| 183 | ;--------------------------- ; ;an000;bgb | ||
| 184 | Sublist_msg_Badrdmes label dword ; ;an000;bgb | ||
| 185 | ;an000;bgb | ||
| 186 | db Sublist_Length ; ;an000;bgb;AN000; | ||
| 187 | db Reserved ; ;an000;bgb;AN000; | ||
| 188 | dw dg:Fatal_End ; ;an000;bgb;AN000; | ||
| 189 | dw dg ; ;an000;bgb;AN000; | ||
| 190 | db 1 ; ;an000;bgb;AN000; | ||
| 191 | db Left_Align+Char_Field_ASCIIZ ; ;an000;bgb ;AN000; | ||
| 192 | db 1 ; ;an000;bgb;AN000; | ||
| 193 | db 1 ; ;an000;bgb;AN000; | ||
| 194 | db Blank ; ;an000;bgb;AN000; | ||
| 195 | ;--------------------------- ; ;an000;bgb | ||
| 196 | Sublist_msg_Crossmes label dword ; ;an000;bgb | ||
| 197 | ;an000;bgb | ||
| 198 | db Sublist_Length ; ;an000;bgb | ||
| 199 | db Reserved ; ;an000;bgb | ||
| 200 | dw dg:Cross_Clus ; ;an000;bgb | ||
| 201 | dw dg ; ;an000;bgb | ||
| 202 | db 1 ; ;an000;bgb | ||
| 203 | db Left_Align+Unsgn_Bin_Word ; ;an000;bgb | ||
| 204 | db 5 ; ;an000;bgb | ||
| 205 | db 1 ; ;an000;bgb | ||
| 206 | db Blank ; ;an000;bgb | ||
| 207 | ;--------------------------- ; ;an000;bgb | ||
| 208 | Sublist_msg_BadTarg label dword ; ;an000;bgb | ||
| 209 | ;an000;bgb | ||
| 210 | db Sublist_Length ; ;an000;bgb | ||
| 211 | db Reserved ; ;an000;bgb | ||
| 212 | dw dg:arg_buf ; ;an000;bgb | ||
| 213 | dw dg ; ;an000;bgb | ||
| 214 | db 1 ; ;an000;bgb | ||
| 215 | db Left_Align+Char_Field_ASCIIZ ; ;an000;bgb | ||
| 216 | db 64 ; ;an000;bgb | ||
| 217 | db 1 ; ;an000;bgb | ||
| 218 | db Blank ; ;an000;bgb;AN000; | ||
| 219 | ;--------------------------- ; ;an000;bgb | ||
| 220 | Sublist_msg_IDmes label dword ; ;an000;bgb | ||
| 221 | ;an000;bgb | ||
| 222 | db Sublist_Length ; ;an000;bgb;AN000; | ||
| 223 | db Reserved ; ;an000;bgb;AN000; | ||
| 224 | dw dg:arg_buf ; ;an000;bgb;AN000; | ||
| 225 | dw dg ; ;an000;bgb;AN000; | ||
| 226 | db 1 ; ;an000;bgb;AN000; | ||
| 227 | db Left_Align+Char_Field_ASCIIZ ; ;an000;bgb ;AN000; | ||
| 228 | db 11 ; ;an000;bgb;AN000; | ||
| 229 | db 1 ; ;an000;bgb;AN000; | ||
| 230 | db Blank ; ;an000;bgb;AN000; | ||
| 231 | db Sublist_Length ; ;an000;bgb;AN000; | ||
| 232 | db Reserved ; ;an000;bgb;AN000; | ||
| 233 | dw 0 ;Date will be entered ;an000;bgb;AN000; | ||
| 234 | dw 0 ; by PrintID routine ;an000;bgb;AN000; | ||
| 235 | db 2 ; ;an000;bgb;AN000; | ||
| 236 | db Left_Align+Date_MDY_4 ; ;an000;bgb;AN000; | ||
| 237 | db 10 ; ;an000;bgb;AN000; | ||
| 238 | db 1 ; ;an000;bgb;AN000; | ||
| 239 | db Blank ; ;an000;bgb;AN000; | ||
| 240 | db Sublist_Length ; ;an000;bgb;AN000; | ||
| 241 | db Reserved ; ;an000;bgb;AN000; | ||
| 242 | dw 0 ;Time will be entered ;an000;bgb;AN000; | ||
| 243 | dw 0 ; by PrintID routine ;an000;bgb;AN000; | ||
| 244 | db 3 ; ;an000;bgb;AN000; | ||
| 245 | db Left_Align+Time_HHMM_Cty; ;an000;bgb;AN000; | ||
| 246 | db 6 ; ;an000;bgb;AN000; | ||
| 247 | db 1 ; ;an000;bgb;AN000; | ||
| 248 | db Blank ; ;an000;bgb;AN000; | ||
| 249 | ;an000;bgb | ||
| 250 | ;--------------------------- ; ;an000;bgb | ||
| 251 | Sublist_Msg_File_Arg label dword ;an000;dms ;an000;bgb | ||
| 252 | ;an000;bgb | ||
| 253 | db Sublist_Length ; ;an000;bgb;AN000; | ||
| 254 | db Reserved ; ;an000;bgb;AN000; | ||
| 255 | dw dg:arg_buf ; ;an000;bgb;AN000; | ||
| 256 | dw dg ; ;an000;bgb;AN000; | ||
| 257 | db 1 ; ;an000;bgb;AN000; | ||
| 258 | db Left_Align+Char_Field_ASCIIZ ; ;an000;bgb ;AN000; | ||
| 259 | db 64 ; ;an000;bgb;AN000; | ||
| 260 | db 1 ; ;an000;bgb;AN000; | ||
| 261 | db Blank ; ;an000;bgb;AN000; | ||
| 262 | ;an000;bgb | ||
| 263 | ;--------------------------- ; ;an000;bgb | ||
| 264 | Sublist_Msg_Noisy label dword ;an000;dms ;an000;bgb | ||
| 265 | ;an000;bgb | ||
| 266 | db Sublist_Length ; ;an000;bgb;AN000; | ||
| 267 | db Reserved ; ;an000;bgb;AN000; | ||
| 268 | dw dg:arg_buf ; ;an000;bgb;AN000; | ||
| 269 | dw dg ; ;an000;bgb;AN000; | ||
| 270 | db 1 ; ;an000;bgb;AN000; | ||
| 271 | db Left_Align+Char_Field_ASCIIZ ; ;an000;bgb ;AN000; | ||
| 272 | db 64 ; ;an000;bgb;AN000; | ||
| 273 | db 1 ; ;an000;bgb;AN000; | ||
| 274 | db Blank ; ;an000;bgb;AN000; | ||
| 275 | ;an000;bgb | ||
| 276 | ;--------------------------- ; ;an000;bgb | ||
| 277 | Sublist_Msg_Orphmes label dword ;an000;dms ;an000;bgb | ||
| 278 | ;an000;bgb | ||
| 279 | db Sublist_Length ;0bh ;an000;bgb;AN000; | ||
| 280 | db Reserved ;00h ;an000;bgb;AN000; | ||
| 281 | dw dg:orphsiz ;offset of data ;an000;bgb;AN000;;an049;bgb | ||
| 282 | dw dg ;segment ;an000;bgb;AN000; | ||
| 283 | db 1 ;1st of 2 replaceable parms ;an000;bgb;AN000; | ||
| 284 | db Left_Align+Unsgn_Bin_Word ;only 64k clusters ;an000;bgb ;AN000; | ||
| 285 | db 05 ;max length ;an000;bgb;AN000;;an049;bgb | ||
| 286 | db 1 ;min length ;an000;bgb;AN000; | ||
| 287 | db Blank ;pad ;an000;bgb;AN000; | ||
| 288 | ;an000;bgb | ||
| 289 | db Sublist_Length ;0b ;an000;bgb;AN000; | ||
| 290 | db Reserved ;00 ;an000;bgb;AN000; | ||
| 291 | dw dg:orphcnt ;offset ;an000;bgb;AN000; | ||
| 292 | dw dg ;seg ;an000;bgb;AN000; | ||
| 293 | db 2 ;2nd replaceable parm ;an000;bgb;AN000; | ||
| 294 | db Left_Align+Unsgn_Bin_dword ;double word ;an000;bgb;AN000;;an049;bgb | ||
| 295 | db 10 ;max len ;an000;bgb;AN000;;an049;bgb | ||
| 296 | db 1 ;min len ;an000;bgb;AN000; | ||
| 297 | db Blank ;pad char ;an000;bgb;AN000; | ||
| 298 | ;--------------------------- ; ;an000;bgb | ||
| 299 | Sublist_Msg_Direcmes label dword ;an000;dms ;an000;bgb | ||
| 300 | ;an000;bgb | ||
| 301 | db Sublist_Length ; ;an000;bgb;AN000; | ||
| 302 | db Reserved ; ;an000;bgb;AN000; | ||
| 303 | dw dg:arg_buf ; ;an000;bgb;AN000; | ||
| 304 | dw dg ; ;an000;bgb;AN000; | ||
| 305 | db 1 ; ;an000;bgb;AN000; | ||
| 306 | db Left_Align+Char_Field_ASCIIZ ; ;an000;bgb;AN000; | ||
| 307 | db 64 ; ;an000;bgb;AN000; | ||
| 308 | db 1 ; ;an000;bgb;AN000; | ||
| 309 | db Blank ; ;an000;bgb;AN000; | ||
| 310 | ;an000;bgb | ||
| 311 | Sublist_Msg_Fatalmes label dword ;an000;dms ;an000;bgb | ||
| 312 | ;an000;bgb | ||
| 313 | db Sublist_Length ; ;an000;bgb;AN000; | ||
| 314 | db Reserved ; ;an000;bgb;AN000; | ||
| 315 | fatmsg1 dw dg:fatal_arg1 ; ;an000;bgb;AN024;bgb | ||
| 316 | dw dg ; ;an000;bgb;AN000; | ||
| 317 | db 1 ; ;an000;bgb;AN000; | ||
| 318 | db Left_Align+Char_Field_ASCIIZ ; ;an000;bgb ;AN000; | ||
| 319 | db 64 ; ;an000;bgb;AN000; | ||
| 320 | db 1 ; ;an000;bgb;AN000; | ||
| 321 | db Blank ; ;an000;bgb;AN000; | ||
| 322 | db Sublist_Length ; ;an000;bgb;AN000; | ||
| 323 | db Reserved ; ;an000;bgb;AN000; | ||
| 324 | fatmsg2 dw dg:fatal_arg2 ; ;an000;bgb;AN000; | ||
| 325 | dw dg ; ;an000;bgb;AN000; | ||
| 326 | db 2 ;number 2 of 2 subs ;an000;bgb;AN022;bgb | ||
| 327 | db Left_Align+Char_Field_ASCIIZ ; ;an000;bgb ;AN000; | ||
| 328 | db 64 ; ;an000;bgb;AN000; | ||
| 329 | db 1 ; ;an000;bgb;AN000; | ||
| 330 | db Blank ; ;an000;bgb;AN000; | ||
| 331 | ;--------------------------- ; ;an000;bgb | ||
| 332 | ifdef fsexec ;an038;bgb | ||
| 333 | Sublist_msg_EXECFailure label dword ; ;an038;bgb;an000;bgb | ||
| 334 | db Sublist_Length ; ;an038;bgb;an000;bgb;AN000; | ||
| 335 | db Reserved ; ;an038;bgb;an000;bgb;AN000; | ||
| 336 | dw dg:Drive_Letter_Msg ; ;an038;bgb;an000;bgb;AN000; | ||
| 337 | dw dg ; ;an038;bgb;an000;bgb;AN000; | ||
| 338 | db 1 ; ;an038;bgb;an000;bgb;AN000; | ||
| 339 | db Left_Align+Char_Field_ASCIIZ ; ;an038;bgb;an000;bgb ;AN000; | ||
| 340 | db 2 ; ;an038;bgb;an000;bgb;AN000; | ||
| 341 | db 2 ; ;an038;bgb;an000;bgb;AN000; | ||
| 342 | db Blank ; ;an038;bgb;an000;bgb;AN000; | ||
| 343 | endif ;an000;bgb | ||
| 344 | ;an000;bgb | ||
| 345 | ;--------------------------- ; ;an000;bgb | ||
| 346 | Sublist_msgSerialNumber label dword ; ;an000;bgb;an024;bgb | ||
| 347 | db Sublist_Length ;0b ;an000;bgb;an024;bgb | ||
| 348 | db Reserved ;00 ;an000;bgb;an024;bgb | ||
| 349 | dw offset word ptr sernum+2 ;data field ;an000;bgb;an024;bgb | ||
| 350 | dw data ; ;an000;bgb;an024;bgb | ||
| 351 | db 1 ;#1 of 2 ;an000;bgb;an024;bgb | ||
| 352 | db Right_Align+Bin_Hex_Word ;format ;an000;bgb;an024;bgb | ||
| 353 | db 4 ;min len ;an000;bgb;an024;bgb | ||
| 354 | db 4 ;max len ;an000;bgb;an024;bgb | ||
| 355 | db '0' ;Display leading 0's ;an000;bgb;an024;bgb | ||
| 356 | ;an000;bgb;an024;bgb | ||
| 357 | db Sublist_Length ;0b ;an000;bgb;an024;bgb | ||
| 358 | db Reserved ;00 ;an000;bgb;an024;bgb | ||
| 359 | dw offset sernum ;data field ;an000;bgb;an024;bgb | ||
| 360 | dw data ; ;an000;bgb;an024;bgb | ||
| 361 | db 2 ;#2 of 2 ;an000;bgb;an024;bgb | ||
| 362 | db Right_Align+Bin_hex_Word ;format ;an000;bgb;an024;bgb | ||
| 363 | db 4 ;min len ;an000;bgb;an024;bgb | ||
| 364 | db 4 ;max len ;an000;bgb;an024;bgb | ||
| 365 | db '0' ;pad char ;an000;bgb;an024;bgb | ||
| 366 | ;an000;bgb | ||
| 367 | ;--------------------------- ; ;an046;bgb | ||
| 368 | Sublist_msg_parserr label dword ; ;an046;bgb | ||
| 369 | ;an046;bgb | ||
| 370 | db Sublist_Length ;11 ;an046;bgb | ||
| 371 | db Reserved ;0 ;an046;bgb | ||
| 372 | public movsi | ||
| 373 | movsi dw dg:command_line_buffer ;off ;an046;bgb | ||
| 374 | dw dg ;seg ;an046;bgb | ||
| 375 | db 0 ;USE PERCENT ZERO ;an046;bgb | ||
| 376 | db Left_Align+Char_Field_ASCIIZ ;type of data ;an046;bgb | ||
| 377 | db 128 ;max width ;an046;bgb | ||
| 378 | db 1 ;min width ;an046;bgb | ||
| 379 | db Blank ;pad char ;an046;bgb | ||
| 380 | ;--------------------------- ; ;an046;bgb | ||
| 381 | ; ;an000;bgb | ||
| 382 | ;***************************************************************************** ;an000;bgb | ||
| 383 | ; Message Description Tables ;an000;bgb | ||
| 384 | ;***************************************************************************** ;an000;bgb | ||
| 385 | ; ;an000;bgb | ||
| 386 | ;an000;bgb | ||
| 387 | ;---------------------- ; ;an000;bgb | ||
| 388 | Message_Number = 1 ; AN000;SM ;an000;bgb | ||
| 389 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 390 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 391 | Count = None ; AN000;SM ;an000;bgb | ||
| 392 | Class = EXT_ERR_CLASS ; AN000;SM ;an000;bgb | ||
| 393 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 394 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 395 | Define_Msg badver ; AN000;SM Incorrect DOS version;an000;bgb | ||
| 396 | ;---------------------- ; ;an000;bgb | ||
| 397 | Message_Number = 19 ; AN000;SM ;an000;bgb | ||
| 398 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 399 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 400 | Count = N_A ; AN000;SM ;an000;bgb | ||
| 401 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 402 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 403 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 404 | Define_Msg badidbyt ; AN000;SM Probable non_DOS disk;an000;bgb (CRLF) Continue (Y/N)? | ||
| 405 | ;---------------------- ; ;an000;bgb | ||
| 406 | Message_Number = 3 ; AN000;SM ;an000;bgb | ||
| 407 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 408 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 409 | Count = N_A ; AN000;SM ;an000;bgb | ||
| 410 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 411 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 412 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 413 | Define_Msg freemes ; AN000;SM Convert lost chains t;an000;bgbo files (Y/N)? | ||
| 414 | ;---------------------- ; ;an000;bgb | ||
| 415 | Message_Number = 4 ; AN000;SM ;an000;bgb | ||
| 416 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 417 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 418 | Count = N_A ; AN000;SM ;an000;bgb | ||
| 419 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 420 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 421 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 422 | Define_Msg ptrandir ; AN000;SM Unrecoverable error i;an000;bgbn directory | ||
| 423 | ;---------------------- ; ;an000;bgb | ||
| 424 | Message_Number = 5 ; AN000;SM ;an000;bgb | ||
| 425 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 426 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 427 | Count = N_A ; AN000;SM ;an000;bgb | ||
| 428 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 429 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 430 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 431 | Define_Msg ptrandir2 ; AN000;SM Convert directory to ;an000;bgbfile (Y/N)? | ||
| 432 | ;---------------------- ; ;an000;bgb | ||
| 433 | Message_Number = 7 ; AN000;SM ;an000;bgb | ||
| 434 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 435 | Sublist = dg:Sublist_msg_dskspc ; AN000;SM ;an000;bgb | ||
| 436 | Count = 1 ; AN000;SM ;an000;bgb | ||
| 437 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 438 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 439 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 440 | Define_Msg dskspc ; AN000;SM %1 bytes total disk s;an000;bgbpace | ||
| 441 | ;---------------------- ; ;an000;bgb | ||
| 442 | Message_Number = 8 ; AN000;SM ;an000;bgb | ||
| 443 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 444 | Sublist = dg:Sublist_msg_badspc ; AN000;SM ;an000;bgb | ||
| 445 | Count = 1 ; AN000;SM ;an000;bgb | ||
| 446 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 447 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 448 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 449 | Define_Msg badspc ; AN000;SM %1 bytes in bad secto;an000;bgbrs | ||
| 450 | ;---------------------- ; ;an000;bgb | ||
| 451 | Message_Number = 9 ; AN000;SM ;an000;bgb | ||
| 452 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 453 | Sublist = dg:Sublist_msg_hidmes ; AN000;SM ;an000;bgb | ||
| 454 | Count = 2 ; AN000;SM ;an000;bgb | ||
| 455 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 456 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 457 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 458 | Define_Msg hidmes ; AN000;SM %1 bytes in %2 hidden;an000;bgb files | ||
| 459 | ;---------------------- ; ;an000;bgb | ||
| 460 | Message_Number = 10 ; AN000;SM ;an000;bgb | ||
| 461 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 462 | Sublist = dg:Sublist_msg_dirmes ; AN000;SM ;an000;bgb | ||
| 463 | Count = 2 ; AN000;SM ;an000;bgb | ||
| 464 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 465 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 466 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 467 | Define_Msg dirmes ; AN000;SM %1 bytes in %2 direct;an000;bgbories | ||
| 468 | ;---------------------- ; ;an000;bgb | ||
| 469 | Message_Number = 11 ; message number 11 ;an000;bgb | ||
| 470 | Handle = STDOUT ; crt ;an000;bgb | ||
| 471 | Sublist = dg:Sublist_msg_filemes ; location of sublist ;an000;bgb | ||
| 472 | Count = 2 ; caontains 2 parameters ;an000;bgb | ||
| 473 | Class = UTILITY_MSG_CLASS ; type of msg ;an000;bgb | ||
| 474 | Function = NO_INPUT ; no input from user ;an000;bgb | ||
| 475 | Input = N_A ; not applicable ;an000;bgb | ||
| 476 | Define_Msg filemes ; AN000;SM %1 bytes in %2 user f;an000;bgbiles | ||
| 477 | ;---------------------- ; ;an000;bgb | ||
| 478 | Message_Number = 12 ; AN000;SM ;an000;bgb | ||
| 479 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 480 | Sublist = dg:Sublist_msg_orphmes2 ; AN000;SM ;an000;bgb | ||
| 481 | Count = 2 ; AN000;SM ;an000;bgb | ||
| 482 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 483 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 484 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 485 | Define_Msg orphmes2 ; AN000;SM %1 bytes in %2 recove;an000;bgbred files | ||
| 486 | ;---------------------- ; ;an000;bgb | ||
| 487 | Message_Number = 13 ; AN000;SM ;an000;bgb | ||
| 488 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 489 | Sublist = dg:Sublist_msg_orphmes3 ; AN000;SM ;an000;bgb | ||
| 490 | Count = 2 ; AN000;SM ;an000;bgb | ||
| 491 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 492 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 493 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 494 | Define_Msg orphmes3 ; AN000;SM %1 bytes would be in ;an000;bgb%2 recovered files | ||
| 495 | ;---------------------- ; ;an000;bgb | ||
| 496 | Message_Number = 14 ; AN000;SM ;an000;bgb | ||
| 497 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 498 | Sublist = dg:Sublist_msg_frespc ; AN000;SM ;an000;bgb | ||
| 499 | Count = 1 ; AN000;SM ;an000;bgb | ||
| 500 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 501 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 502 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 503 | Define_Msg frespc ; AN000;SM %1 bytes available on;an000;bgb disk | ||
| 504 | ;---------------------- ; ;an000;bgb | ||
| 505 | Message_Number = 15 ; AN000;SM ;an000;bgb | ||
| 506 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 507 | Sublist = dg:Sublist_msg_totmem ; AN000;SM ;an000;bgb | ||
| 508 | Count = 1 ; AN000;SM ;an000;bgb | ||
| 509 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 510 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 511 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 512 | Define_Msg totmem ; AN000;SM %1 bytes total memory;an000;bgb | ||
| 513 | ;---------------------- ; ;an000;bgb | ||
| 514 | Message_Number = 16 ; AN000;SM ;an000;bgb | ||
| 515 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 516 | Sublist = dg:Sublist_msg_fremem ; AN000;SM ;an000;bgb | ||
| 517 | Count = 1 ; AN000;SM ;an000;bgb | ||
| 518 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 519 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 520 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 521 | Define_Msg fremem ; AN000;SM %1 bytes free ;an000;bgb | ||
| 522 | ;---------------------- ; ;an000;bgb | ||
| 523 | Message_Number = 17 ; AN000;SM ;an000;bgb | ||
| 524 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 525 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 526 | Count = None ; AN000;SM ;an000;bgb | ||
| 527 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 528 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 529 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 530 | Define_Msg no_net_arg ; AN000;SM Cannot CHKDSK a netwo;an000;bgbrk drive | ||
| 531 | ;---------------------- ; ;an000;bgb | ||
| 532 | Message_Number = 18 ; AN000;SM ;an000;bgb | ||
| 533 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 534 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 535 | Count = None ; AN000;SM ;an000;bgb | ||
| 536 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 537 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 538 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 539 | Define_Msg SubstErr ; AN000;SM Cannot CHKDSK a SUBST;an000;bgbed or ASSIGNed drive | ||
| 540 | ;---------------------- ; ;an000;bgb | ||
| 541 | Message_Number = 20 ; AN000;SM ;an000;bgb | ||
| 542 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 543 | Sublist = dg:Sublist_msg_badr_arg ; AN000;SM ;an000;bgb | ||
| 544 | Count = 2 ; AN000;SM ;an000;bgb | ||
| 545 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 546 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 547 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 548 | Define_Msg badr_arg ; AN000;SM Disk error reading FA;an000;bgbT %2 | ||
| 549 | ;---------------------- ; ;an000;bgb | ||
| 550 | Message_Number = 21 ; AN000;SM ;an000;bgb | ||
| 551 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 552 | Sublist = dg:Sublist_msg_direcmes ; AN000;SM ;an000;bgb | ||
| 553 | Count = 1 ; AN000;SM ;an000;bgb | ||
| 554 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 555 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 556 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 557 | Define_Msg direc_arg ; AN000;SM Directory %1 ;an000;bgb | ||
| 558 | ;---------------------- ; ;an000;bgb | ||
| 559 | Message_Number = 22 ; AN000;SM ;an000;bgb | ||
| 560 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 561 | Sublist = dg:Sublist_msg_extents ; AN000;SM ;an000;bgb | ||
| 562 | Count = 2 ; AN000;SM ;an000;bgb | ||
| 563 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 564 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 565 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 566 | Define_Msg extent_arg ; AN000;SM %1 Contains %2 non-co;an000;bgbntiguous blocks | ||
| 567 | ;---------------------- ; ;an000;bgb | ||
| 568 | Message_Number = 23 ; AN000;SM ;an000;bgb | ||
| 569 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 570 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 571 | Count = None ; AN000;SM ;an000;bgb | ||
| 572 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 573 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 574 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 575 | Define_Msg noext_arg ; AN000;SM All specified file(s);an000;bgb are contiguous | ||
| 576 | ;---------------------- ; ;an000;bgb | ||
| 577 | Message_Number = 24 ; AN000;SM ;an000;bgb | ||
| 578 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 579 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 580 | Count = None ; AN000;SM ;an000;bgb | ||
| 581 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 582 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 583 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 584 | Define_Msg fixmes_arg ; AN000;SM Errors found, F param;an000;bgbeter not specified (CRLF) | ||
| 585 | ;---------------------- ; Corrections will not ;an000;bgbbe written to disk | ||
| 586 | Message_Number = 25 ; AN000;SM ;an000;bgb | ||
| 587 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 588 | Sublist = dg:Sublist_msg_fatalmes ; AN000;SM ;an000;bgb | ||
| 589 | Count = 2 ; AN000;SM ;an000;bgb | ||
| 590 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 591 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 592 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 593 | Define_Msg fatal_arg ; AN000;SM Processing cannot con;an000;bgbtinue %1%2 | ||
| 594 | ;---------------------- ; ;an000;bgb | ||
| 595 | Message_Number = 26 ; AN000;SM ;an000;bgb | ||
| 596 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 597 | Sublist = dg:Sublist_msg_badrdmes ; AN000;SM ;an000;bgb | ||
| 598 | Count = 2 ; AN000;SM ;an000;bgb | ||
| 599 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 600 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 601 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 602 | Define_Msg badrdmes ; AN000;SM File allocation table;an000;bgb bad, drive %1 | ||
| 603 | ;---------------------- ; ;an000;bgb | ||
| 604 | Message_Number = 2 ; AN000;SM ;an000;bgb | ||
| 605 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 606 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 607 | Count = None ; AN000;SM ;an000;bgb | ||
| 608 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 609 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 610 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 611 | Define_Msg stackmes ; AN000;SM Insufficient memory ;an000;bgb | ||
| 612 | Define_Msg stackmes1 ; AN000;SM Cannot make directory;an000;bgb entry %1 (CRLF) | ||
| 613 | ;---------------------- ; Move files from root ;an000;bgbdirectory and repeat CHKDSK | ||
| 614 | Message_Number = 29 ; AN000;SM ;an000;bgb | ||
| 615 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 616 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 617 | Count = None ; AN000;SM ;an000;bgb | ||
| 618 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 619 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 620 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 621 | Define_Msg cdddmes ; AN000;SM CHDIR .. failed, tryi;an000;bgbng alternate method | ||
| 622 | ;---------------------- ; ;an000;bgb | ||
| 623 | Message_Number = 30 ; AN000;SM ;an000;bgb | ||
| 624 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 625 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 626 | Count = None ; AN000;SM ;an000;bgb | ||
| 627 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 628 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 629 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 630 | Define_Msg badchain ; AN000;SM Has invalid cluster, ;an000;bgbfile truncated | ||
| 631 | ;---------------------- ; ;an000;bgb | ||
| 632 | Message_Number = 31 ; AN000;SM ;an000;bgb | ||
| 633 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 634 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 635 | Count = None ; AN000;SM ;an000;bgb | ||
| 636 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 637 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 638 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 639 | Define_Msg badsubdir ; AN000;SM Invalid sub-directory;an000;bgb entry | ||
| 640 | ;---------------------- ; ;an000;bgb | ||
| 641 | Message_Number = 32 ; AN000;SM ;an000;bgb | ||
| 642 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 643 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 644 | Count = None ; AN000;SM ;an000;bgb | ||
| 645 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 646 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 647 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 648 | Define_Msg ndotmes ; AN000;SM Does not exist ;an000;bgb | ||
| 649 | ;---------------------- ; ;an000;bgb | ||
| 650 | Message_Number = 33 ; AN000;SM ;an000;bgb | ||
| 651 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 652 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 653 | Count = None ; AN000;SM ;an000;bgb | ||
| 654 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 655 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 656 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 657 | Define_Msg nulnz ; AN000;SM First cluster number ;an000;bgbis invalid, entry truncated | ||
| 658 | ;---------------------- ; ;an000;bgb | ||
| 659 | Message_Number = 34 ; AN000;SM ;an000;bgb | ||
| 660 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 661 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 662 | Count = None ; AN000;SM ;an000;bgb | ||
| 663 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 664 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 665 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 666 | Define_Msg badclus ; AN000;SM Allocation error, siz;an000;bgbe adjusted | ||
| 667 | ;---------------------- ; ;an000;bgb | ||
| 668 | Message_Number = 35 ; AN000;SM ;an000;bgb | ||
| 669 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 670 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 671 | Count = None ; AN000;SM ;an000;bgb | ||
| 672 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 673 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 674 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 675 | Define_Msg norecdot ; AN000;SM Cannot recover .. ent;an000;bgbry, processing continued | ||
| 676 | ;---------------------- ; ;an000;bgb | ||
| 677 | Message_Number = 36 ; AN000;SM ;an000;bgb | ||
| 678 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 679 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 680 | Count = None ; AN000;SM ;an000;bgb | ||
| 681 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 682 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 683 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 684 | Define_Msg nuldmes ; AN000;SM Directory is totally ;an000;bgbempty, no .. or .. | ||
| 685 | ;---------------------- ; ;an000;bgb | ||
| 686 | Message_Number = 37 ; AN000;SM ;an000;bgb | ||
| 687 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 688 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 689 | Count = None ; AN000;SM ;an000;bgb | ||
| 690 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 691 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 692 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 693 | Define_Msg joinmes ; AN000;SM Directory is joined ;an000;bgb | ||
| 694 | ;---------------------- ; ;an000;bgb | ||
| 695 | Message_Number = 38 ; AN000;SM ;an000;bgb | ||
| 696 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 697 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 698 | Count = None ; AN000;SM ;an000;bgb | ||
| 699 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 700 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 701 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 702 | Define_Msg norecddot ; AN000;SM Cannot recover .. ent;an000;bgbry | ||
| 703 | ;---------------------- ; ;an000;bgb | ||
| 704 | Message_Number = 39 ; AN000;SM ;an000;bgb | ||
| 705 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 706 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 707 | Count = None ; AN000;SM ;an000;bgb | ||
| 708 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 709 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 710 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 711 | Define_Msg norecddot1 ; AN000;SM Entry has a bad link ;an000;bgb | ||
| 712 | ;---------------------- ; ;an000;bgb | ||
| 713 | Message_Number = 40 ; AN000;SM ;an000;bgb | ||
| 714 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 715 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 716 | Count = None ; AN000;SM ;an000;bgb | ||
| 717 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 718 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 719 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 720 | Define_Msg norecddot2 ; AN000;SM Entry has a bad attri;an000;bgbbute | ||
| 721 | ;---------------------- ; ;an000;bgb | ||
| 722 | Message_Number = 41 ; AN000;SM ;an000;bgb | ||
| 723 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 724 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 725 | Count = None ; AN000;SM ;an000;bgb | ||
| 726 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 727 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 728 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 729 | Define_Msg norecddot3 ; AN000;SM Entry has a bad size ;an000;bgb | ||
| 730 | ;---------------------- ; ;an000;bgb | ||
| 731 | Message_Number = 42 ; AN000;SM ;an000;bgb | ||
| 732 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 733 | Sublist = dg:Sublist_msg_crossmes ; AN000;SM ;an000;bgb | ||
| 734 | Count = 1 ; AN000;SM ;an000;bgb | ||
| 735 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 736 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 737 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 738 | Define_Msg cross_arg ; AN000;SM Is cross linked on cl;an000;bgbuster %2 | ||
| 739 | ;---------------------- ; ;an000;bgb | ||
| 740 | Message_Number = 43 ; AN000;SM ;an000;bgb | ||
| 741 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 742 | Sublist = dg:Sublist_msg_badtarg ; AN000;SM ;an000;bgb | ||
| 743 | Count = 1 ; AN000;SM ;an000;bgb | ||
| 744 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 745 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 746 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 747 | Define_Msg badtarg_ptr ; AN000;SM Cannot CHDIR to %1, (;an000;bgbCRLF) | ||
| 748 | ;---------------------- ; tree past this point ;an000;bgbnot processed | ||
| 749 | Message_Number = 44 ; AN000;SM ;an000;bgb | ||
| 750 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 751 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 752 | Count = None ; AN000;SM ;an000;bgb | ||
| 753 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 754 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 755 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 756 | Define_Msg badtarg2 ; AN000;SM tree past this point ;an000;bgbnot processed | ||
| 757 | ;---------------------- ; ;an000;bgb | ||
| 758 | Message_Number = 45 ; AN000;SM ;an000;bgb | ||
| 759 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 760 | Sublist = dg:Sublist_msg_freebymes ; AN000;SM ;an000;bgb | ||
| 761 | Count = 1 ; AN000;SM ;an000;bgb | ||
| 762 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 763 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 764 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 765 | Define_Msg freeBymes1 ; AN000;SM %1 bytes disk space f;an000;bgbreed | ||
| 766 | ;---------------------- ; ;an000;bgb | ||
| 767 | Message_Number = 46 ; AN000;SM ;an000;bgb | ||
| 768 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 769 | Sublist = dg:Sublist_msg_freebymes ; AN000;SM ;an000;bgb | ||
| 770 | Count = 1 ; AN000;SM ;an000;bgb | ||
| 771 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 772 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 773 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 774 | Define_Msg freebymes2 ; AN000;SM %1 bytes disk space w;an000;bgbould be freed | ||
| 775 | ;---------------------- ; ;an000;bgb | ||
| 776 | Message_Number = 47 ; AN000;SM ;an000;bgb | ||
| 777 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 778 | Sublist = dg:Sublist_msg_idmes ; AN000;SM ;an000;bgb | ||
| 779 | Count = 3 ; AN000;SM ;an000;bgb | ||
| 780 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 781 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 782 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 783 | Define_Msg idmes_arg ; AN000;SM Volume %1 created %2 ;an000;bgb%3 | ||
| 784 | ;---------------------- ; ;an000;bgb | ||
| 785 | Message_Number = 48 ; AN000;SM ;an000;bgb | ||
| 786 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 787 | Sublist = dg:Sublist_msg_alloc ; AN000;SM ;an000;bgb | ||
| 788 | Count = 1 ; AN000;SM ;an000;bgb | ||
| 789 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 790 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 791 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 792 | Define_Msg idmes1 ; AN017;bgb %1 total allocation ;an000;bgbunits on disk | ||
| 793 | ;---------------------- ; ;an000;bgb | ||
| 794 | Message_Number = 49 ; AN000;SM ;an000;bgb | ||
| 795 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 796 | Sublist = dg:Sublist_msg_alloc ; AN000;SM ;an000;bgb | ||
| 797 | Count = 1 ; AN000;SM ;an000;bgb | ||
| 798 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 799 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 800 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 801 | Define_Msg idmes2 ; AN000;SM %1 bytes in each allo;an000;bgbcation unit | ||
| 802 | ;---------------------- ; ;an000;bgb | ||
| 803 | ifdef fsexec ;an038;bgb | ||
| 804 | Message_Number = 50 ; AN000;SM ;an038;bgb;an000;bgb | ||
| 805 | Handle = STDERR ; AN000;SM ;an038;bgb;an000;bgb | ||
| 806 | Sublist = dg:Sublist_msg_ExecFailure ; AN000;SM ;an038;bgb;an000;bgb | ||
| 807 | Count = 1 ; AN000;SM ;an038;bgb;an000;bgb | ||
| 808 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an038;bgb;an000;bgb | ||
| 809 | Function = NO_INPUT ; AN000;SM ;an038;bgb;an000;bgb | ||
| 810 | Input = N_A ; AN000;SM ;an038;bgb;an000;bgb | ||
| 811 | Define_Msg msgExecFailure ; AN000;SM CHKDSK not available ;an038;bgb;an000;bgbon drive %1 | ||
| 812 | endif ;an038;bgb | ||
| 813 | ;---------------------- ; ;an000;bgb | ||
| 814 | Message_Number = 51 ; AN000;SM ;an000;bgb | ||
| 815 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 816 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 817 | Count = None ; AN000;SM ;an000;bgb | ||
| 818 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 819 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 820 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 821 | Define_Msg Inv_XA_Msg ; AN000;SM Extended Attributes h;an000;bgbas invalid clusters, | ||
| 822 | ;---------------------- ; attributes truncated ;an000;bgb | ||
| 823 | Message_Number = 52 ; AN000;SM ;an000;bgb | ||
| 824 | Handle = STDOUT ; AN000;SM ;an000;bgb | ||
| 825 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 826 | Count = None ; AN000;SM ;an000;bgb | ||
| 827 | Class = UTILITY_MSG_CLASS ; AN000;SM ;an000;bgb | ||
| 828 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 829 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 830 | Define_Msg Alloc_XA_Msg ; AN000;SM Extended Attributes l;an000;bgbocation .. , | ||
| 831 | ;---------------------- ; attributes truncated ;an000;bgb | ||
| 832 | Message_Number = 53 ; AN000;SM ;an000;bgb | ||
| 833 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 834 | Sublist = dg:sublist_msg_parserr ; AN000;SM ;an046;bgb;an000;bgb | ||
| 835 | Count = 1 ; AN000;SM ;an046;bgb;an000;bgb | ||
| 836 | Class = PARSE_ERR_CLASS ; AN000;SM ;an000;bgb | ||
| 837 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 838 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 839 | Define_Msg badsw_arg ; AN000;SM Invalid parameter ;an000;bgb | ||
| 840 | ;---------------------- ; ;an000;bgb | ||
| 841 | Message_Number = 54 ; AN000;SM ;an000;bgb | ||
| 842 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 843 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 844 | Count = None ; AN000;SM ;an000;bgb | ||
| 845 | Class = utility_msg_class ; AN000;bgb ;an000;bgb | ||
| 846 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 847 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 848 | Define_Msg baddrv_arg ; AN000;SM Invalid drive specifi;an000;bgbcation | ||
| 849 | ;---------------------- ; ;an000;bgb | ||
| 850 | Message_Number = 55 ; AN000;SM ;an000;bgb | ||
| 851 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 852 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 853 | Count = None ; AN000;SM ;an000;bgb | ||
| 854 | Class = utility_msg_class ; AN017;bgb ;an000;bgb | ||
| 855 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 856 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 857 | Define_Msg invpath_arg ; AN000;SM Path not found ;an000;bgb | ||
| 858 | ;---------------------- ; ;an000;bgb | ||
| 859 | Message_Number = 56 ; AN000;SM ;an000;bgb | ||
| 860 | Handle = STDERR ; AN000;SM ;an000;bgb | ||
| 861 | Sublist = None ; AN000;SM ;an000;bgb | ||
| 862 | Count = None ; AN000;SM ;an000;bgb | ||
| 863 | Class = utility_msg_class ; AN017;bgb ;an000;bgb | ||
| 864 | Function = NO_INPUT ; AN000;SM ;an000;bgb | ||
| 865 | Input = N_A ; AN000;SM ;an000;bgb | ||
| 866 | Define_Msg opnerr_arg ; AN000;SM File not found ;an000;bgb | ||
| 867 | ;---------------------- ; ;an000;bgb | ||
| 868 | Message_Number = 0 ; ;an000;bgb;AN000; | ||
| 869 | Handle = STDERR ; ;an000;bgb;AN000; | ||
| 870 | Sublist = No_Replace ; ;AN;an000;bgb000; | ||
| 871 | Count = N_A ; ;an000;bgb;AN000; | ||
| 872 | Class = Ext_Err_Class ; ;an000;bgb;AN000; | ||
| 873 | Function = No_Function ; ;an000;bgb;AN000; | ||
| 874 | Input = N_A ; ;an000;bgb;AN000; | ||
| 875 | Define_Msg Extended_Error_Msg ; ;an000;bgb;AN000; | ||
| 876 | ;----------------------- ;an000;bgb | ||
| 877 | Message_Number = 0 ; ;an000;bgb | ||
| 878 | Handle = STDERR ; ;an000;bgb;AN000; | ||
| 879 | Sublist = dg:sublist_msg_parserr ; ;an046;bgbbgb000; | ||
| 880 | Count = 1 ; ;an046;bgb;AN000; | ||
| 881 | Class = Parse_Err_Class ; ;an000;bgb;AN000; | ||
| 882 | Function = No_Function ; ;an000;bgb;AN000; | ||
| 883 | Input = N_A ; ;an000;bgb;AN000; | ||
| 884 | Define_Msg Parse_Error_Msg ; ;an000;bgb;AN000; | ||
| 885 | ;----------------------- ;an000;bgb | ||
| 886 | Message_Number = 58 ; AN000;dms ;an000;bgb | ||
| 887 | Handle = STDERR ; AN000;dms ;an000;bgb | ||
| 888 | Sublist = dg:Sublist_msg_orphmes ; AN000;dms ;an000;bgb | ||
| 889 | Count = 2 ; AN000;dms ;an000;bgb | ||
| 890 | Class = UTILITY_MSG_CLASS ; AN000;dms ;an000;bgb | ||
| 891 | Function = NO_INPUT ; AN000;dms ;an000;bgb | ||
| 892 | Input = N_A ; AN000;dms ;an000;bgb | ||
| 893 | Define_Msg orph_arg ; AN000;dms "%1 lost clusters fo;an000;bgbund in %2 chains.",0 | ||
| 894 | ;---------------------- ; ;an000;bgb | ||
| 895 | Message_Number = 59 ; AN000;dms ;an000;bgb | ||
| 896 | Handle = STDout ; AN000;bgb ;an000;bgb | ||
| 897 | Sublist = none ; AN000;dms ;an000;bgb | ||
| 898 | Count = none ; AN000;dms ;an000;bgb | ||
| 899 | Class = UTILITY_MSG_CLASS ; AN000;dms ;an000;bgb | ||
| 900 | Function = NO_INPUT ; AN000;dms ;an000;bgb | ||
| 901 | Input = N_A ; AN000;dms ;an000;bgb | ||
| 902 | Define_Msg crlf_arg ; AN000;dms CR,LF ;an000;bgb | ||
| 903 | ;---------------------- ; ;an000;bgb | ||
| 904 | Message_Number = 60 ; AN000;dms ;an000;bgb | ||
| 905 | Handle = STDERR ; AN000;dms ;an000;bgb | ||
| 906 | Sublist = none ; AN000;dms ;an000;bgb | ||
| 907 | Count = none ; AN000;dms ;an000;bgb | ||
| 908 | Class = UTILITY_MSG_CLASS ; AN000;dms ;an000;bgb | ||
| 909 | Function = NO_INPUT ; AN000;dms ;an000;bgb | ||
| 910 | Input = N_A ; AN000;dms ;an000;bgb | ||
| 911 | Define_Msg badcd_arg ; AN000;dms "Cannot CHDIR to roo;an000;bgbt",cr,lf | ||
| 912 | ;---------------------- ; ;an000;bgb | ||
| 913 | Message_Number = 61 ; AN000;dms ;an000;bgb | ||
| 914 | Handle = STDERR ; AN000;dms ;an000;bgb | ||
| 915 | Sublist = dg:Sublist_Msg_Badw_arg ; AN000;dms ;an000;bgb | ||
| 916 | Count = 1 ; AN000;dms ;an000;bgb | ||
| 917 | Class = UTILITY_MSG_CLASS ; AN000;dms ;an000;bgb | ||
| 918 | Function = NO_INPUT ; AN000;dms ;an000;bgb | ||
| 919 | Input = N_A ; AN000;dms ;an000;bgb | ||
| 920 | Define_Msg badw_arg ; AN000;dms "Disk error writing ;an000;bgbFAT %1" | ||
| 921 | ;---------------------- ; ;an000;bgb | ||
| 922 | Message_Number = 62 ; AN000;dms ;an000;bgb | ||
| 923 | Handle = STDOUT ; AN000;dms ;an042;bgb;an000;bgb | ||
| 924 | Sublist = dg:Sublist_Msg_Noisy ; AN000;dms ;an000;bgb | ||
| 925 | Count = 1 ; AN000;dms ;an000;bgb | ||
| 926 | Class = UTILITY_MSG_CLASS ; AN000;dms ;an000;bgb | ||
| 927 | Function = NO_INPUT ; AN000;dms ;an000;bgb | ||
| 928 | Input = N_A ; AN000;dms ;an000;bgb | ||
| 929 | Define_Msg noisy_arg ; AN000;dms " %1" ;an000;bgb | ||
| 930 | ;---------------------- ; ;an000;bgb | ||
| 931 | Message_Number = 63 ; AN000;dms ;an000;bgb | ||
| 932 | Handle = STDERR ; AN000;dms ;an000;bgb | ||
| 933 | Sublist = none ; AN000;dms ;an000;bgb | ||
| 934 | Count = none ; AN000;dms ;an000;bgb | ||
| 935 | Class = UTILITY_MSG_CLASS ; AN000;dms ;an000;bgb | ||
| 936 | Function = NO_INPUT ; AN000;dms ;an000;bgb | ||
| 937 | Input = N_A ; AN000;dms ;an000;bgb | ||
| 938 | Define_Msg baddpbdir ; AN000;dms "Invalid current dir;an000;bgbectory" | ||
| 939 | ;---------------------- ; ;an000;bgb | ||
| 940 | Message_Number = 64 ; AN000;dms ;an000;bgb | ||
| 941 | Handle = STDERR ; AN000;dms ;an000;bgb | ||
| 942 | Sublist = dg:Sublist_Msg_File_Arg ; AN000;dms ;an000;bgb | ||
| 943 | Count = 1 ; AN000;dms ;an000;bgb | ||
| 944 | Class = UTILITY_MSG_CLASS ; AN000;dms ;an000;bgb | ||
| 945 | Function = NO_INPUT ; AN000;dms ;an000;bgb | ||
| 946 | Input = N_A ; AN000;dms ;an000;bgb | ||
| 947 | Define_Msg file_arg ; AN000;dms "%1",cr,lf ;an000;bgb | ||
| 948 | ;---------------------- ; ;an000;bgb | ||
| 949 | Message_Number = 65 ; AN000;dms ;an000;bgb | ||
| 950 | Handle = STDERR ; AN000;dms ;an000;bgb | ||
| 951 | Sublist = none ; AN000;dms ;an000;bgb | ||
| 952 | Count = none ; AN000;dms ;an000;bgb | ||
| 953 | Class = UTILITY_MSG_CLASS ; AN000;dms ;an000;bgb | ||
| 954 | Function = NO_INPUT ; AN000;dms ;an000;bgb | ||
| 955 | Input = N_A ; AN000;dms ;an000;bgb | ||
| 956 | Define_Msg creatmes ; AN000;dms "Insufficient room i;an000;bgbn root directory" | ||
| 957 | ;---------------------- ; ;an000;bgb | ||
| 958 | Message_Number = 70 ; AN017;bgb ;an000;bgb | ||
| 959 | Handle = STDOUT ; AN017;bgb ;an000;bgb | ||
| 960 | Sublist = dg:Sublist_msg_alloc ; AN017;bgb ;an000;bgb | ||
| 961 | Count = 1 ; AN017;bgb ;an000;bgb | ||
| 962 | Class = UTILITY_MSG_CLASS ; AN017;bgb ;an000;bgb | ||
| 963 | Function = NO_INPUT ; AN017;bgb ;an000;bgb | ||
| 964 | Input = N_A ; AN017;bgb ;an000;bgb | ||
| 965 | Define_Msg idmes3 ; AN017;bgb %1 allocation units ;an000;bgbavailable on disk | ||
| 966 | ;---------------------- ; ;an000;bgb | ||
| 967 | Message_Number = 71 ; ;an000;bgb;an024;bgb | ||
| 968 | Handle = STDOUT ; ;an000;bgb;an024;bgb | ||
| 969 | Sublist = Sublist_msgSerialNumber ; ;an000;bgb;an024;bgb | ||
| 970 | Count = 2 ; ;an000;bgb;an024;bgb | ||
| 971 | Class = Utility_Msg_Class ; ;an000;bgb;an024;bgb | ||
| 972 | Function = No_Function ; ;an000;bgb;an024;bgb | ||
| 973 | Input = N_A ; ;an000;bgb;an024;bgb | ||
| 974 | Define_Msg msgSerialNumber ; ;an000;bgb;an024;bgb | ||
| 975 | ;---------------------- ; ;an000;bgb | ||
| 976 | Message_Number = 72 ; AN030;bgb ;an000;bgb | ||
| 977 | Handle = STDERR ; AN030;bgb ;an000;bgb | ||
| 978 | Sublist = None ; AN030;bgb ;an000;bgb | ||
| 979 | Count = None ; AN030;bgb ;an000;bgb | ||
| 980 | Class = utility_msg_class ; AN030;bgb ;an000;bgb | ||
| 981 | Function = NO_INPUT ; AN030;bgb ;an000;bgb | ||
| 982 | Input = N_A ; AN030;bgb ;an000;bgb | ||
| 983 | Define_Msg no_mem_arg ; AN030;bgb insufficient memory ;an000;bgb | ||
| 984 | ;---------------------- ; ;an000;bgb | ||
| 985 | Message_Number = 73 ; AN033;bgb ;an000;bgb | ||
| 986 | Handle = STDERR ; AN033;bgb ;an000;bgb | ||
| 987 | Sublist = None ; AN033;bgb ;an000;bgb | ||
| 988 | Count = None ; AN033;bgb ;an000;bgb | ||
| 989 | Class = utility_msg_class ; AN033;bgb ;an000;bgb | ||
| 990 | Function = NO_INPUT ; AN033;bgb ;an000;bgb | ||
| 991 | Input = N_A ; AN033;bgb ;an000;bgb | ||
| 992 | Define_Msg inval_media ; AN033;bgb invalid media type ;an000;bgb | ||
| 993 | ;---------------------- ; ;an000;bgb | ||
| 994 | Message_Number = 74 ; AN045;bgb ;an000;bgb | ||
| 995 | Handle = STDERR ; AN045;bgb ;an000;bgb | ||
| 996 | Sublist = None ; AN045;bgb ;an000;bgb | ||
| 997 | Count = None ; AN045;bgb ;an000;bgb | ||
| 998 | Class = utility_msg_class ; AN045;bgb ;an000;bgb | ||
| 999 | Function = NO_INPUT ; AN045;bgb ;an000;bgb | ||
| 1000 | Input = N_A ; AN045;bgb ;an000;bgb | ||
| 1001 | Define_Msg write_fault ; AN045;bgb write fault error ;an000;bgb | ||
| 1002 | ;an000;bgb | ||
| 1003 | ;an000;bgb | ||
| 1004 | ; ;an000;bgb | ||
| 1005 | ;***************************************************************************** ;an000;bgb | ||
| 1006 | ; Message Data Area ;an000;bgb | ||
| 1007 | ;***************************************************************************** ;an000;bgb | ||
| 1008 | ; ;an000;bgb | ||
| 1009 | ;an000;bgb | ||
| 1010 | ;an000;bgb | ||
| 1011 | ; THE FOLLOWING ONE BYTE CHARACTERS ARE THE PROMPT ANSWERS. ;an000;bgb | ||
| 1012 | ; THEY MUST BE LOWER CASE, AND THE UPPER TO LOWER, OR LOWER ;an000;bgb | ||
| 1013 | ; TO LOWER CONVERSION MUST BE DOABLE BY "OR AL,20h". ;an000;bgb | ||
| 1014 | ; Yes/No Answers ;an000;bgb | ||
| 1015 | YES_BYTE DB "y" ;an000;bgb | ||
| 1016 | NO_BYTE DB "n" ;an000;bgb | ||
| 1017 | ;an000;bgb | ||
| 1018 | ;The following table is the list of abbreviated month names used to print ;an000;bgb | ||
| 1019 | ; out the volume ID. ;an000;bgb | ||
| 1020 | ; MUST BE THREE BYTES PER MONTH ;an000;bgb | ||
| 1021 | MONTAB DB "JanFebMarAprMayJunJulAugSepOctNovDec" ;an000;bgb | ||
| 1022 | ;an000;bgb | ||
| 1023 | ;an000;bgb | ||
| 1024 | yn_arg dw ? ;an000;bgb | ||
| 1025 | ;an000;bgb | ||
| 1026 | ;orph_num dw ? ;from orphsiz; = number of lost clusters ;an000;bgb;an049;bgb | ||
| 1027 | orphcnt dd ? ;number of chains of lost clusters ;an000;bgb | ||
| 1028 | ;an000;bgb | ||
| 1029 | report_arg dw ? ;an000;bgb | ||
| 1030 | rarg1 dd ? ;changed to dword ;an000;bgb;an049;bgb | ||
| 1031 | rarg3 dd ? ;changed to dword ;an000;bgb;an049;bgb | ||
| 1032 | ;an000;bgb | ||
| 1033 | baddrvm DB " A.",0 ;an000;bgb | ||
| 1034 | badrw_str dw ? ;an000;bgb | ||
| 1035 | badrw_num dw ? ;an000;bgb | ||
| 1036 | block_num dw ? ;an000;bgb | ||
| 1037 | fatal_arg1 dw ? ;an000;bgb | ||
| 1038 | fatal_arg2 dw ? ;an000;bgb | ||
| 1039 | file_arg1 dw ? ;an000;bgb | ||
| 1040 | file_arg2 dw ? ;an000;bgb | ||
| 1041 | free_arg1 dw ? ;an000;bgb | ||
| 1042 | free_arg2 dw ? ;an000;bgb | ||
| 1043 | free_arg3 dw ? ;an000;bgb | ||
| 1044 | fatal_end db ".",0 ;an000;bgb | ||
| 1045 | ;an000;bgb | ||
| 1046 | ;an000;bgb | ||
| 1047 | data ends ; AN000; ;an000;bgb | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKPARSE.INC b/v4.0/src/CMD/CHKDSK/CHKPARSE.INC new file mode 100644 index 0000000..ce76896 --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKPARSE.INC | |||
| @@ -0,0 +1,285 @@ | |||
| 1 | ;an000;bgb | ||
| 2 | ;an000;bgb | ||
| 3 | ;an000;bgb | ||
| 4 | ;an000;bgb | ||
| 5 | data segment public para 'DATA' ;an000;bgb ;AN000; | ||
| 6 | ;an000;bgb | ||
| 7 | ;an000;bgb | ||
| 8 | ; ;an000;bgb | ||
| 9 | ;***************************************************************************** ;an000;bgb | ||
| 10 | ; Publics ;an000;bgb | ||
| 11 | ;***************************************************************************** ;an000;bgb | ||
| 12 | ; ;an000;bgb | ||
| 13 | ;an000;bgb | ||
| 14 | ; Public Drive_Letter_Buffer ;an000;bgb | ||
| 15 | Public SwBuffer ;an000;bgb | ||
| 16 | Public Switch_F_Buffer ;an000;bgb | ||
| 17 | ; Public FileSpec_Buffer ;an000;bgb | ||
| 18 | public buffer ;an000;bgb | ||
| 19 | public sw_v, sw_f ;an000;bgb;an020;bgb | ||
| 20 | ;an000;bgb | ||
| 21 | ; ;an000;bgb | ||
| 22 | ;*************************************************************************** ;an000;bgb | ||
| 23 | ; Equates ;an000;bgb | ||
| 24 | ;*************************************************************************** ;an000;bgb | ||
| 25 | ; ;an000;bgb | ||
| 26 | ;an000;bgb | ||
| 27 | ;Match Flags ;an000;bgb | ||
| 28 | ;an000;bgb | ||
| 29 | Numeric_Value equ 8000h ; ;an000;bgb;AN000; | ||
| 30 | Signed_Numeric_Value equ 4000h ; ;an000;bgb;AN000; | ||
| 31 | Simple_String equ 2000h ; ;an000;bgb;AN000; | ||
| 32 | Date_String equ 1000h ; ;an000;bgb;AN000; | ||
| 33 | Time_String equ 0800h ; ;an000;bgb;AN000; | ||
| 34 | Complex_List equ 0400h ; ;an000;bgb;AN000; | ||
| 35 | Quoted_String equ 0080h ; ;an000;bgb;AN000; | ||
| 36 | Ignore_Colon equ 0010h ; ;an000;bgb;AN000; | ||
| 37 | Repeats_Allowed equ 0002h ; ;an000;bgb;AN000; | ||
| 38 | Optional equ 0001h ; ;an000;bgb;AN000; | ||
| 39 | Filespec equ 0200h ; ;an000;bgb;AN000; | ||
| 40 | Drive_Only equ 0100h ; ;an000;bgb;AN000; | ||
| 41 | ;an000;bgb | ||
| 42 | ;Function_Flags ;an000;bgb | ||
| 43 | ;an000;bgb | ||
| 44 | File_Table_Capitalize equ 1 ; ;an000;bgb;AN000; | ||
| 45 | Char_Table_Capitalize equ 2 ; ;an000;bgb;AN000; | ||
| 46 | Remove_Colon equ 10h ; ;an000;bgb;AN000; | ||
| 47 | ;an000;bgb | ||
| 48 | ;Extra delimeters and EOL ;an000;bgb | ||
| 49 | ;an000;bgb | ||
| 50 | Delimiters_Only equ 1 ; ;an000;bgb;AN000; | ||
| 51 | EOL_Or_Delimiters equ 2 ; ;an000;bgb;AN000; | ||
| 52 | ;an000;bgb | ||
| 53 | Semi_Colon equ ";" ; ;an000;bgb;AN000; | ||
| 54 | Tab equ 09h ; ;an000;bgb;AN000; | ||
| 55 | Colon equ ":" ; ;an000;bgb;AN000; | ||
| 56 | ;an000;bgb | ||
| 57 | ;an000;bgb | ||
| 58 | ;Parse Errors ;an000;bgb | ||
| 59 | ;an000;bgb | ||
| 60 | No_Error equ 0 ; ;an000;bgb;AN000; | ||
| 61 | Too_Many_Operands equ 1 ; ;an000;bgb;AN000; | ||
| 62 | Operand_Missing equ 2 ; ;an000;bgb;AN000; | ||
| 63 | Not_In_Switch_List equ 3 ; ;an000;bgb;AN000; | ||
| 64 | Not_In_Keyword_List equ 4 ; ;an000;bgb;AN000; | ||
| 65 | Out_Of_Range equ 6 ; ;an000;bgb;AN000; | ||
| 66 | Not_In_Value_List equ 7 ; ;an000;bgb;AN000; | ||
| 67 | Not_In_String_List equ 8 ; ;an000;bgb;AN000; | ||
| 68 | Syntax_Error equ 9 ; ;an000;bgb;AN000; | ||
| 69 | End_Of_Parse equ -1 ; ;an000;bgb;AN000; | ||
| 70 | ;an000;bgb | ||
| 71 | ;Return types ;an000;bgb | ||
| 72 | ;an000;bgb | ||
| 73 | Type_Reserved equ 0 ; ;an000;bgb;AN000; | ||
| 74 | Type_Number equ 1 ; ;an000;bgb;AN000; | ||
| 75 | Type_List_Index equ 2 ; ;an000;bgb;AN000; | ||
| 76 | Type_String equ 3 ; ;an000;bgb;AN000; | ||
| 77 | Type_Complex equ 4 ; ;an000;bgb;AN000; | ||
| 78 | Type_Filespec equ 5 ; ;an000;bgb;AN000; | ||
| 79 | Type_Drive equ 6 ; ;an000;bgb;AN000; | ||
| 80 | Type_Date equ 7 ; ;an000;bgb;AN000; | ||
| 81 | Type_Time equ 8 ; ;an000;bgb;AN000; | ||
| 82 | Type_Quoted_String equ 9 ; ;an000;bgb;AN000; | ||
| 83 | ;an000;bgb | ||
| 84 | ;Other ;an000;bgb | ||
| 85 | ;an000;bgb | ||
| 86 | None equ 0 ; ;an000;bgb;AN000; | ||
| 87 | No_Error equ 0 ; ;an000;bgb;AN000; | ||
| 88 | Switch_Found equ 0FFFFh ; ;an000;bgb;AN000; | ||
| 89 | Range_Ok equ 1 ; ;an000;bgb;AN000; | ||
| 90 | Command_Line_Parms equ 81h ; ;an000;bgb;AN000; | ||
| 91 | ;an000;bgb | ||
| 92 | ; ;an000;bgb | ||
| 93 | ;***************************************************************************** ;an000;bgb | ||
| 94 | ; Parse Structures ;an000;bgb | ||
| 95 | ;***************************************************************************** ;an000;bgb | ||
| 96 | ; ;an000;bgb | ||
| 97 | ;an000;bgb | ||
| 98 | Control struc ;an000;bgb | ||
| 99 | ;an000;bgb | ||
| 100 | Match_Flags dw ? ;an000;bgb | ||
| 101 | Function_Flags dw ? ;an000;bgb | ||
| 102 | Result dw ? ;an000;bgb | ||
| 103 | Values dw ? ;an000;bgb | ||
| 104 | Num_Keywords db ? ;an000;bgb | ||
| 105 | Keyword db ? ;an000;bgb | ||
| 106 | ;an000;bgb | ||
| 107 | Control ends ;an000;bgb | ||
| 108 | ;an000;bgb | ||
| 109 | ;Drive_Letter_Return struc ; ;an000;bgb ;AN000; | ||
| 110 | ;Drive_Type db 0 ; ;an000;bgb ;AN000; | ||
| 111 | ;Drive_Item_Tag db 0 ; ;an000;bgb ;AN000; | ||
| 112 | ;Drive_Pointer dw 0 ; ;an000;bgb ;AN000; | ||
| 113 | ;Drive_Number db 0 ;A=1, B=2, C=3 ;an000;bgb ;AN000; | ||
| 114 | ;Drive_debug db 8 dup(0) ;an000;bgb | ||
| 115 | ;Drive_Letter_Return ends ; ;an000;bgb ;AN000; | ||
| 116 | ; ;an000;bgb | ||
| 117 | ;Filespec_Return struc ;AN000;SM ;an000;bgb | ||
| 118 | ;Filespec_Type db 0 ;AN000;SM ;an000;bgb | ||
| 119 | ;FileSpec_Item db 0 ;AN000;SM ;an000;bgb | ||
| 120 | ;FileSpec_Pointer dw 0 ;AN000;SM ;an000;bgb | ||
| 121 | ;Filespec_String_Off dw 0 ;AN000;SM ;an000;bgb | ||
| 122 | ;FileSpec_String_Seg dw 0 ;an000;bgb | ||
| 123 | ;FileSpec_Return ends ;an000;bgb | ||
| 124 | ;an000;bgb | ||
| 125 | single_Return struc ;AN000;SM ;an000;bgb | ||
| 126 | dftype db 0 ;AN000;SM ;an000;bgb | ||
| 127 | Item db 0 ;AN000;SM ;an000;bgb | ||
| 128 | Pointer dw 0 ;AN000;SM ;an000;bgb | ||
| 129 | drnum_stroff dw 0 ;AN000;SM ;an000;bgb | ||
| 130 | return_strseg dw 0 ;an000;bgb | ||
| 131 | single_return ends ;an000;bgb | ||
| 132 | ;an000;bgb | ||
| 133 | ;an000;bgb | ||
| 134 | Switch_Return struc ; ;an000;bgb;AN000; | ||
| 135 | Switch_Type db 0 ; ;an000;bgb;AN000; | ||
| 136 | Switch_Item_Tag db 0 ; ;an000;bgb;AN000; | ||
| 137 | Switch_Pointer dw 0 ; ;an000;bgb;AN000; | ||
| 138 | Switch_Debug db 4 dup(0) ;an000;bgb | ||
| 139 | Switch_Return ends ; ;an000;bgb;AN000; | ||
| 140 | ;an000;bgb | ||
| 141 | Switch_Num_Return struc ; ;an000;bgb;AN000; | ||
| 142 | Switch_Num_Type db 0 ; ;an000;bgb ;AN000; | ||
| 143 | Switch_Num_Item_Tag db 0 ; ;an000;bgb ;AN000; | ||
| 144 | Switch_Num_Pointer dw 0 ; ;an000;bgb ;AN000; | ||
| 145 | Switch_Number_Low dw 0 ; ;AN0;an000;bgb00; | ||
| 146 | Switch_Number_High dw 0 ; ;AN0;an000;bgb00; | ||
| 147 | Switch_Num_Return ends ; ;an000;bgb;AN000; | ||
| 148 | ;an000;bgb | ||
| 149 | Switch_String_Return struc ; ;an000;bgb;AN000; | ||
| 150 | Switch_String_Type db 0 ; ;an000;bgb ;AN000; | ||
| 151 | Switch_String_Item_Tag db 0 ; ;an000;bgb ;AN000; | ||
| 152 | Switch_String_Pointer dw 0 ; ;an000;bgb ;AN000; | ||
| 153 | Switch_String_Off dw 0 ; ;an000;bgb;AN000; | ||
| 154 | Switch_String_Seg dw 0 ; ;an000;bgb;AN000; | ||
| 155 | Switch_String_Return ends ; ;an000;bgb;AN000; | ||
| 156 | ;an000;bgb | ||
| 157 | ;an000;bgb | ||
| 158 | ; ;an000;bgb | ||
| 159 | ;************************************************************************** ;an000;bgb | ||
| 160 | ; Parse tables ;an000;bgb | ||
| 161 | ;************************************************************************** ;an000;bgb | ||
| 162 | ; ;an000;bgb | ||
| 163 | Public input_Table ;an000;bgb | ||
| 164 | input_Table label byte ; ;AN000;;an000;bgb | ||
| 165 | ;an000;bgb | ||
| 166 | dw offset dg:ext_table ;Point to next level ;A;an000;bgbN000; | ||
| 167 | db Delimiters_Only ; ;an000;bgb;AN000; | ||
| 168 | db 1 ; ;an000;bgb;AN000; | ||
| 169 | db Semi_Colon ; ;an000;bgb;AN000; | ||
| 170 | ;an000;bgb | ||
| 171 | Drive_Table label byte ;an000;bgb;AN000; | ||
| 172 | ; ;an000;bgb | ||
| 173 | dw offset dg:Drive_Control_Definition ;Point to next level ;an000;bgb ;AN000; | ||
| 174 | db Delimiters_Only ; ;an000;bgb;AN000; | ||
| 175 | db 1 ; ;an000;bgb;AN000; | ||
| 176 | db Semi_Colon ; ;an000;bgb;AN000; | ||
| 177 | ;an000;bgb | ||
| 178 | ; ;an000;bgb | ||
| 179 | ;************************************************************************** ;an000;bgb | ||
| 180 | ;Define Positionals, Switches and Keywords ;an000;bgb | ||
| 181 | ;************************************************************************** ;an000;bgb | ||
| 182 | ; ;an000;bgb | ||
| 183 | ;an000;bgb | ||
| 184 | Public ext_table ;an000;bgb | ||
| 185 | ext_table label byte ; ;an000;bgb;AN000; | ||
| 186 | ; ;an000;bgb | ||
| 187 | db 0,1 ;up to one parm, either drive or file ;an000;bgb;an026;bgb | ||
| 188 | dw dg:dfcontrol ;Pointer to control table ;an000;bgb ;AN000; | ||
| 189 | db 1 ;1 switch def ;an000;bgb;AN020;bgb | ||
| 190 | dw dg:SwControl ;switch control block ;an000;bgb;AN020;bgb | ||
| 191 | db None ;No Keywords (maxk) ;an000;bgb;AN000; | ||
| 192 | ; ;an000;bgb | ||
| 193 | Drive_Control_Definition label byte ; ;an000;bgb;AN000; | ||
| 194 | ; ;an000;bgb | ||
| 195 | db 0,1 ;Only drive letter positional ;an000;bgb;AN000; | ||
| 196 | dw dg:dfControl ;Pointer to control table ;AN0;an000;bgb00; | ||
| 197 | db None ;0 switches ;an000;bgb;AN000; | ||
| 198 | db None ;No Keywords (maxk) ;an000;bgb;AN000; | ||
| 199 | ; ;an000;bgb | ||
| 200 | ;an000;bgb | ||
| 201 | ;an000;bgb | ||
| 202 | ; ;an000;bgb | ||
| 203 | ;************************************************************************** ;an000;bgb | ||
| 204 | ; Define Positionals, Switches and Keywords ;an000;bgb | ||
| 205 | ;************************************************************************** ;an000;bgb | ||
| 206 | ; ;an000;bgb | ||
| 207 | ;this is the new control block for both drive letters and filespecs ;an000;bgb | ||
| 208 | Public dfControl ;an000;bgb | ||
| 209 | dfControl label byte ; ;AN000;;an000;bgb | ||
| 210 | dw drive_only+FileSpec+Optional ; ;an000;bgb ;AN000; | ||
| 211 | dw None ; ;an000;bgb;AN000; | ||
| 212 | dw dg:Buffer ; ;AN000; ;an000;bgb | ||
| 213 | dw dg:No_Value ; ;an000;bgb;AN000; | ||
| 214 | db None ; ;an000;bgb;AN000; | ||
| 215 | ;an000;bgb | ||
| 216 | Public SwControl ;an02;an000;bgb0;bgb | ||
| 217 | SwControl label byte ; ;AN020;;an000;bgbbgb | ||
| 218 | dw None ; ;an000;bgb;AN000; | ||
| 219 | dw None ; ;an000;bgb;AN000; | ||
| 220 | dw dg:SwBuffer ; ;AN000;;an000;bgb | ||
| 221 | dw dg:No_Value ;an000;bgb ;AN000; | ||
| 222 | db 2 ; ;an000;bgb;AN020;bgb | ||
| 223 | sw_v db "/V",0 ; ;an000;bgb;AN020;bgb | ||
| 224 | sw_f db "/F",0 ; ;an000;bgb;AN020;bgb | ||
| 225 | ; ;an000;bgb | ||
| 226 | ;an000;bgb | ||
| 227 | ; ;an000;bgb | ||
| 228 | ;***************************************************************************** ;an000;bgb | ||
| 229 | ; Value lists ;an000;bgb | ||
| 230 | ;***************************************************************************** ;an000;bgb | ||
| 231 | ; ;an000;bgb | ||
| 232 | ;an000;bgb | ||
| 233 | No_Value db 0 ; ;an000;bgb;AN000; | ||
| 234 | ;an000;bgb | ||
| 235 | ;an000;bgb | ||
| 236 | ; ;an000;bgb | ||
| 237 | ;************************************************************************ ;an000;bgb | ||
| 238 | ; PARSE Return Buffers ;an000;bgb | ||
| 239 | ;************************************************************************ ;an000;bgb | ||
| 240 | ; ;an000;bgb | ||
| 241 | ; these buffers were replaced by a single buffer due to the parser bug ;an000;bgb | ||
| 242 | ;Drive_Letter_Buffer Drive_Letter_Return <> ;Example of structure ;an000;bgb ;AN000; | ||
| 243 | ;FileSpec_Buffer FileSpec_Return <> ; ;an000;bgb | ||
| 244 | SwBuffer Switch_Return <> ; ;an000;bgb;AN000; | ||
| 245 | Switch_F_Buffer Switch_Return <> ; ;an000;bgb;AN000; | ||
| 246 | buffer single_return <> ; new results buffer ;an000;bgb | ||
| 247 | data ends ; ;an000;bgb;AN000; | ||
| 248 | ;an000;bgb | ||
| 249 | ; ;an000;bgb | ||
| 250 | ;***************************************************************************** ;an000;bgb | ||
| 251 | ; SysParse Routines ;an000;bgb | ||
| 252 | ;***************************************************************************** ;an000;bgb | ||
| 253 | ; ;an000;bgb | ||
| 254 | ;an000;bgb | ||
| 255 | ;an000;bgb | ||
| 256 | code segment public para 'CODE' ;an000;bgb | ||
| 257 | ;an000;bgb | ||
| 258 | FarSW equ Not_Include ; ;an000;bgb;AN000; ;AN000; | ||
| 259 | DateSW equ Not_Include ; ;an000;bgb;AN000; | ||
| 260 | TimeSW equ Not_Include ; ;an000;bgb;AN000; | ||
| 261 | FileSW equ Do_Include ; ;an000;bgb;AN000; | ||
| 262 | CAPSW equ Not_Include ; ;an000;bgb;AN000; | ||
| 263 | CmpxSW equ Not_Include ; ;an000;bgb;AN000; | ||
| 264 | NumSW equ Not_Include ; ;an000;bgb;AN000; | ||
| 265 | KeySW equ Not_Include ; ;an000;bgb;AN000; | ||
| 266 | SwSW equ Do_Include ; ;an000;bgb;AN000; | ||
| 267 | Val1SW equ Not_Include ; ;an000;bgb;AN000; | ||
| 268 | Val2SW equ Not_Include ; ;an000;bgb;AN000; | ||
| 269 | Val3SW equ Not_Include ; ;an000;bgb;AN000; | ||
| 270 | DrvSW equ Do_Include ; ;an000;bgb;AN000; | ||
| 271 | QusSW equ Not_Include ; ;an000;bgb;AN000; | ||
| 272 | basesw equ 1 ;use ds as the default register ;an025;bgb | ||
| 273 | incsw equ 0 ;include psdata myself ;an028;bgb | ||
| 274 | code ends ;an028;bgb | ||
| 275 | |||
| 276 | |||
| 277 | data segment PUBLIC para 'DATA' ;an028;bgb | ||
| 278 | include psdata.inc ;an028;bgb | ||
| 279 | data ends ;an028;bgb | ||
| 280 | |||
| 281 | code segment PUBLIC para 'CODE' ;an028;bgb | ||
| 282 | pathlabl parser ;an028;bgb | ||
| 283 | INCLUDE PARSE.ASM ;AN000; ;an028;bgb | ||
| 284 | pathlabl parser ;an028;bgb | ||
| 285 | code ends ;an000;bgb | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKPRMT.ASM b/v4.0/src/CMD/CHKDSK/CHKPRMT.ASM new file mode 100644 index 0000000..48ec463 --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKPRMT.ASM | |||
| @@ -0,0 +1,93 @@ | |||
| 1 | TITLE CHKPRMT - Procedures called from chkdsk which prompt ;an000;bgb | ||
| 2 | page ,132 ; ;an000;bgb | ||
| 3 | ;an000;bgb | ||
| 4 | .xlist ;an000;bgb | ||
| 5 | include chkseg.inc ;an000;bgb | ||
| 6 | INCLUDE CHKCHNG.INC ;an000;bgb | ||
| 7 | INCLUDE SYSCALL.INC ;an000;bgb | ||
| 8 | INCLUDE CHKEQU.INC ;an000;bgb | ||
| 9 | INCLUDE CHKMACRO.INC ;an000;bgb | ||
| 10 | include pathmac.inc ;an000;bgb | ||
| 11 | .list ;an000;bgb | ||
| 12 | ;an000;bgb | ||
| 13 | ;an000;bgb | ||
| 14 | CONST SEGMENT PUBLIC PARA 'DATA' ;an000;bgb | ||
| 15 | EXTRN YES_BYTE:BYTE,NO_BYTE:BYTE ;an000;bgb | ||
| 16 | EXTRN YN_ARG:WORD ;an000;bgb | ||
| 17 | EXTRN HECODE:byte,CONBUF:byte ;an000;bgb | ||
| 18 | CONST ENDS ;an000;bgb | ||
| 19 | ;an000;bgb | ||
| 20 | ;an000;bgb | ||
| 21 | CODE SEGMENT PUBLIC PARA 'CODE' ;an000;bgb | ||
| 22 | ASSUME CS:DG,DS:DG,ES:DG,SS:DG ;an000;bgb | ||
| 23 | EXTRN PRINTF_CRLF:NEAR,DOCRLF:NEAR ;an000;bgb | ||
| 24 | ;an000;bgb | ||
| 25 | pathlabl chkprmt ;an000;bgb | ||
| 26 | ;***************************************************************************** ;an000;bgb | ||
| 27 | ;Routine name:PromptYN ;an000;bgb | ||
| 28 | ;***************************************************************************** ;an000;bgb | ||
| 29 | ; ;an000;bgb | ||
| 30 | ;description: Validate that input is valid Y/N for the country dependent info ;an000;bgb | ||
| 31 | ; Return Z flag if 'Y' entered ;an000;bgb | ||
| 32 | ;Called Procedures: Message (macro) ;an000;bgb | ||
| 33 | ; User_String ;an000;bgb | ||
| 34 | ; ;an000;bgb | ||
| 35 | ;Change History: Created 5/10/87 MT ;an000;bgb | ||
| 36 | ; ;an000;bgb | ||
| 37 | ;Input: DX = offset to message ;an000;bgb | ||
| 38 | ; ;an000;bgb | ||
| 39 | ;Output: Z flag if 'Y' entered ;an000;bgb | ||
| 40 | ; ;an000;bgb | ||
| 41 | ;Psuedocode ;an000;bgb | ||
| 42 | ;---------- ;an000;bgb | ||
| 43 | ; ;an000;bgb | ||
| 44 | ; DO ;an000;bgb | ||
| 45 | ; Display prompt and input character ;an000;bgb | ||
| 46 | ; IF got character ;an000;bgb | ||
| 47 | ; Check for country dependent Y/N (INT 21h, AX=6523h Get Ext Country;an000;bgb) | ||
| 48 | ; IF NC (Yes or No) ;an000;bgb | ||
| 49 | ; Set Z if Yes, NZ if No ;an000;bgb | ||
| 50 | ; ENDIF ;an000;bgb | ||
| 51 | ; ELSE (nothing entered) ;an000;bgb | ||
| 52 | ; stc ;an000;bgb | ||
| 53 | ; ENDIF ;an000;bgb | ||
| 54 | ; ENDDO NC ;an000;bgb | ||
| 55 | ; ret ;an000;bgb | ||
| 56 | ;***************************************************************************** ;an000;bgb | ||
| 57 | Procedure PromptYN ; ;an000;bgb;AN000; | ||
| 58 | push si ;Save reg ;an000;bgb | ||
| 59 | ; $DO ; ;an000;bgb;AC000; | ||
| 60 | $$DO1: | ||
| 61 | Call Display_Interface ;Display the message ;an000;bgb;AC000; | ||
| 62 | MOV DX,OFFSET DG:CONBUF ;Point at input buffer ;an000;bgb | ||
| 63 | DOS_Call Std_Con_String_Input ;Get input ;an000;bgb;AC000; | ||
| 64 | CALL DOCRLF ; ;an000;bgb | ||
| 65 | MOV SI,OFFSET DG:CONBUF+2 ;Point at contents of buffer ;an000;bgb | ||
| 66 | CMP BYTE PTR [SI-1],0 ;Was there input? ;an000;bgb | ||
| 67 | ; $IF NE ;Yep ;an000;bgb;AC000; | ||
| 68 | JE $$IF2 | ||
| 69 | mov al,23h ;See if it is Y/N ;an000;bgb;AN000; | ||
| 70 | mov dl,[si] ;Get character ;an000;bgb;AN000; | ||
| 71 | DOS_Call GetExtCntry ;Get country info call ;an000;bgb;AN000; | ||
| 72 | ; $IF NC ;Yes or No entered ;an000;bgb;AN000; | ||
| 73 | JC $$IF3 | ||
| 74 | cmp ax,Yes_Found ;Set Z if Yes, NZ if No ;an000;bgb;AN000; | ||
| 75 | clc ;CY=0 means Y/N found ;an000;bgb | ||
| 76 | ; $ENDIF ;CY set if neither ;an000;bgb;AN000; | ||
| 77 | $$IF3: | ||
| 78 | ; $ELSE ;No characters input ;an000;bgb | ||
| 79 | JMP SHORT $$EN2 | ||
| 80 | $$IF2: | ||
| 81 | stc ;CY means not Y/N ;an000;bgb | ||
| 82 | ; $ENDIF ; ;an000;bgb | ||
| 83 | $$EN2: | ||
| 84 | ; $ENDDO NC ; ;an000;bgb;AN000; | ||
| 85 | JC $$DO1 | ||
| 86 | pop si ; ;an000;bgb | ||
| 87 | ret ; ;an000;bgb | ||
| 88 | PromptYN endp ; ;an000;bgb;AN000; | ||
| 89 | pathlabl chkprmt ;an000;bgb | ||
| 90 | ;an000;bgb | ||
| 91 | CODE ENDS ;an000;bgb | ||
| 92 | END ;an000;bgb | ||
| 93 | \ No newline at end of file | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKPROC.ASM b/v4.0/src/CMD/CHKDSK/CHKPROC.ASM new file mode 100644 index 0000000..e76b78f --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKPROC.ASM | |||
| @@ -0,0 +1,1892 @@ | |||
| 1 | TITLE CHKPROC - PART1 Procedures called from chkdsk | ||
| 2 | page ,132 ; | ||
| 3 | |||
| 4 | .xlist | ||
| 5 | include chkseg.inc | ||
| 6 | INCLUDE CHKCHNG.INC | ||
| 7 | INCLUDE DOSSYM.INC | ||
| 8 | INCLUDE CHKEQU.INC | ||
| 9 | INCLUDE CHKMACRO.INC | ||
| 10 | include pathmac.inc | ||
| 11 | .list | ||
| 12 | |||
| 13 | |||
| 14 | DATA SEGMENT PUBLIC PARA 'DATA' | ||
| 15 | EXTRN FIXMES_ARG:word,DIREC_ARG:word | ||
| 16 | EXTRN NULDMES:byte,NULNZ:byte,BADCLUS:byte,NORECDOT:byte | ||
| 17 | EXTRN NoRecDDot:Byte | ||
| 18 | EXTRN BADCHAIN:byte,NDOTMES:byte,CDDDMES:byte | ||
| 19 | EXTRN NORECDDOT1:byte,NORECDDOT2:byte,NORECDDOT3:byte | ||
| 20 | EXTRN STACKMES:byte | ||
| 21 | EXTRN BADDPBDIR:byte, BadSubDir:byte | ||
| 22 | EXTRN BADTARG_PTR:byte,BADTARG2:byte,JOINMES:byte | ||
| 23 | EXTRN PTRANDIR:byte,PTRANDIR2:byte | ||
| 24 | EXTRN CROSS_ARG:word,NOISY_ARG:word | ||
| 25 | EXTRN FILE_ARG1:WORD,FILE_ARG2:WORD,FILE_ARG:word | ||
| 26 | EXTRN DOTMES:byte,NOISY:byte,DOTENT:byte,HAVFIX:byte | ||
| 27 | EXTRN DOFIX:byte,DIRBUF:byte,PARSTR:byte,DDOTENT:byte | ||
| 28 | EXTRN NUL:byte,ERRSUB:word,SECONDPASS:byte,ALLFILE:byte | ||
| 29 | EXTRN HIDCNT:dword,HIDSIZ:word,FILCNT:dword,FILSIZ:word ;an049;bgb | ||
| 30 | EXTRN DIRCNT:dword ;an049;bgb | ||
| 31 | EXTRN DIRSIZ:word ;an049;bgb | ||
| 32 | EXTRN DIRTYFAT:byte, | ||
| 33 | EXTRN HECODE:byte | ||
| 34 | EXTRN ALLDRV:byte,FIXMFLG:byte,DIRCHAR:byte | ||
| 35 | EXTRN BIGFAT:byte,EOFVAL:word,BADVAL:word | ||
| 36 | Extrn fTrunc:BYTE ;ac048;bgb | ||
| 37 | Extrn dirsec:word ;ac048;bgb | ||
| 38 | |||
| 39 | EXTRN THISDPB:dword,DOTSNOGOOD:byte,NUL_ARG:byte,STACKLIM:word | ||
| 40 | EXTRN ZEROTRUNC:byte,NAMBUF:byte,SRFCBPT:word,FATMAP:word | ||
| 41 | EXTRN ISCROSS:byte,MCLUS:word,CSIZE:byte,SSIZE:word,fattbl:byte | ||
| 42 | EXTRN DSIZE:word,ARG1:word,ARG_BUF:byte,TMP_SPC:BYTE | ||
| 43 | EXTRN SECBUF:word | ||
| 44 | EXTRN Inv_XA_Msg:Byte,Alloc_XA_Msg:Byte | ||
| 45 | Extrn Data_Start_Low:Word,Data_Start_High:Word | ||
| 46 | EXTRN Read_Write_Relative:Byte | ||
| 47 | EXTRN MClus:Word,Chain_End:Word | ||
| 48 | |||
| 49 | XA_Buffer XAL <> ;XA buffer space to read in 1st sector ;AN000; | ||
| 50 | Head_Mark db 0 ;Flag for MarkMap ;AN000; | ||
| 51 | BClus dw 0 ;Bytes/Cluster | ||
| 52 | public cross_clus | ||
| 53 | Cross_Clus dw 0 ;Cluster crosslink occurred on | ||
| 54 | Cluster_Count dw 0 ; ;AN000; | ||
| 55 | First_Cluster dw 0 ; ;AN000; | ||
| 56 | Previous_Cluster dw 0 ; ;AN000; | ||
| 57 | XA_Pass db 0 ; ;AN000; | ||
| 58 | File_Size_High dw 0 ; ;AN000; | ||
| 59 | File_Size_Low dw 0 ; ;AN000; | ||
| 60 | Chain_Size_Low dw 0 ; ;AN000; | ||
| 61 | Chain_Size_High dw 0 ; ;AN000; | ||
| 62 | |||
| 63 | |||
| 64 | public Head_Mark | ||
| 65 | public BClus | ||
| 66 | public Cluster_Count | ||
| 67 | public First_Cluster | ||
| 68 | public Previous_Cluster | ||
| 69 | public XA_Pass | ||
| 70 | public File_Size_High | ||
| 71 | public File_Size_Low | ||
| 72 | public Chain_Size_Low | ||
| 73 | public Chain_Size_High | ||
| 74 | DATA ENDS | ||
| 75 | |||
| 76 | |||
| 77 | CODE SEGMENT PUBLIC PARA 'CODE' | ||
| 78 | ASSUME CS:DG,DS:DG,ES:DG,SS:DG | ||
| 79 | ;Structures used by DIRPROC | ||
| 80 | SRCHFCB STRUC | ||
| 81 | DB 44 DUP (?) | ||
| 82 | SRCHFCB ENDS | ||
| 83 | SFCBSIZ EQU SIZE SRCHFCB | ||
| 84 | EXTRN PRINTF_CRLF:NEAR,SUBERRP:NEAR,FCB_TO_ASCZ:NEAR | ||
| 85 | EXTRN FIGREC:NEAR,EPRINT:NEAR | ||
| 86 | EXTRN DOINT26:NEAR,PROMPTYN:NEAR | ||
| 87 | EXTRN DOTCOMBMES:NEAR,FATAL:NEAR,MARKMAP:NEAR,GETFILSIZ:NEAR | ||
| 88 | EXTRN SYSTIME:NEAR, Read_Disk:Near,DoCRLF:Near | ||
| 89 | extrn crosschk:near | ||
| 90 | extrn UNPACK:near, PACK:near | ||
| 91 | public DOTDOTHARDWAY, NODOT, DOEXTMES1, MESD1, CANTREC, DOTGOON, NODDOT | ||
| 92 | public DOEXTMES2, MESD2, NFIX, CANTREC2, NULLDIRERR, DOEXTMES3, DOTSBAD | ||
| 93 | public dotsbad2, DIRPROC, STACKISOK, NOPRINT, JOINERR | ||
| 94 | public NONULLDERr, DOTOK, DATTOK, DLINKOK, BADDSIZ, DSIZOK, CHKDOTDOT | ||
| 95 | public DOTDOTOK, DDATTOK, DDLINKOK, BADDDSIZ, DDSIZOK, ROOTDIR | ||
| 96 | public DODDH, DIRDONE, MOREDIR, FPROC1, NOPRINT2, HIDENFILE, NORMFILE, NEWDIR | ||
| 97 | public DPROC1, CONVDIR, DPROC2, CANTTARG, BogusDir, ASKCONV | ||
| 98 | public PRINTTRMES, CROSSLOOK, CHLP, CROSSLINK, CHAINDONE | ||
| 99 | public FIXENT2, RET20, FIXENT, GETENT, CLUSISOK | ||
| 100 | public SKIPLP, GOTCLUS, DOROOTDIR, RDRETRY, RDOK2, WANTROOT, CHECKNOFMES, ret14 | ||
| 101 | public CHECKERR, get_currdirERR, ok_pri_dir, get_thiselERR, ok_pri_el | ||
| 102 | public get_THISEL, get_THISEL2, get_currdir, GET_END, ERRLOOP, LPDONE | ||
| 103 | public CHECK_SPLICE, NT_SPLC, MarkFAT, Bad_Cluster, Check_Chain_Sizes | ||
| 104 | public print_filename ;ac048;bgb | ||
| 105 | public NOTROOT ;ac048;bgb | ||
| 106 | public FIXDOT ;ac048;bgb | ||
| 107 | |||
| 108 | |||
| 109 | pathlabl chkproc | ||
| 110 | SUBTTL DIRPROC -- Recursive directory processing | ||
| 111 | PAGE | ||
| 112 | ;************************************************************************** | ||
| 113 | ; DOTDOTHARDWAY - change dir to the previous directory using '..' | ||
| 114 | ; | ||
| 115 | ; called by - | ||
| 116 | ; | ||
| 117 | ; inputs - parse string '..' | ||
| 118 | ; | ||
| 119 | ; outputs - new default directory | ||
| 120 | ; | ||
| 121 | ;NOTE | ||
| 122 | ; On versions of DOS < 2.50 "cd .." would fail if there was no ".." | ||
| 123 | ; entry in the current directory. On versions >= 2.50 "cd .." | ||
| 124 | ; is handled as a string manipulation and therefore should always | ||
| 125 | ; work. On < 2.50 this routine didddled the current directory string | ||
| 126 | ; INSIDE THE DOS DATA STRUCTURES. This is no longer desirable, or | ||
| 127 | ; needed. | ||
| 128 | ;************************************************************************** | ||
| 129 | procedure dotdothardway,near | ||
| 130 | MOV DX,OFFSET DG:PARSTR | ||
| 131 | DOS_Call ChDir ; ;AC000; | ||
| 132 | RET | ||
| 133 | endproc dotdothardway | ||
| 134 | |||
| 135 | |||
| 136 | ;************************************************************************** ;ac048;bgb | ||
| 137 | ; NODOT - come here if there is no . entry in the first entry of the sub- ;ac048;bgb | ||
| 138 | ; directory. The . entry is a pointer to the subdirectory itself. ;ac048;bgb | ||
| 139 | ; The entry from the search first did not find it, and the subdir is ;ac048;bgb | ||
| 140 | ; not joined. So, try to put a new . entry into the first slot. ;ac048;bgb | ||
| 141 | ; ;ac048;bgb | ||
| 142 | ; called by - nonullderr ;ac048;bgb | ||
| 143 | ; ;ac048;bgb | ||
| 144 | ; inputs - SI - points to arg_buf, which is a filespec ;ac048;bgb | ||
| 145 | ; DI - points to tmp_spc, which is a filespec ;ac048;bgb | ||
| 146 | ; AX - return value from search first ;ac048;bgb | ||
| 147 | ; ;ac048;bgb | ||
| 148 | ; outputs - if the /f parm was entered, tries to replace the . entry ;ac048;bgb | ||
| 149 | ; AX - saves the return value from search first ;ac048;bgb | ||
| 150 | ; ;ac048;bgb | ||
| 151 | ; logic: 1. go display error messages. Different messages are displayed, ;ac048;bgb | ||
| 152 | ; depending on /f and /v parms. ;ac048;bgb | ||
| 153 | ; ;ac048;bgb | ||
| 154 | ; 2. go get the sector number and read it into ram ;ac048;bgb | ||
| 155 | ; ;ac048;bgb | ||
| 156 | ; 3. if the first entry is erased (begins with hex e5), then we can ;ac048;bgb | ||
| 157 | ; fill it with the corrected . entry. Otherwise, go to #6. ;ac048;bgb | ||
| 158 | ; ;ac048;bgb | ||
| 159 | ; 4. So, fill entry with all the dir fields - name, ext, attr, date, ;ac048;bgb | ||
| 160 | ; time, size, cluster #. ;ac048;bgb | ||
| 161 | ; ;ac048;bgb | ||
| 162 | ; 5. write it back to disk. ;ac048;bgb | ||
| 163 | ; ;ac048;bgb | ||
| 164 | ; 6. go check out the .. entry ;ac048;bgb | ||
| 165 | ;************************************************************************** ;ac048;bgb | ||
| 166 | NODOT: ;No . ;ac048;bgb | ||
| 167 | PUSH AX ;save the return value from search 1st ;ac048;bgb | ||
| 168 | ;display msgs ;;;;;;;;jnz doextmes1 ;ac048;bgb | ||
| 169 | CMP [NOISY],OFF ;was /v parm entered? ;ac048;bgb;AC000; | ||
| 170 | ; $IF Z ;display no /v msgs ;ac048;bgb | ||
| 171 | JNZ $$IF1 | ||
| 172 | call suberrp ;ac048;bgb | ||
| 173 | ;;;;;;;;jmp short mesd1 ;ac048;bgb | ||
| 174 | ; $ELSE ;display /v msgs ;ac048;bgb | ||
| 175 | JMP SHORT $$EN1 | ||
| 176 | $$IF1: | ||
| 177 | DOEXTMES1: mov si,offset dg:dotmes ;first find out where we are ;ac048;bgb | ||
| 178 | call get_currdirerr ;ac048;bgb | ||
| 179 | mov dx,offset dg:ndotmes ;print dir, dot, and 'not found' msg ;ac048;bgb | ||
| 180 | call eprint ;ac048;bgb | ||
| 181 | ; $ENDIF ;ac048;bgb | ||
| 182 | $$EN1: | ||
| 183 | ;ac048;bgb | ||
| 184 | ;go find the sector ;ac048;bgb | ||
| 185 | MESD1: XOR AX,AX ;set entry number to zero ;ac048;bgb | ||
| 186 | PUSH BX ;save ;ac048;bgb | ||
| 187 | PUSH BP ;save ;ac048;bgb | ||
| 188 | CALL GETENT ;get the sector number ;ac048;bgb | ||
| 189 | POP BP ;restore bp ;ac048;bgb | ||
| 190 | PUSH BP ;put it back ;ac048;bgb | ||
| 191 | CMP BYTE PTR [DI],0E5H ;is this 1st entry erased/open? ;ac048;bgb | ||
| 192 | ; $if nz ;ac048;bgb | ||
| 193 | JZ $$IF4 | ||
| 194 | ;cant fill . entry ;JNZ CANTREC ;ac048;bgb ;Nope | ||
| 195 | CANTREC: INC [DOTSNOGOOD] ;ac048;bgb | ||
| 196 | CMP [NOISY],OFF ; ;ac048;bgb ;AC000; | ||
| 197 | ; $if nz ;ac048;bgb | ||
| 198 | JZ $$IF5 | ||
| 199 | ;JZ DOTGOON ;ac048;bgb | ||
| 200 | MOV DX,OFFSET DG:NORECDOT ;ac048;bgb | ||
| 201 | CALL EPRINT ;ac048;bgb | ||
| 202 | ; $endif ;ac048;bgb | ||
| 203 | $$IF5: | ||
| 204 | jmp dotgoon ;ac048;bgb | ||
| 205 | ; $endif ;ac048;bgb | ||
| 206 | $$IF4: | ||
| 207 | |||
| 208 | ;get filename | ||
| 209 | fixdot: MOV SI,OFFSET DG:DOTENT ;point to valid . entry | ||
| 210 | MOV CX,11 ;move filename and ext | ||
| 211 | REP MOVSB ;Name | ||
| 212 | PUSH AX ;save disk number | ||
| 213 | ;move attr byte | ||
| 214 | MOV AL,ISDIR ;hex 10 | ||
| 215 | STOSB ;Attribute | ||
| 216 | ; Add in time for directory - BAS July 17/85 | ||
| 217 | ADD DI,10 | ||
| 218 | push dx ;save starting sector number ;ac048;bgb | ||
| 219 | CALL SYSTIME | ||
| 220 | STOSW ; Time | ||
| 221 | MOV AX,DX | ||
| 222 | STOSW ; Date | ||
| 223 | MOV AX,[BP+6] | ||
| 224 | STOSW ;Alloc # | ||
| 225 | XOR AX,AX | ||
| 226 | STOSW | ||
| 227 | STOSW ;Size | ||
| 228 | pop dx ;restore starting sector number ;ac048;bgbb | ||
| 229 | POP AX ; | ||
| 230 | ;write back to disk | ||
| 231 | MOV [HAVFIX],1 ;Have a fix | ||
| 232 | CMP [DOFIX],0 ; /f parm entered? | ||
| 233 | ; $if nz ;ac048;bgb | ||
| 234 | JZ $$IF8 | ||
| 235 | ;JZ DOTGOON ;ac048;bgbif not F | ||
| 236 | MOV CX,1 ;ac048;bgb | ||
| 237 | CALL DOINT26 ;ac048;bgb | ||
| 238 | ;JMP SHORT DOTGOON ;ac048;bgb | ||
| 239 | ; $endif ;ac048;bgb | ||
| 240 | $$IF8: | ||
| 241 | ;go check out .. entry | ||
| 242 | DOTGOON: POP BP | ||
| 243 | POP BX | ||
| 244 | POP AX | ||
| 245 | MOV SI,OFFSET DG:DIRBUF | ||
| 246 | JMP CHKDOTDOT ;Go look for .. | ||
| 247 | ;***************************************************************************** | ||
| 248 | |||
| 249 | |||
| 250 | |||
| 251 | |||
| 252 | NODDOT label far ;No .. | ||
| 253 | PUSH AX ;Return from SRCH | ||
| 254 | CMP [NOISY],OFF ; ;AC000; | ||
| 255 | JNZ DOEXTMES2 | ||
| 256 | CALL SUBERRP | ||
| 257 | JMP SHORT MESD2 | ||
| 258 | DOEXTMES2: | ||
| 259 | MOV SI,OFFSET DG:PARSTR | ||
| 260 | CALL get_currdirERR | ||
| 261 | MOV DX,OFFSET DG:NDOTMES | ||
| 262 | CALL EPRINT | ||
| 263 | |||
| 264 | MESD2: | ||
| 265 | MOV AX,1 | ||
| 266 | PUSH BX | ||
| 267 | PUSH BP | ||
| 268 | CALL GETENT | ||
| 269 | POP BP | ||
| 270 | PUSH BP | ||
| 271 | CMP BYTE PTR [DI],0E5H ;Place to put it? | ||
| 272 | JNZ CANTREC2 ;Nope | ||
| 273 | MOV SI,OFFSET DG:DDOTENT | ||
| 274 | MOV CX,11 | ||
| 275 | REP MOVSB ;Name | ||
| 276 | PUSH AX | ||
| 277 | MOV AL,ISDIR | ||
| 278 | STOSB ;Attribute | ||
| 279 | ADD DI,10 | ||
| 280 | ; | ||
| 281 | ; Add in time for directory - BAS July 17/85 | ||
| 282 | push dx ;save starting sector number ;ac048;bgb | ||
| 283 | CALL SYSTIME | ||
| 284 | STOSW ; Time | ||
| 285 | MOV AX,DX | ||
| 286 | STOSW ; Date | ||
| 287 | MOV AX,[BP+4] | ||
| 288 | STOSW ;Alloc # | ||
| 289 | XOR AX,AX | ||
| 290 | STOSW | ||
| 291 | STOSW ;Size | ||
| 292 | pop dx ;restore starting sector number ;ac048;bgbb | ||
| 293 | POP AX | ||
| 294 | MOV [HAVFIX],1 ;Got a fix | ||
| 295 | CMP [DOFIX],0 | ||
| 296 | JZ NFIX ;No fix if no F, carry clear | ||
| 297 | MOV CX,1 | ||
| 298 | CALL DOINT26 | ||
| 299 | NFIX: | ||
| 300 | restorereg <bp,bx,ax> ;ac048;bgb | ||
| 301 | MOV SI,OFFSET DG:DIRBUF | ||
| 302 | JMP far ptr ROOTDIR ;Process files | ||
| 303 | |||
| 304 | CANTREC2: | ||
| 305 | restorereg <bp,bx,ax> ;ac048;bgb | ||
| 306 | CMP [NOISY],OFF ; ;AC000; | ||
| 307 | JZ DOTSBAD2 | ||
| 308 | MOV DX,OFFSET DG:NORECDDOT | ||
| 309 | JMP DOTSBAD | ||
| 310 | |||
| 311 | NULLDIRERR label far ;dir is empty | ||
| 312 | CMP [NOISY],OFF ; ;AC000; | ||
| 313 | JNZ DOEXTMES3 | ||
| 314 | CALL SUBERRP | ||
| 315 | JMP SHORT DOTSBAD2 | ||
| 316 | DOEXTMES3: | ||
| 317 | MOV SI,OFFSET DG:NUL | ||
| 318 | CALL get_currdirERR | ||
| 319 | MOV DX,OFFSET DG:NULDMES | ||
| 320 | DOTSBAD: ;Can't recover | ||
| 321 | mov [file_arg2],offset dg:badtarg2 | ||
| 322 | inc byte ptr [nul_arg] | ||
| 323 | MOV fTrunc,TRUE | ||
| 324 | CALL EPRINT | ||
| 325 | dotsbad2: | ||
| 326 | CALL DOTDOTHARDWAY | ||
| 327 | INC [DOTSNOGOOD] | ||
| 328 | MOV SP,BP ;Pop local vars | ||
| 329 | POP BP ;Restore frame | ||
| 330 | RET 4 ;Pop args | ||
| 331 | |||
| 332 | |||
| 333 | |||
| 334 | |||
| 335 | PAGE | ||
| 336 | ;*************************************************************************** | ||
| 337 | ; DIRPROC - recursive tree walker | ||
| 338 | ; | ||
| 339 | ; called by - main-routine in chkdsk1.sal | ||
| 340 | ; | ||
| 341 | ; inputs - ax=0 | ||
| 342 | ; - two words of 0 on the stack | ||
| 343 | ; | ||
| 344 | ;Recursive tree walker | ||
| 345 | ;dirproc(self,parent) | ||
| 346 | ;**************************************************************************** | ||
| 347 | DIRPROC: | ||
| 348 | MOV [DOTSNOGOOD],0 ;Init to dots OK - set . or .. error flag to false | ||
| 349 | MOV [ERRSUB],0 ;No subdir errors yet | ||
| 350 | PUSH BP ;Save frame pointer - 0 | ||
| 351 | MOV BP,SP ;ffe2 - 2c = ffb6 | ||
| 352 | SUB SP,SFCBSIZ ;Only local var | ||
| 353 | |||
| 354 | ; are we at stack overflow ? | ||
| 355 | CMP SP,[STACKLIM] ; ffb6 vs. 5943 ;an005;bgb | ||
| 356 | ; $IF NA | ||
| 357 | JA $$IF10 | ||
| 358 | ;;;;;;;;JA STACKISOK | ||
| 359 | MOV BX,OFFSET DG:STACKMES ;Out of stack | ||
| 360 | JMP FATAL | ||
| 361 | ; $ENDIF | ||
| 362 | $$IF10: | ||
| 363 | |||
| 364 | STACKISOK: | ||
| 365 | ;print the files as they are found | ||
| 366 | CMP [NOISY],off ; off= 0 ;AC000; | ||
| 367 | ; $IF NZ ;if not noisy, dont print filenames | ||
| 368 | JZ $$IF12 | ||
| 369 | ;;;;;;;;JZ NOPRINT | ||
| 370 | CMP [SECONDPASS],False ; ;AC000; | ||
| 371 | ; $IF Z ;only print on the first pass | ||
| 372 | JNZ $$IF13 | ||
| 373 | ;;;;;;;;;;;;JNZ NOPRINT ;Don't do it again on second pass | ||
| 374 | MOV SI,OFFSET DG:NUL | ||
| 375 | CALL get_CURRDIR | ||
| 376 | mov dx,offset dg:DIREC_arg ;Tell user where we are | ||
| 377 | CALL PRINTf_crlf | ||
| 378 | ; $ENDIF | ||
| 379 | $$IF13: | ||
| 380 | ; $ENDIF | ||
| 381 | $$IF12: | ||
| 382 | |||
| 383 | ; initialize search fcb | ||
| 384 | NOPRINT: | ||
| 385 | MOV SI,OFFSET DG:ALLFILE ;extended fcb | ||
| 386 | MOV DI,SP | ||
| 387 | PUSH DI | ||
| 388 | MOV CX,SFCBSIZ ;move 44dec bytes | ||
| 389 | REP MOVSB ;from allfile (ds:si) to es:di | ||
| 390 | ; find this file | ||
| 391 | POP DX ; from push bp | ||
| 392 | MOV BX,DX ;BX points to SRCH FCB | ||
| 393 | DOS_Call Dir_Search_First ;search for any file ;AC000; | ||
| 394 | ; | ||
| 395 | CMP WORD PTR [BP+6],0 ;attribute byte- root will = zero | ||
| 396 | ; $if z | ||
| 397 | JNZ $$IF16 | ||
| 398 | jmp far ptr rootdir ;yes, we are at the root | ||
| 399 | ; $endif | ||
| 400 | $$IF16: | ||
| 401 | OR AL,AL ;check return code from search first | ||
| 402 | JZ NONULLDERR | ||
| 403 | CALL CHECK_SPLICE ; See if dir is spliced | ||
| 404 | ; $if c | ||
| 405 | JNC $$IF18 | ||
| 406 | ;;;;;;;;;;;;JC nulldirerr ; Not spliced, error | ||
| 407 | jmp nulldirerr | ||
| 408 | ; $endif | ||
| 409 | $$IF18: | ||
| 410 | JOINERR: | ||
| 411 | MOV SI,OFFSET DG:NUL | ||
| 412 | CALL get_currdir | ||
| 413 | mov fTrunc,TRUE | ||
| 414 | mov dx,offset dg:joinmes ; ;AC000; | ||
| 415 | call Printf_Crlf ; ;AC000; | ||
| 416 | mov dx,offset dg:badtarg2 ; ;AC000; | ||
| 417 | call Printf_CRLF ; ;AC000; | ||
| 418 | CALL DOTDOTHARDWAY | ||
| 419 | MOV SP,BP ;Pop local vars | ||
| 420 | POP BP ;Restore frame | ||
| 421 | RET 4 ;Pop args | ||
| 422 | |||
| 423 | |||
| 424 | |||
| 425 | NONULLDERR: | ||
| 426 | MOV SI,OFFSET DG:DIRBUF + DIRNAM | ||
| 427 | MOV DI,OFFSET DG:DOTENT | ||
| 428 | MOV CX,11 | ||
| 429 | REP CMPSB | ||
| 430 | JZ DOTOK ;Got a . as first entry | ||
| 431 | push ax ;save return code from search first ;an045;bgb | ||
| 432 | CALL CHECK_SPLICE ; See if dir is spliced | ||
| 433 | ; $IF C ;carry means no join on this dir ;an045;bgb | ||
| 434 | JNC $$IF20 | ||
| 435 | pop ax ;restore return code ;an045;bgb | ||
| 436 | jmp nodot ;goto no . entry code ;an045;bgb | ||
| 437 | ; $ELSE ;no carry means dir is joined ;an045;bgb | ||
| 438 | JMP SHORT $$EN20 | ||
| 439 | $$IF20: | ||
| 440 | pop ax ;restore return code ;an045;bgb | ||
| 441 | jmp joinerr ;goto join error code ;an045;bgb | ||
| 442 | ; $ENDIF ;no carry means dir is joined ;an045;bgb | ||
| 443 | $$EN20: | ||
| 444 | ;;;;;;;;JNC JOINERR ; spliced, stop ;an045;bgb | ||
| 445 | ;;;;;;;;JMP NODOT ;No . ;an045;bgb | ||
| 446 | |||
| 447 | DOTOK: | ||
| 448 | MOV SI,OFFSET DG:DIRBUF | ||
| 449 | MOV AL,[SI.DIRATT] | ||
| 450 | TEST AL,ISDIR | ||
| 451 | JNZ DATTOK | ||
| 452 | PUSH SI ;. not a dir? | ||
| 453 | MOV SI,OFFSET DG:DOTMES | ||
| 454 | ;MOV DX,OFFSET DG:BADATT | ||
| 455 | mov dx,offset dg:norecddot2 ; ;AN000; | ||
| 456 | CALL DOTCOMBMES | ||
| 457 | POP SI | ||
| 458 | OR [SI.DIRATT],ISDIR | ||
| 459 | CALL FIXENT ;Fix it | ||
| 460 | DATTOK: | ||
| 461 | MOV AX,[SI.DIRCLUS] | ||
| 462 | CMP AX,[BP+6] ;. link = MYSELF? | ||
| 463 | JZ DLINKOK | ||
| 464 | PUSH SI ;Link messed up | ||
| 465 | MOV SI,OFFSET DG:DOTMES | ||
| 466 | ;MOV DX,OFFSET DG:CLUSBAD | ||
| 467 | mov dx,offset dg:norecddot1 ; ;AN000; | ||
| 468 | CALL DOTCOMBMES | ||
| 469 | POP SI | ||
| 470 | MOV AX,[BP+6] | ||
| 471 | MOV [SI.DIRCLUS],AX | ||
| 472 | CALL FIXENT ;Fix it | ||
| 473 | DLINKOK: | ||
| 474 | MOV AX,WORD PTR [SI.DIRESIZ] | ||
| 475 | OR AX,AX | ||
| 476 | JNZ BADDSIZ | ||
| 477 | MOV AX,WORD PTR [SI.DIRESIZ+2] | ||
| 478 | OR AX,AX | ||
| 479 | JZ DSIZOK | ||
| 480 | BADDSIZ: ;Size should be zero | ||
| 481 | PUSH SI | ||
| 482 | MOV SI,OFFSET DG:DOTMES | ||
| 483 | ;MOV DX,OFFSET DG:BADSIZM | ||
| 484 | mov dx,offset dg:norecddot3 ; ;AN000; | ||
| 485 | CALL DOTCOMBMES | ||
| 486 | POP SI | ||
| 487 | XOR AX,AX | ||
| 488 | MOV WORD PTR [SI.DIRESIZ],AX | ||
| 489 | MOV WORD PTR [SI.DIRESIZ+2],AX | ||
| 490 | CALL FIXENT ;Fix it | ||
| 491 | DSIZOK: ;Get next (should be ..) | ||
| 492 | MOV DX,BX | ||
| 493 | DOS_Call Dir_Search_Next ; ;AC000; | ||
| 494 | CHKDOTDOT: ;Come here after . failure | ||
| 495 | OR AL,AL | ||
| 496 | JZ DOTDOTOK | ||
| 497 | JMP NODDOT ;No .. | ||
| 498 | DOTDOTOK: | ||
| 499 | MOV SI,OFFSET DG:DIRBUF + DIRNAM | ||
| 500 | MOV DI,OFFSET DG:DDOTENT | ||
| 501 | MOV CX,11 | ||
| 502 | REP CMPSB | ||
| 503 | ; $if nz | ||
| 504 | JZ $$IF23 | ||
| 505 | jmp noddot | ||
| 506 | ;;; ;;;;;;;;JNZ NODDOT ;No .. | ||
| 507 | ; $endif | ||
| 508 | $$IF23: | ||
| 509 | MOV SI,OFFSET DG:DIRBUF | ||
| 510 | MOV AL,[SI.DIRATT] | ||
| 511 | TEST AL,ISDIR | ||
| 512 | JNZ DDATTOK ;.. must be a dir | ||
| 513 | PUSH SI | ||
| 514 | MOV SI,OFFSET DG:PARSTR | ||
| 515 | ;MOV DX,OFFSET DG:BADATT | ||
| 516 | mov dx,offset dg:norecddot2 ; ;AN000; | ||
| 517 | CALL DOTCOMBMES | ||
| 518 | POP SI | ||
| 519 | OR [SI.DIRATT],ISDIR | ||
| 520 | CALL FIXENT ;Fix it | ||
| 521 | DDATTOK: | ||
| 522 | PUSH SI | ||
| 523 | MOV AX,[SI.DIRCLUS] | ||
| 524 | CMP AX,[BP+4] ;.. link must be PARENT | ||
| 525 | JZ DDLINKOK | ||
| 526 | MOV SI,OFFSET DG:PARSTR | ||
| 527 | ;MOV DX,OFFSET DG:CLUSBAD | ||
| 528 | mov dx,offset dg:norecddot1 ; ;AN000; | ||
| 529 | CALL DOTCOMBMES | ||
| 530 | POP SI | ||
| 531 | MOV AX,[BP+4] | ||
| 532 | MOV [SI.DIRCLUS],AX | ||
| 533 | CALL FIXENT ;Fix it | ||
| 534 | DDLINKOK: | ||
| 535 | MOV AX,WORD PTR [SI.DIRESIZ] | ||
| 536 | OR AX,AX | ||
| 537 | JNZ BADDDSIZ | ||
| 538 | MOV AX,WORD PTR [SI.DIRESIZ+2] | ||
| 539 | OR AX,AX | ||
| 540 | ; $if z | ||
| 541 | JNZ $$IF25 | ||
| 542 | jmp DDSIZOK | ||
| 543 | ; $endif | ||
| 544 | $$IF25: | ||
| 545 | BADDDSIZ: ;.. size should be 0 | ||
| 546 | PUSH SI | ||
| 547 | MOV SI,OFFSET DG:PARSTR | ||
| 548 | ;MOV DX,OFFSET DG:BADSIZM | ||
| 549 | mov dx,offset dg:norecddot3 ; ;AN000; | ||
| 550 | CALL DOTCOMBMES | ||
| 551 | POP SI | ||
| 552 | XOR AX,AX | ||
| 553 | MOV WORD PTR [SI.DIRESIZ],AX | ||
| 554 | MOV WORD PTR [SI.DIRESIZ+2],AX | ||
| 555 | CALL FIXENT ;Fix it | ||
| 556 | |||
| 557 | |||
| 558 | ;*************************************************************************** | ||
| 559 | ; DDSIZOK - search for the next file in this directory | ||
| 560 | ;*************************************************************************** | ||
| 561 | DDSIZOK label far | ||
| 562 | MOV DX,BX ;search for Next entry | ||
| 563 | DOS_Call Dir_Search_Next ;func=12 ;AC000; | ||
| 564 | |||
| 565 | ROOTDIR label far ;come here after search first .. failure also | ||
| 566 | OR AL,AL ; was a matching filename found? | ||
| 567 | JZ MOREDIR ;zero = yes ;More to go | ||
| 568 | CMP WORD PTR [BP+6],0 ;nz=no ;Am I the root? | ||
| 569 | JZ DIRDONE ;Yes, no chdir | ||
| 570 | MOV DX,OFFSET DG:PARSTR | ||
| 571 | DOS_Call ChDir ; ;AC000; | ||
| 572 | JNC DIRDONE ;Worked | ||
| 573 | |||
| 574 | ; NOTE************************************************ | ||
| 575 | ; On DOS >= 2.50 "cd .." should ALWAYS work since it is | ||
| 576 | ; a string manipulation. Should NEVER get to here. | ||
| 577 | |||
| 578 | CMP [NOISY],OFF ; ;AC000; | ||
| 579 | JZ DODDH | ||
| 580 | MOV SI,OFFSET DG:NUL | ||
| 581 | CALL get_currdirERR | ||
| 582 | MOV DX,OFFSET DG:CDDDMES | ||
| 583 | CALL EPRINT | ||
| 584 | DODDH: | ||
| 585 | CALL DOTDOTHARDWAY ;Try again | ||
| 586 | DIRDONE: | ||
| 587 | MOV SP,BP ;Pop local vars | ||
| 588 | POP BP ;Restore frame | ||
| 589 | RET 4 ;Pop args | ||
| 590 | |||
| 591 | |||
| 592 | |||
| 593 | ;***************************************************************** | ||
| 594 | ; found at least one file in this subdir! | ||
| 595 | ;***************************************************************** | ||
| 596 | MOREDIR: | ||
| 597 | MOV SI,OFFSET DG:DIRBUF ;point to where ext fcb of found file is | ||
| 598 | TEST [SI.DIRATT],ISDIR ;attr 010h = sub-directory | ||
| 599 | JNZ NEWDIR ;Is a new directory? | ||
| 600 | CMP [SECONDPASS],False ;no, same dir ;AC000; | ||
| 601 | JZ FPROC1 ;2nd pass here | ||
| 602 | CALL CROSSLOOK ;Check for cross links | ||
| 603 | JMP DDSIZOK ;Next | ||
| 604 | |||
| 605 | FPROC1: | ||
| 606 | CMP [NOISY],OFF ; ;AC000; | ||
| 607 | ; $IF NZ ;print filenames? | ||
| 608 | JZ $$IF27 | ||
| 609 | call print_filename | ||
| 610 | ; $ENDIF | ||
| 611 | $$IF27: | ||
| 612 | NOPRINT2: | ||
| 613 | mov Cluster_Count,0 ;No clusters for vol label ;AN000; | ||
| 614 | mov cx,0 ;setup cx for 0 size vol labels ;an016;bgb | ||
| 615 | TEST [SI.DIRATT],VOLIDA ;attr=08 ;Don't chase chains on labels ;AC000; | ||
| 616 | ; $IF Z ;no, regular file | ||
| 617 | JNZ $$IF29 | ||
| 618 | MOV AL,81H ;Head of file | ||
| 619 | mov di,word ptr [si].DIRESIZ+0 ;Get file size | ||
| 620 | mov File_Size_Low,di ; | ||
| 621 | mov di,word ptr [si].DIRESIZ+2 ; | ||
| 622 | mov File_Size_High,di ; | ||
| 623 | mov di,[si].DirClus ;First cluster of file ;AN000; | ||
| 624 | CALL MARKFAT | ||
| 625 | MOV CX,Cluster_Count ;Get number of clusters | ||
| 626 | ;;;;;;;;;;;;PUSH CX ;Save them | ||
| 627 | ;;;;;;;;;;;;CALL Check_Extended_Attributes ;See if XA exist, and handle ;AN000; | ||
| 628 | ;;;;;;;;;;;;POP CX ;Get File length clusters | ||
| 629 | ;;;;;;;;;;;;ADD CX,Cluster_Count ;Add in XA clusters | ||
| 630 | TEST [SI.DIRATT],HIDDN ; | ||
| 631 | JZ NORMFILE ; | ||
| 632 | ; $ENDIF | ||
| 633 | $$IF29: | ||
| 634 | hidenfile: | ||
| 635 | add word ptr hidcnt,1 ;found another hidden file ;an049;bgb | ||
| 636 | adc word ptr hidcnt+2,0 ;add high word if > 64k files ;an049;bgb | ||
| 637 | add hidsiz,cx ;it was this many bytes ;an049;bgb | ||
| 638 | JMP ddsizok ;Next | ||
| 639 | NORMFILE: | ||
| 640 | add word ptr filcnt,1 ;inc file counter ;an049;bgb | ||
| 641 | adc word ptr filcnt+2,0 ;add high word if >64k files ;an049;bgb | ||
| 642 | add filsiz,cx ;add in size of file ;an049;bgb | ||
| 643 | JMP ddsizok ;Next | ||
| 644 | |||
| 645 | |||
| 646 | ;*************************************************************************** | ||
| 647 | ; NEWDIR - come here whenever you find another directory entry | ||
| 648 | ; inputs: SI - points to directory entry | ||
| 649 | ;*************************************************************************** | ||
| 650 | NEWDIR: | ||
| 651 | CMP [SECONDPASS],False ;are we on 2nd pass? ;AC000; | ||
| 652 | JZ DPROC1 ;zero means no - skip next part | ||
| 653 | CALL CROSSLOOK ;2nd pass - Check for cross links | ||
| 654 | JMP SHORT DPROC2 ;goto dproc2 | ||
| 655 | DPROC1: ;1st pass | ||
| 656 | MOV AL,82H ;Head of dir | ||
| 657 | mov di,[si].DirClus ;get 1st clus num from dir entry ;AN000; | ||
| 658 | mov File_Size_Low,0 ; ;Set to zero, shouldn't ;AN000; | ||
| 659 | mov File_Size_High,0 ; be looked at for dir ;AN000; | ||
| 660 | CALL MARKFAT | ||
| 661 | add word ptr dircnt,1 ;add 1 to the dir counter ;an047;bgb | ||
| 662 | adc word ptr dircnt+2,0 ;add 1 to the high word if carry ;an047;bgb | ||
| 663 | MOV CX,Cluster_Count ;Add count of clusters in files ;AN000; | ||
| 664 | CMP [ZEROTRUNC],0 ;did we modify the file size? ;an026;bgb | ||
| 665 | JZ DPROC2 ;Dir not truncated | ||
| 666 | CONVDIR: ;yes, dir size truncated | ||
| 667 | AND [SI.DIRATT],NOT ISDIR ;Turn into file | ||
| 668 | CALL FIXENT | ||
| 669 | POP BX ;Get my SRCH FCB pointer back | ||
| 670 | POP [ERRSUB] ;restore from prev dir | ||
| 671 | JMP ddsizok ;Next | ||
| 672 | DPROC2: | ||
| 673 | add dirsiz,cx ;add in siz of clusters ;an049;bgb | ||
| 674 | ; put 4 words on the stack - for next call to dirproc? | ||
| 675 | PUSH [ERRSUB] ;save the fcb ptr from prev dir | ||
| 676 | PUSH BX ;Save my srch FCB pointer | ||
| 677 | MOV AX,[SI].DirCLus ;get 1st cluster number | ||
| 678 | PUSH AX ; Give him his own first clus pointer | ||
| 679 | PUSH [BP+6] ; His PARENT is me | ||
| 680 | ;copy fcb name to msg string name | ||
| 681 | ADD SI,DIRNAM ;point to name, +08 | ||
| 682 | MOV DI,OFFSET DG:NAMBUF | ||
| 683 | savereg <di,ax> ;copy to msg string | ||
| 684 | CALL FCB_TO_ASCZ | ||
| 685 | restorereg <ax,di> | ||
| 686 | ;check out validity of dir | ||
| 687 | OR AX,AX ;does the 1st clus in dir point to zero? | ||
| 688 | JZ BogusDir ; no, it is bogus | ||
| 689 | mov dx,di | ||
| 690 | DOS_Call ChDir ; chdir to it ;AC000; | ||
| 691 | JC CANTTARG ; carry means bad dir | ||
| 692 | ; go check out new dir | ||
| 693 | CALL DIRPROC | ||
| 694 | POP BX ;Get my SRCH FCB pointer back | ||
| 695 | POP [ERRSUB] ;restore from prev dir | ||
| 696 | CMP [DOTSNOGOOD],0 | ||
| 697 | JNZ ASKCONV | ||
| 698 | JMP ddsizok ;Next | ||
| 699 | ;newdir error routines | ||
| 700 | CANTTARG: | ||
| 701 | ;cant chdir | ||
| 702 | ADD SP,8 ; Clean stack | ||
| 703 | mov SI,dx ; Pointer to bad DIR | ||
| 704 | CALL get_currdirERR | ||
| 705 | MOV DX,OFFSET DG:BADTarg_PTR | ||
| 706 | mov fTrunc,TRUE | ||
| 707 | call printf_crlf | ||
| 708 | JMP ddsizok ;Next | ||
| 709 | BogusDir: | ||
| 710 | ;bad dir entry | ||
| 711 | ADD SP,8 ; clean off stack | ||
| 712 | MOV SI,DX ; pointer to bad dir | ||
| 713 | CALL get_currdirERR ; output message with dir | ||
| 714 | MOV DX,OFFSET DG:BadSubDir ; real error message | ||
| 715 | CALL EPRINT ; to stderr... | ||
| 716 | ASKCONV: | ||
| 717 | CMP [SECONDPASS],False ; ;AC000; | ||
| 718 | ; $if nz | ||
| 719 | JZ $$IF31 | ||
| 720 | jmp ddsizok | ||
| 721 | ;;;;;;;;;;;;JNZ DDSIZOK ;Leave on second pass | ||
| 722 | ; $endif | ||
| 723 | $$IF31: | ||
| 724 | cmp [NOISY],on ; /v entered ? ;An027;bgb | ||
| 725 | ; $IF E ; no, skip next msg ;An027;bgb | ||
| 726 | JNE $$IF33 | ||
| 727 | MOV DX,OFFSET DG:PTRANDIR ;unrecoverable error in directory ;An027;bgb | ||
| 728 | call printf_crlf ;display msg ;An027;bgb | ||
| 729 | ; $ENDIF | ||
| 730 | $$IF33: | ||
| 731 | PRINTTRMES: | ||
| 732 | MOV DX,OFFSET DG:PTRANDIR2 ;either case - "convert dir to file?" ;An027;bgb | ||
| 733 | CALL PROMPTYN ;Ask user what to do | ||
| 734 | ; $if nz | ||
| 735 | JZ $$IF35 | ||
| 736 | jmp ddsizok | ||
| 737 | ;;;;;;;;;;; JNZ DDSIZOK ;Leave on second pass | ||
| 738 | ; $endif | ||
| 739 | $$IF35: | ||
| 740 | PUSH BP | ||
| 741 | PUSH BX | ||
| 742 | MOV AX,[BX+THISENT] ;Entry number | ||
| 743 | CALL GETENT ;Get the entry | ||
| 744 | MOV SI,DI | ||
| 745 | MOV DI,OFFSET DG:DIRBUF | ||
| 746 | PUSH DI | ||
| 747 | ADD DI,DIRNAM | ||
| 748 | MOV CX,32 | ||
| 749 | REP MOVSB ;Transfer entry to DIRBUF | ||
| 750 | POP SI | ||
| 751 | PUSH SI | ||
| 752 | MOV SI,[SI.DIRCLUS] ;First cluster | ||
| 753 | CALL GETFILSIZ | ||
| 754 | POP SI | ||
| 755 | POP BX | ||
| 756 | POP BP | ||
| 757 | MOV WORD PTR [SI.DIRESIZ],AX ;Fix entry | ||
| 758 | MOV WORD PTR [SI.DIRESIZ+2],DX | ||
| 759 | JMP CONVDIR ;convert directory | ||
| 760 | ;***************************************************************************** | ||
| 761 | ;end of newdir | ||
| 762 | ;***************************************************************************** | ||
| 763 | |||
| 764 | |||
| 765 | |||
| 766 | SUBTTL fat-Look routines | ||
| 767 | PAGE | ||
| 768 | ;***************************************************************************** | ||
| 769 | ; CROSSLOOK - look at the fat, check for cross linked files | ||
| 770 | ; called by - | ||
| 771 | ;**************************************************************************** | ||
| 772 | CROSSLOOK: | ||
| 773 | ;Same as MRKFAT only simpler for pass 2 | ||
| 774 | MOV [SRFCBPT],BX ;an014;bgb | ||
| 775 | MOV BX,SI ;an014;bgb | ||
| 776 | MOV SI,[BX.DIRCLUS] ;an014;bgb | ||
| 777 | CALL CROSSCHK ;an014;bgb | ||
| 778 | JNZ CROSSLINK ;an014;bgb | ||
| 779 | ;;;;;;;;mov XA_Pass,False ;an014;bgb ;an014;bgb | ||
| 780 | |||
| 781 | CHLP: | ||
| 782 | PUSH BX ;an014;bgb | ||
| 783 | CALL UNPACK ;an014;bgb | ||
| 784 | POP BX ;an014;bgb | ||
| 785 | XCHG SI,DI ;an014;bgb | ||
| 786 | CMP SI,[EOFVAL] ;an014;bgb | ||
| 787 | jae chaindone ;an014;bgb ;an014;bgb | ||
| 788 | ;;;;;;;;JAE Check_XA_Cross ;an014;bgb ;an014;bgb | ||
| 789 | CALL CROSSCHK ;an014;bgb | ||
| 790 | JZ CHLP ;an014;bgb | ||
| 791 | JMP SHORT CROSSLINK ;an014;bgb | ||
| 792 | ;an014;bgb | ||
| 793 | Check_XA_Cross: ; ;AN000; | ||
| 794 | |||
| 795 | ;;;;;;;;mov SI,[BX.DIR_XA] ;See if extended attribute ;an014;bgb ;AN000; | ||
| 796 | ;;;;;;;;cmp si,0 ;Is there? ;an014;bgb ;AN000; | ||
| 797 | ;;;;;;;;je ChainDoneJ ;No if zero ;an014;bgb ;AN000; | ||
| 798 | ; CALL CROSSCHK ;Yes, see if crosslinked ;an014;bgb ;AN000; | ||
| 799 | ; JNZ CROSSLINKJ ;NZ means yes ;an014;bgb ;AN000; | ||
| 800 | ;A_Cross_Loop: ; ;an014;bgb ;AN000; | ||
| 801 | ; PUSH BX ; ;an014;bgb ;AN000; | ||
| 802 | ; CALL UNPACK ;Get next cluster ;an014;bgb ;AN000; | ||
| 803 | ; POP BX ; ;an014;bgb ;AN000; | ||
| 804 | ; XCHG SI,DI ; ;an014;bgb ;AN000; | ||
| 805 | ; CMP SI,[EOFVAL] ;Reach the end? ;an014;bgb ;AN000; | ||
| 806 | ; JAE ChainDoneJ ;Leave if so ;an014;bgb ;AN000; | ||
| 807 | ; CALL CROSSCHK ;See if crosslink ;an014;bgb ;AN000; | ||
| 808 | ; JZ XA_Cross_Loop ;Go check next cluster if not ;AN000; | ||
| 809 | ; jmp CrossLink ;Go handle crosslink ;an014;bgb ;AN000; | ||
| 810 | ; | ||
| 811 | |||
| 812 | ;NOCLUSTERSJ: JMP NOCLUSTERS | ||
| 813 | |||
| 814 | |||
| 815 | CHASELOOP: ;an014;bgb | ||
| 816 | PUSH BX ;an014;bgb | ||
| 817 | CALL UNPACK ;an014;bgb | ||
| 818 | POP BX ;an014;bgb | ||
| 819 | INC CX ;an014;bgb | ||
| 820 | XCHG SI,DI ;an014;bgb | ||
| 821 | CMP SI,[EOFVAL] ;an014;bgb | ||
| 822 | JAE CHAINDONE ;an014;bgb | ||
| 823 | CMP SI,2 ;an014;bgb | ||
| 824 | JB MRKBAD ;an014;bgb | ||
| 825 | CMP SI,[MCLUS] ;an014;bgb | ||
| 826 | JBE MRKOK ;an014;bgb | ||
| 827 | MRKBAD: ;Bad cluster # in chain | ||
| 828 | PUSH CX ;an014;bgb | ||
| 829 | PUSH DI ;an014;bgb | ||
| 830 | CALL get_THISELERR ;an014;bgb | ||
| 831 | MOV DX,OFFSET dg:BADCHAIN ;an014;bgb | ||
| 832 | CALL EPRINT ;an014;bgb | ||
| 833 | POP SI ;an014;bgb | ||
| 834 | MOV DX,0FFFH ;Insert EOF ;an014;bgb | ||
| 835 | CMP [BIGFAT],0 ;an014;bgb | ||
| 836 | JZ FAT12_1 ;an014;bgb | ||
| 837 | MOV DX,0FFFFH ;an014;bgb | ||
| 838 | FAT12_1: ;an014;bgb ;an014;bgb ;an014;bgb | ||
| 839 | PUSH BX ;an014;bgb | ||
| 840 | CALL PACK ;an014;bgb | ||
| 841 | POP BX ;an014;bgb | ||
| 842 | POP CX ;an014;bgb | ||
| 843 | JMP SHORT CHAINDONE ;an014;bgb | ||
| 844 | |||
| 845 | MRKOK: | ||
| 846 | CALL MARKMAP ;an014;bgb | ||
| 847 | JZ CHASELOOP ;an014;bgb | ||
| 848 | Public CrossLink | ||
| 849 | CROSSLINK: ;File is cross linked | ||
| 850 | INC [ISCROSS] ;an014;bgb | ||
| 851 | CMP [SECONDPASS],False ; ;an014;bgb ;AC000; | ||
| 852 | JZ CHAINDONE ;Crosslinks only on second pass ;an014;bgb | ||
| 853 | mov [cross_clus],si ;Cluster number ;an014;bgb | ||
| 854 | CALL get_THISEL ;an014;bgb | ||
| 855 | Message File_Arg ;Print file out ;an014;bgb ;AN000; | ||
| 856 | MOV DX,OFFSET DG:CROSS_arg ;Print message out ;an014;bgb ;AC000; | ||
| 857 | CALL PRINTf_crlf ;an014;bgb | ||
| 858 | Public ChainDone | ||
| 859 | CHAINDONE: | ||
| 860 | TEST [BX.DIRATT],ISDIR | ||
| 861 | JNZ NOSIZE ;Don't size dirs | ||
| 862 | CMP [ISCROSS],0 | ||
| 863 | JNZ NOSIZE ;Don't size cross linked files;an014;bgb | ||
| 864 | CMP [SECONDPASS],False ; | ||
| 865 | JNZ NOSIZE ;Don't size on pass 2 (CX garbage) | ||
| 866 | MOV AL,[CSIZE] | ||
| 867 | XOR AH,AH | ||
| 868 | MUL [SSIZE] | ||
| 869 | PUSH AX ;Size in bytes of one alloc unit | ||
| 870 | MUL CX | ||
| 871 | MOV DI,DX ;Save allocation size | ||
| 872 | MOV SI,AX | ||
| 873 | SUB AX,WORD PTR [BX.DIRESIZ] | ||
| 874 | SBB DX,WORD PTR [BX.DIRESIZ+2] | ||
| 875 | JC BADFSIZ ;Size to big | ||
| 876 | OR DX,DX | ||
| 877 | JNZ BADFSIZ ;Size to small | ||
| 878 | POP DX | ||
| 879 | CMP AX,DX | ||
| 880 | JB NOSIZE ;Size within one Alloc unit | ||
| 881 | PUSH DX ;Size too small | ||
| 882 | PUBLIC BadFSiz | ||
| 883 | BADFSIZ: | ||
| 884 | POP DX | ||
| 885 | PUSH CX ;Save size of file | ||
| 886 | MOV WORD PTR [BX.DIRESIZ],SI | ||
| 887 | MOV WORD PTR [BX.DIRESIZ+2],DI | ||
| 888 | CALL FIXENT2 ;Fix it | ||
| 889 | CALL get_THISELERR | ||
| 890 | MOV DX,OFFSET DG:BADCLUS | ||
| 891 | CALL EPRINT | ||
| 892 | POP CX ;Restore size of file | ||
| 893 | NOSIZE: | ||
| 894 | MOV SI,BX | ||
| 895 | MOV BX,[SRFCBPT] | ||
| 896 | RET | ||
| 897 | |||
| 898 | NOCLUSTERS: | ||
| 899 | ;File is zero length | ||
| 900 | OR SI,SI | ||
| 901 | JZ CHKSIZ ;Firclus is OK, Check size | ||
| 902 | MOV DX,OFFSET DG:NULNZ | ||
| 903 | ADJUST: | ||
| 904 | PUSH DX | ||
| 905 | CALL get_THISELERR | ||
| 906 | POP DX | ||
| 907 | CALL EPRINT | ||
| 908 | XOR SI,SI | ||
| 909 | MOV [BX.DIRCLUS],SI ;Set it to 0 | ||
| 910 | MOV WORD PTR [BX.DIRESIZ],SI ;Set size too | ||
| 911 | MOV WORD PTR [BX.DIRESIZ+2],SI | ||
| 912 | CALL FIXENT2 ;Fix it | ||
| 913 | INC [ZEROTRUNC] ;Indicate truncation | ||
| 914 | JMP CHAINDONE | ||
| 915 | |||
| 916 | PUBLIC ChkSiz | ||
| 917 | CHKSIZ: | ||
| 918 | MOV DX,OFFSET DG:BADCLUS | ||
| 919 | CMP WORD PTR [BX.DIRESIZ],0 | ||
| 920 | JNZ ADJUST ;Size wrong | ||
| 921 | CMP WORD PTR [BX.DIRESIZ+2],0 | ||
| 922 | JNZ ADJUST ;Size wrong | ||
| 923 | JMP CHAINDONE ;Size OK | ||
| 924 | |||
| 925 | |||
| 926 | SUBTTL Routines for manipulating dir entries | ||
| 927 | PAGE | ||
| 928 | |||
| 929 | FIXENT2: | ||
| 930 | ;Same as FIXENT only [SRFCBPT] points to the search FCB, BX points to the entry | ||
| 931 | savereg <si,bx,cx> | ||
| 932 | MOV SI,BX | ||
| 933 | MOV BX,[SRFCBPT] | ||
| 934 | CALL FIXENT | ||
| 935 | restorereg <cx,bx,si> | ||
| 936 | RET20: RET | ||
| 937 | |||
| 938 | FIXENT: | ||
| 939 | ;BX Points to search FCB | ||
| 940 | ;SI Points to Entry to fix | ||
| 941 | MOV [HAVFIX],1 ;Indicate a fix | ||
| 942 | CMP [DOFIX],0 ;did the user enter /f flag? | ||
| 943 | JZ fixret ;zero means no - dont fix it | ||
| 944 | savereg <bp,bx,si,si> | ||
| 945 | MOV AX,[BX+THISENT] ;Entry number | ||
| 946 | CALL GETENT | ||
| 947 | POP SI ;Entry pointer | ||
| 948 | ADD SI,DIRNAM ;Point to start of entry | ||
| 949 | MOV CX,32 | ||
| 950 | REP MOVSB | ||
| 951 | INC CL | ||
| 952 | CALL DOINT26 | ||
| 953 | restorereg <si,bx,bp> | ||
| 954 | fixret: RET | ||
| 955 | |||
| 956 | |||
| 957 | |||
| 958 | ;***************************************************************************** ;ac048;bgb | ||
| 959 | ; GETENT - calculate, and read into ram, the sector of the directory entry ;ac048;bgb | ||
| 960 | ; that is invalid. This entry can be in either the root directory, ;ac048;bgb | ||
| 961 | ; or in a sub-directory. If it is in the root, it can be in the first ;ac048;bgb | ||
| 962 | ; sector of the root dir, or in a subsequent sector. If it is in a ;ac048;bgb | ||
| 963 | ; subdirectory, it can be in the first cluster of the subdir, or in ;ac048;bgb | ||
| 964 | ; any subsequent cluster. It can also be in the first sector of the ;ac048;bgb | ||
| 965 | ; cluster, or in any of the following sectors within that cluster. ;ac048;bgb | ||
| 966 | ; ;ac048;bgb | ||
| 967 | ; WARNING!! NOTE!! --> this procedure has a limit on the input value of 64k ;ac048;bgb | ||
| 968 | ; entries. If the disk fails on an entry in a subdir ;ac048;bgb | ||
| 969 | ; which has an invalid entry past this value, then the ;ac048;bgb | ||
| 970 | ; calling procedure will probably wrap on this word value, ;ac048;bgb | ||
| 971 | ; causing getent to calc the wrong sector, and then ;ac048;bgb | ||
| 972 | ; corrupting the disk. Not likely, but poss. ;ac048;bgb | ||
| 973 | ; ;ac048;bgb | ||
| 974 | ; called by - nodot/mesd1 - no . entry found (always subdir) ;ac048;bgb | ||
| 975 | ; - noddot/mesd2 - no .. entry found (always subdir) ;ac048;bgb | ||
| 976 | ; - askconv/printtrmes - convert dir to file (can be in root) ;ac048;bgb | ||
| 977 | ; - makfillp - find root entry in which to place lost clus ;ac048;bgb | ||
| 978 | ; ;ac048;bgb | ||
| 979 | ; inputs - AX - desired entry num (in curr dir, reffed off BP) ;ac048;bgb | ||
| 980 | ; 0=. 1=.. 2=first entry ;ac048;bgb | ||
| 981 | ; DX - number of lost clusters | ||
| 982 | ; BP - ptr to extended fcb for this dir ;ac048;bgb | ||
| 983 | ; BP+6 - 1st cluster number of this dir ;ac048;bgb | ||
| 984 | ; ;ac048;bgb | ||
| 985 | ; output - AX - contains number of the disk to use for int26 ;ac048;bgb | ||
| 986 | ; DI - points to entry in subdir in ram ;ac048;bgb | ||
| 987 | ; DX - low sector number of the dir ;ac048;bgb | ||
| 988 | ; BX - ram offset of the sector ;ac048;bgb | ||
| 989 | ; Read_Write_Relative.Start_Sector_Hi - hi sector number of the dir ;ac048;bgb | ||
| 990 | ; ;ac048;bgb | ||
| 991 | ; Regs abused - all of 'em !! (ok, well, maybe not bp...) ;ac048;bgb | ||
| 992 | ; ;ac048;bgb | ||
| 993 | ;logic: 1. make sure there will not be a problem with the cluster number. This ;ac048;bgb | ||
| 994 | ; should not be a problem, since if the cluster number is invalid, it ;ac048;bgb | ||
| 995 | ; should have been flagged by previous routines. ;ac048;bgb | ||
| 996 | ; ;ac048;bgb | ||
| 997 | ; 2. calc clus-num & offset ;ac048;bgb | ||
| 998 | ; Entries * bytes/entry / BPS --> number of sectors from the beg of ;ac048;bgb | ||
| 999 | ; the dir. There are 16 entries per sector (starting at zero). The ;ac048;bgb | ||
| 1000 | ; bytes/entry and bytes/sector are condensed, giving a div by 16, ;ac048;bgb | ||
| 1001 | ; instead of "* 32 / 512". Now we have the first cluster (0-fff7), ;ac048;bgb | ||
| 1002 | ; the sector-offset (0-fff), and the entry-offset (0-f). ;ac048;bgb | ||
| 1003 | ; ;ac048;bgb | ||
| 1004 | ; forumla: entry (0-ffff) / 16 = sector-offset (0-fff) ax ;ac048;bgb | ||
| 1005 | ; = entry-offset (0-f) dx ;ac048;bgb | ||
| 1006 | ; ;ac048;bgb | ||
| 1007 | ; 3. if we are in the root directory, then we have the correct sector ;ac048;bgb | ||
| 1008 | ; number, so just add it to the starting sector number of the ;ac048;bgb | ||
| 1009 | ; directory. ;ac048;bgb | ||
| 1010 | ; ;ac048;bgb | ||
| 1011 | ; 4. otherwise, we are in a subdirectory. Here, we need to get the ;ac048;bgb | ||
| 1012 | ; cluster-offset, since the sector-offset can be more than 1 cluster ;ac048;bgb | ||
| 1013 | ; in length. So, divide the sectors by (secs/clus) to get cluster- ;ac048;bgb | ||
| 1014 | ; offset. This value is now a power of 2, from 2 up to 16. ;ac048;bgb | ||
| 1015 | ; ;ac048;bgb | ||
| 1016 | ; / sectors/cluster (2-16) = cluster offset AL ;ac048;bgb | ||
| 1017 | ; = sector offset AH ;ac048;bgb | ||
| 1018 | ; ;ac048;bgb | ||
| 1019 | ; 5. If AL > 0, then we have to walk the fat chain to find the cluster ;ac048;bgb | ||
| 1020 | ; where this sector is. Fortunately, we have the starting cluster ;ac048;bgb | ||
| 1021 | ; number (BX), UNPACK will find the next cluster number, and we have ;ac048;bgb | ||
| 1022 | ; the number of clusters to jump (AL). So, move the appropriate ;ac048;bgb | ||
| 1023 | ; into the regs, and loop until completed. Now BX has the correct ;ac048;bgb | ||
| 1024 | ; cluster number. ;ac048;bgb | ||
| 1025 | ; ;ac048;bgb | ||
| 1026 | ; 6. Now we need to translate the cluster and sector numbers into an ;ac048;bgb | ||
| 1027 | ; absolute, double word, sector number. FIGREC will do this. ;ac048;bgb | ||
| 1028 | ; ;ac048;bgb | ||
| 1029 | ; 7. Now, from either root dir, or from subdir, we have the absolute ;ac048;bgb | ||
| 1030 | ; sector, so set up the regs, and call READ_DISK to read it into ram. ;ac048;bgb | ||
| 1031 | ; Now DX contains the sector number (low), and BX points to the ;ac048;bgb | ||
| 1032 | ; sector in ram. ;ac048;bgb | ||
| 1033 | ; ;ac048;bgb | ||
| 1034 | ; 8. Finally, get the entry-offset that we had stored on the stack, and ;ac048;bgb | ||
| 1035 | ; translate it into a byte-offset by multpying it times the number of ;ac048;bgb | ||
| 1036 | ; bytes per entry (32). Now DI points to the entry in ram. ;ac048;bgb | ||
| 1037 | ;***************************************************************************** ;ac048;bgb | ||
| 1038 | GETENT: ;ac048;bgb | ||
| 1039 | mov bx,[bp+6] ;Get 1st cluster of subdir ;ac048;bgb | ||
| 1040 | ;double check for invalid cluster ;ac048;bgb | ||
| 1041 | cmp bx,[eofval] ;Last entry in cluster? ;ac048;bgb | ||
| 1042 | ; $IF NB ;ac048;bgb | ||
| 1043 | JB $$IF37 | ||
| 1044 | mov bx,offset dg:baddpbdir ;This should never happen ;ac048;bgb | ||
| 1045 | jmp fatal ;Danger, warning Phil Robins;ac048;bgbon | ||
| 1046 | ; $ENDIF ;ac048;bgb | ||
| 1047 | $$IF37: | ||
| 1048 | ;ac048;bgb | ||
| 1049 | CLUSISOK: ;ac048;bgb | ||
| 1050 | ;calc cluster number and offset ;ac048;bgb | ||
| 1051 | mov cx,16 ;32 bytes/entry / 512 bytes/sec ;ac048;bgb | ||
| 1052 | xor dx,dx ;zero out hi word for divide ;ac048;bgb | ||
| 1053 | div cx ;NOW- bx=first clus, ax=sec-offset, dx=entry-offset ;ac048;bgb | ||
| 1054 | ;NOTE: ax can be > 1 cluster ;ac048;bgb | ||
| 1055 | ;are we at the root? ;ac048;bgb | ||
| 1056 | or bx,bx ;cluster zero? ;ac048;bgb | ||
| 1057 | ; $IF Z ;yes, then we are in root dir ;ac048;bgb | ||
| 1058 | JNZ $$IF39 | ||
| 1059 | ;;;;;;;;jz wantroot ;Cluster 0 means root dir ;ac048;bgb | ||
| 1060 | WANTROOT: push dx ;restored as di- ptr to invalid entry ;ac048;bgb | ||
| 1061 | mov dx,ax ;get sector offset ;ac048;bgb | ||
| 1062 | add dx,[dirsec] ;add in first sector of dir ;ac048;bgb | ||
| 1063 | mov Read_Write_Relative.Start_Sector_High,0 ;save hi value ;ac048;bgb | ||
| 1064 | ;;;;;;;;;;;JMP DOROOTDIR ;now ready for int25 ;ac048;bgb | ||
| 1065 | ;ac048;bgb | ||
| 1066 | ; $ELSE ;not in root dir ;ac048;bgb | ||
| 1067 | JMP SHORT $$EN39 | ||
| 1068 | $$IF39: | ||
| 1069 | NOTROOT: div csize ;divide by sectors/cluster (2-16) ;ac048;bgb | ||
| 1070 | ;AL=# cluster-offset (QUO), AH= sector-offset (REM);ac048;bgb | ||
| 1071 | mov cl,al ;get cluster offset from al ;ac048;bgb | ||
| 1072 | xor ch,ch ;zero out hi byte to make word value ;ac048;bgb | ||
| 1073 | or cx,cx ;do we have more than one cluster worth to go yet? ;ac048;bgb | ||
| 1074 | ; $IF NZ ;yes - we have to walk the chain to find it ;ac048;bgb | ||
| 1075 | JZ $$IF41 | ||
| 1076 | ;;;;;;;;JCXZ GOTCLUS ;jump if cx reg = zero ;ac048;bgb | ||
| 1077 | mov si,bx ;move the cluster num for input ;ac048;bgb | ||
| 1078 | SKIPLP: call unpack ;find the next cluster number ;ac048;bgb | ||
| 1079 | xchg si,di ;move it into input position ;ac048;bgb | ||
| 1080 | loop skiplp ;do for number of cluster-offset ;ac048;bgb | ||
| 1081 | mov bx,si ;now we have the cluster number ;ac048;bgb | ||
| 1082 | ; $ENDIF ;ac048;bgb | ||
| 1083 | $$IF41: | ||
| 1084 | ;ac048;bgb | ||
| 1085 | ;calculate the sector from the cluster & sec-offset ;ac048;bgb | ||
| 1086 | GOTCLUS: push dx ;restored as di -> entry offset ;ac048;bgb | ||
| 1087 | call figrec ;Convert to sector # - ax=low, dx=hi ;ac048;bgb | ||
| 1088 | ; $ENDIF ;are we in root dir? ;ac048;bgb | ||
| 1089 | $$EN39: | ||
| 1090 | ;ac048;bgb | ||
| 1091 | DOROOTDIR: ;ac048;bgb | ||
| 1092 | mov bx,[secbuf] ;get offset of ram area ;ac048;bgb | ||
| 1093 | mov al,[alldrv] ;get drive number ;ac048;bgb | ||
| 1094 | dec al ;adjust for int25 ;ac048;bgb | ||
| 1095 | RDRETRY: mov cx,1 ;read 1 sector ;ac048;bgb | ||
| 1096 | call Read_Disk ;do it ;ac048;bgb | ||
| 1097 | jnc rdok2 ;was it good? ;ac048;bgb | ||
| 1098 | ;Need to handle 'Fail' option of critical error here ;ac048;bgb | ||
| 1099 | JZ RDRETRY ;ac048;bgb | ||
| 1100 | ;ac048;bgb | ||
| 1101 | RDOK2: pop ax ;get byte-offset into sector ;ac048;bgb | ||
| 1102 | mov cl,5 ;value of 32= bytes per entry ;ac048;bgb | ||
| 1103 | shl ax,cl ;mul entry offset to get byte offset ;ac048;bgb | ||
| 1104 | add ax,bx ;add in offset of dir in ram ;ac048;bgb | ||
| 1105 | mov di,ax ;ac048;bgb | ||
| 1106 | mov al,[alldrv] ;get drive number ;ac048;bgb | ||
| 1107 | dec al ;adjust for int26 ;ac048;bgb | ||
| 1108 | RET ;di now points to offending entry ;ac048;bgb | ||
| 1109 | ;***************************************************************************** ;ac048;bgb | ||
| 1110 | |||
| 1111 | |||
| 1112 | |||
| 1113 | |||
| 1114 | CHECKNOFMES: | ||
| 1115 | MOV AL,1 | ||
| 1116 | XCHG AL,[FIXMFLG] | ||
| 1117 | OR AL,AL | ||
| 1118 | JNZ RET14 ;Don't print it more than once | ||
| 1119 | CMP [DOFIX],0 | ||
| 1120 | JNZ RET14 ;Don't print it if F switch specified | ||
| 1121 | mov dx,offset dg:FIXMES_arg | ||
| 1122 | CALL PRINTf_crlf | ||
| 1123 | call DoCRLF ; ;AN000; | ||
| 1124 | ret14: RET | ||
| 1125 | |||
| 1126 | CHECKERR: | ||
| 1127 | CALL CHECKNOFMES | ||
| 1128 | CMP [SECONDPASS],False ; ;AC000; | ||
| 1129 | RET | ||
| 1130 | |||
| 1131 | get_currdirERR: | ||
| 1132 | CALL CHECKERR | ||
| 1133 | jz ok_pri_dir | ||
| 1134 | mov byte ptr [arg_buf],0 | ||
| 1135 | ret | ||
| 1136 | ok_pri_dir: | ||
| 1137 | CALL get_currdir | ||
| 1138 | ret | ||
| 1139 | |||
| 1140 | get_thiselERR: | ||
| 1141 | CALL CHECKERR | ||
| 1142 | jz ok_pri_el | ||
| 1143 | mov byte ptr [arg_buf],0 | ||
| 1144 | ok_pri_el: | ||
| 1145 | CALL get_thisel | ||
| 1146 | RET | ||
| 1147 | |||
| 1148 | get_THISEL: | ||
| 1149 | MOV SI,BX | ||
| 1150 | ADD SI,DIRNAM | ||
| 1151 | ;***************************************************************************** | ||
| 1152 | ; called by: checkfiles | ||
| 1153 | ; inputs: AX - number of fragments | ||
| 1154 | ; SI | ||
| 1155 | ;***************************************************************************** | ||
| 1156 | get_THISEL2: | ||
| 1157 | MOV DI,OFFSET DG:NAMBUF | ||
| 1158 | PUSH DI | ||
| 1159 | CALL FCB_TO_ASCZ | ||
| 1160 | POP SI | ||
| 1161 | get_currdir: | ||
| 1162 | PUSH SI | ||
| 1163 | ; get drive letter prefix (c:\) | ||
| 1164 | mov di,offset dg:arg_buf | ||
| 1165 | MOV al,[ALLDRV] | ||
| 1166 | ADD al,'@' | ||
| 1167 | stosb | ||
| 1168 | MOV al,[DRVCHAR] | ||
| 1169 | stosb | ||
| 1170 | mov al,[DIRCHAR] | ||
| 1171 | stosb | ||
| 1172 | MOV SI,DI | ||
| 1173 | ; get the name of the current directory, and put it into es:di | ||
| 1174 | MOV DL,[ALLDRV] | ||
| 1175 | DOS_Call Current_Dir ; ;AC000; | ||
| 1176 | GET_END: | ||
| 1177 | ;find the end of the string - it will be hex zero | ||
| 1178 | LODSB | ||
| 1179 | OR AL,AL | ||
| 1180 | JNZ GET_END | ||
| 1181 | ; | ||
| 1182 | DEC SI ; Point at NUL | ||
| 1183 | MOV DI,SI | ||
| 1184 | POP SI ;point to begin of string | ||
| 1185 | CMP BYTE PTR [SI],0 | ||
| 1186 | JZ LPDONE ;If tail string NUL, no '/' | ||
| 1187 | ; move '\' for between path and filename | ||
| 1188 | MOV al,[DIRCHAR] | ||
| 1189 | CMP BYTE PTR [DI - 1],AL | ||
| 1190 | JZ ERRLOOP ; Don't double '/' if root | ||
| 1191 | stosb | ||
| 1192 | ERRLOOP: | ||
| 1193 | ; move filename from ds:si to es:di until find hex zero | ||
| 1194 | LODSB | ||
| 1195 | OR AL,AL | ||
| 1196 | JZ LPDONE | ||
| 1197 | stosb | ||
| 1198 | JMP ERRLOOP | ||
| 1199 | LPDONE: | ||
| 1200 | ; finish off string with hex zero for asciiz | ||
| 1201 | mov al,0 | ||
| 1202 | stosb | ||
| 1203 | RET | ||
| 1204 | |||
| 1205 | CHECK_SPLICE: | ||
| 1206 | ; Carry set if current directory is NOT spliced (joined) onto. | ||
| 1207 | ; Carry clear if current directory is spliced (joined) onto. | ||
| 1208 | |||
| 1209 | MOV SI,OFFSET DG:NUL | ||
| 1210 | CALL get_currdir ; Build ASCIZ text of current dir | ||
| 1211 | ; at arg_buf | ||
| 1212 | mov si,offset dg:arg_buf | ||
| 1213 | mov di,offset dg:TMP_SPC | ||
| 1214 | DOS_Call xNameTrans ; ;AC000; | ||
| 1215 | JC NT_SPLC ; Say NOT spliced if error | ||
| 1216 | CMP WORD PTR [TMP_SPC+1],"\" SHL 8 OR ":" | ||
| 1217 | JNZ NT_SPLC | ||
| 1218 | CMP BYTE PTR [TMP_SPC+3],0 | ||
| 1219 | JNZ NT_SPLC | ||
| 1220 | MOV AL,BYTE PTR [arg_buf] ; Source drive letter | ||
| 1221 | CMP AL,BYTE PTR [TMP_SPC] ; Different from dest if spliced | ||
| 1222 | JZ NT_SPLC ; Drive letter didn't change | ||
| 1223 | CLC | ||
| 1224 | RET | ||
| 1225 | |||
| 1226 | NT_SPLC: | ||
| 1227 | STC | ||
| 1228 | RET | ||
| 1229 | |||
| 1230 | |||
| 1231 | ;***************************************************************************** | ||
| 1232 | ;Routine name: MarkFAT | ||
| 1233 | ;***************************************************************************** | ||
| 1234 | ; | ||
| 1235 | ;Description: Trace the fat chain for a single file, marking entries in FATMap, | ||
| 1236 | ; and handling errors - | ||
| 1237 | ; (crosslink, truncation, allocation error, invalid cluster entry) | ||
| 1238 | ; | ||
| 1239 | ; called by : moredir | ||
| 1240 | ; newdir | ||
| 1241 | ; | ||
| 1242 | ;Called Procedures: Unpack | ||
| 1243 | ; Bad_Cluster | ||
| 1244 | ; MarkMap | ||
| 1245 | ; Check_Chain_Sizes | ||
| 1246 | ; ThisEl | ||
| 1247 | ; Eprint | ||
| 1248 | ; | ||
| 1249 | ;Change History: Created 5/10/87 MT | ||
| 1250 | ; | ||
| 1251 | ;Input: BX = pointer to search FCB | ||
| 1252 | ; AL is head mark with app type =81h | ||
| 1253 | ; SI = points to dir entry | ||
| 1254 | ; DI = cluster entry of file or XA in directory | ||
| 1255 | ; File_Size_Low/High = bytes length directory or XA structure says | ||
| 1256 | ; the data area is | ||
| 1257 | ; SecondPass = TRUE/FALSE | ||
| 1258 | ; XA_Pass = TRUE/FALSE | ||
| 1259 | ; EOFVal = 0FF8h/0FFF8h | ||
| 1260 | ; | ||
| 1261 | ;Output: | ||
| 1262 | ; ZEROTRUNC is non zero if the file was trimmed to zero length | ||
| 1263 | ; ISCROSS is non zero if the file is cross linked | ||
| 1264 | ; BX,SI preserved | ||
| 1265 | ; Cluster_Count = number of clusters in chain | ||
| 1266 | ; carry flag is set if the clusters are ok | ||
| 1267 | ; fatmap entries - 81h = head of file, | ||
| 1268 | ; 01h = used cluster | ||
| 1269 | ; | ||
| 1270 | ;Psuedocode | ||
| 1271 | ;---------- | ||
| 1272 | ; | ||
| 1273 | ; ZeroTrunc,IsCross = FALSE, SRFCBPT = BX, Cluster_Count = 0 | ||
| 1274 | ; Get file cluster entry (CALL Unpack) | ||
| 1275 | ; IF cluster < 2 or > maximum cluster (MClus) | ||
| 1276 | ; Go handle invalid cluster (CALL Bad_Cluster) | ||
| 1277 | ; ELSE | ||
| 1278 | ; SEARCH | ||
| 1279 | ; Go mark cluster in FATMap (CALL MarkMAP) | ||
| 1280 | ; Turn off head bit on FATMap marker | ||
| 1281 | ; EXITIF Crosslink | ||
| 1282 | ; IsCross = TRUE | ||
| 1283 | ; IF SecondPass = FALSE | ||
| 1284 | ; Setup filename for message (CALL ThisEl) | ||
| 1285 | ; Display crosslink message (Call Eprint) | ||
| 1286 | ; ENDIF | ||
| 1287 | ; ORELSE (no crosslink) | ||
| 1288 | ; Get next cluster (CALL Unpack) | ||
| 1289 | ; IF Cluster >= EOFVAL [(0/F)FF8h] | ||
| 1290 | ; Verify file sizes (CALL Check_Chain_Sizes) | ||
| 1291 | ; clc (Force loop to end) | ||
| 1292 | ; ELSE | ||
| 1293 | ; IF cluster < 2 or > maximum cluster (MClus) | ||
| 1294 | ; Go handle invalid cluster (CALL Bad_Cluster) | ||
| 1295 | ; clc (Force loop to end) | ||
| 1296 | ; ELSE | ||
| 1297 | ; stc (Force loop to keep goining | ||
| 1298 | ; ENDIF | ||
| 1299 | ; ENDIF | ||
| 1300 | ; ENDLOOP clc | ||
| 1301 | ; ENDSRCH | ||
| 1302 | ; ENDIF | ||
| 1303 | ; ret | ||
| 1304 | ;***************************************************************************** | ||
| 1305 | Procedure MarkFAT ; ;AN000; | ||
| 1306 | push si ;AN000; | ||
| 1307 | push bx ;AN000; | ||
| 1308 | mov Head_Mark,al ;Save flag to put in map ;AN000; | ||
| 1309 | mov ZeroTrunc,False ;Init values ; ; | ||
| 1310 | mov IsCross,False ; ; ; | ||
| 1311 | mov Cluster_Count,0 ;Init count of clusters ; ; | ||
| 1312 | mov SrFCBPt,bx ;Pointer to search FCB ; ; | ||
| 1313 | mov First_Cluster,di ; ;AN000; | ||
| 1314 | mov Previous_Cluster,di ;Init pointer | ||
| 1315 | cmp di,2 ;Cluster < 2? ;AC000; | ||
| 1316 | ; $IF B,OR ; or ;AC000; | ||
| 1317 | JB $$LL44 | ||
| 1318 | cmp di,MClus ;Cluster > total clusters? ;AC000; | ||
| 1319 | ; $IF A ; ;AC000; | ||
| 1320 | JNA $$IF44 | ||
| 1321 | $$LL44: | ||
| 1322 | cmp word ptr [si].dirclus,0 ;if both cluster and size = 0, ;an025;bgb | ||
| 1323 | ; $IF NE,OR ;then its not an error, ;an025;bgb | ||
| 1324 | JNE $$LL45 | ||
| 1325 | cmp word ptr [si].diresiz,0 ;and dont print msg ;an025;bgb | ||
| 1326 | ; $IF NE ;an025;bgb | ||
| 1327 | JE $$IF45 | ||
| 1328 | $$LL45: | ||
| 1329 | call Bad_Cluster ;Yes, go indicate bad stuff ;AN000; | ||
| 1330 | ; $ENDIF | ||
| 1331 | $$IF45: | ||
| 1332 | ; $ELSE ;Cluster in valid range ;AN000; | ||
| 1333 | JMP SHORT $$EN44 | ||
| 1334 | $$IF44: | ||
| 1335 | ; $SEARCH ;Chase the cluster chain ;AN000; | ||
| 1336 | $$DO48: | ||
| 1337 | mov al,Head_Mark ;Get flag for map 01 ;AC000; | ||
| 1338 | call MarkMap ;Mark the cluster (SI) ;AC000; | ||
| 1339 | push ax ;Save head mark ;AN000; | ||
| 1340 | lahf ;Save CY status | ||
| 1341 | and Head_Mark,Head_Mask ;Turn off head bit of map flag ;AC000; | ||
| 1342 | sahf ;Get CY flags back | ||
| 1343 | pop ax ;Get haed mark back ;AN000; | ||
| 1344 | ; $EXITIF C ;Quit if crosslink ;AC000; | ||
| 1345 | JNC $$IF48 | ||
| 1346 | mov IsCross,True ;Set crosslink flag ;AC000; | ||
| 1347 | cmp SecondPass,True ;Handle crosslink 2nd pass only ;AC000; | ||
| 1348 | ; $IF E ;This is first pass ;AC000; | ||
| 1349 | JNE $$IF50 | ||
| 1350 | mov Cross_Clus,di ;Put cluster in message ;AN000; | ||
| 1351 | push bx ;Get dir pointer into bx ;AN000; | ||
| 1352 | push si ; ;AN000; | ||
| 1353 | mov bx,si ; for the call ;AN000; | ||
| 1354 | call Get_ThisELErr ; ;AC000; | ||
| 1355 | mov dx,offset DG:Cross_arg ;Specify error message ;AC000; | ||
| 1356 | call EPrint ;Go print file and error ;AC000; | ||
| 1357 | pop si ; ;AN000; | ||
| 1358 | pop bx ; ;AN000; | ||
| 1359 | Message Cross_Arg ; ;AC000; | ||
| 1360 | ; $ENDIF ; ;AN000; | ||
| 1361 | $$IF50: | ||
| 1362 | ; $ORELSE ;No crosslink found ;AN000; | ||
| 1363 | JMP SHORT $$SR48 | ||
| 1364 | $$IF48: | ||
| 1365 | push si ;Save dir pointer | ||
| 1366 | mov si,di ;Provide current cluster | ||
| 1367 | mov Previous_Cluster,di ;Save current cluster | ||
| 1368 | call UnPack ;Get next cluster entry (di) ;AC000; | ||
| 1369 | inc Cluster_Count ;Got a cluster ;AN000; | ||
| 1370 | pop si ;Get dir pointer back | ||
| 1371 | cmp di,EOFVal ;Is it the last clus in file? ;AC000; | ||
| 1372 | ; $IF AE ;Yes - good chain so far ;AN000; | ||
| 1373 | JNAE $$IF53 | ||
| 1374 | call Check_Chain_Sizes ;Go verify file sizes ;AN000; | ||
| 1375 | clc ;Clear CY to force exit ;AN000; | ||
| 1376 | ; $ELSE ;Not end of chain | ||
| 1377 | JMP SHORT $$EN53 | ||
| 1378 | $$IF53: | ||
| 1379 | cmp di,2 ;Cluster < 2? ;AC000; | ||
| 1380 | ; $IF B,OR ; or ;AC000; | ||
| 1381 | JB $$LL55 | ||
| 1382 | cmp di,MClus ;Cluster > total clusters? ;AC000; | ||
| 1383 | ; $IF A ;Yep ;AN000; | ||
| 1384 | JNA $$IF55 | ||
| 1385 | $$LL55: | ||
| 1386 | call Bad_Cluster ;Yes, go indicate bad stuff ;AN000; | ||
| 1387 | clc ;Clear CY to force loop exit ;AN000; | ||
| 1388 | ; $ELSE ;No, more clusters to go ;AN000; | ||
| 1389 | JMP SHORT $$EN55 | ||
| 1390 | $$IF55: | ||
| 1391 | stc ;Set CY to keep going ;AN000; | ||
| 1392 | ; $ENDIF ; ;AN000; | ||
| 1393 | $$EN55: | ||
| 1394 | ; $ENDIF ; | ||
| 1395 | $$EN53: | ||
| 1396 | ; $ENDLOOP NC ;Exit if done with chain ;AN000; | ||
| 1397 | JC $$DO48 | ||
| 1398 | ; $ENDSRCH ;End of chain chase loop ;AN000; | ||
| 1399 | $$SR48: | ||
| 1400 | ; $ENDIF ; | ||
| 1401 | $$EN44: | ||
| 1402 | pop bx ;Restore registers ;AN000; | ||
| 1403 | pop si ; ;AN000; | ||
| 1404 | ret ; ;AN000; | ||
| 1405 | MarkFAT endp ; ;AN000; | ||
| 1406 | |||
| 1407 | ;***************************************************************************** | ||
| 1408 | ;Routine name: Bad_Cluster | ||
| 1409 | ;***************************************************************************** | ||
| 1410 | ; | ||
| 1411 | ;description: IF first cluster =0, truncate file or XA to zero length. | ||
| 1412 | ; If bad cluster elsewhere, put in EOFVal. | ||
| 1413 | ; | ||
| 1414 | ;Called Procedures: Get_ThisElErr | ||
| 1415 | ; Eprint | ||
| 1416 | ; FixENT2 | ||
| 1417 | ; | ||
| 1418 | ;Change History: Created 5/10/87 MT | ||
| 1419 | ; | ||
| 1420 | ;Input: First_Cluster | ||
| 1421 | ; Chain_End | ||
| 1422 | ; XA_PASS = TRUE/FALSE | ||
| 1423 | ; DI = Cluster entry | ||
| 1424 | ; SI = dir block pointer | ||
| 1425 | ; First_Cluster = first cluster or extended XA | ||
| 1426 | ; Previous_Cluster = last good cluster number | ||
| 1427 | ; | ||
| 1428 | ;Output: ZeroTrunc = TRUE/FALSE | ||
| 1429 | ; | ||
| 1430 | ;Psuedocode | ||
| 1431 | ;---------- | ||
| 1432 | ; | ||
| 1433 | ; Setup filename for any messages (Call Get_ThisELErr) | ||
| 1434 | ; IF cluster = First_Cluster | ||
| 1435 | ; IF XA_PASS = FALSE | ||
| 1436 | ; Zero out file length in DIR | ||
| 1437 | ; Setup message (CALL Get_ThisElErr) | ||
| 1438 | ; Display message (Call Eprint) | ||
| 1439 | ; ELSE (XA pass) | ||
| 1440 | ; Zero out XA pointer | ||
| 1441 | ; Setup message (CALL Get_ThisElErr) | ||
| 1442 | ; Display message (Call Eprint) | ||
| 1443 | ; ENDIF | ||
| 1444 | ; Write out corrected directory (CALL FixENT2) | ||
| 1445 | ; ELSE (cluster other than first in chain) | ||
| 1446 | ; IF XA_Pass = TRUE | ||
| 1447 | ; Display Bad XA cluster message | ||
| 1448 | ; ELSE (!XA_Pass) | ||
| 1449 | ; Display bad file chain message | ||
| 1450 | ; ENDIF | ||
| 1451 | ; Move EOF into bad cluster (CALL PACK - Chain_End) | ||
| 1452 | ; ENDIF | ||
| 1453 | ; ret | ||
| 1454 | ;***************************************************************************** | ||
| 1455 | Procedure Bad_Cluster ; ;AN000; | ||
| 1456 | savereg <si,di,dx,si,di,bx> ;Preserve registers ;AN000; | ||
| 1457 | mov bx,si ; for the call ;AN000; | ||
| 1458 | call Get_ThisElErr ;Setup message ;AC000; | ||
| 1459 | restorereg <bx,di,si> | ||
| 1460 | cmp di,First_Cluster ;does 1st clus point to itself? ;Need to change the directory ;AC000; | ||
| 1461 | ; $IF E,OR ;yes ; pointer if the dir cluster or ;AC000; | ||
| 1462 | JE $$LL62 | ||
| 1463 | push di ;if not, try this next test ; XA is bad, or the last good ;AN000; | ||
| 1464 | mov di,Previous_Cluster ;get prev cluster ; entry was the dir cluster or ;AN000; | ||
| 1465 | cmp di,First_Cluster ;does prev clus = 1st clus? ; XA cluster. ;AN000; | ||
| 1466 | pop di ;means the 1st cluster is bad | ||
| 1467 | ; $IF E ;yes ; ;AN000; | ||
| 1468 | JNE $$IF62 | ||
| 1469 | $$LL62: | ||
| 1470 | cmp word ptr [si].dirclus,0 ;is cluster num already 0? ;an025;bgb | ||
| 1471 | ; $IF NE ;no, its bad ;an025;bgb | ||
| 1472 | JE $$IF63 | ||
| 1473 | mov dx,offset DG:NulNZ ;1st cluster number is invalid;an025;bgb | ||
| 1474 | call EPrint ;Go print file and error ;an025;bgb | ||
| 1475 | mov word ptr [si].dirclus,0 ;set cluster number to 0 ;an025;bgb | ||
| 1476 | mov zerotrunc,true ;modified the file size ;an026;bgb | ||
| 1477 | ; $ENDIF ;already set to 0, dont print err msg ;an025;bgb | ||
| 1478 | $$IF63: | ||
| 1479 | mov word ptr [si].DIRESIZ,0 ;set file size to 0 ;Kill the file size ;AC000; | ||
| 1480 | mov word ptr [si].DIRESIZ+2,0 ;Kill the file size ;AC000;0; | ||
| 1481 | mov bx,si ;Get pointer to directory ;AN000; | ||
| 1482 | call FixEnt2 ;Write out updated directory ;AC000; | ||
| 1483 | ; $ELSE ;Not first cluster in chain ;AN000; | ||
| 1484 | JMP SHORT $$EN62 | ||
| 1485 | $$IF62: | ||
| 1486 | mov dx,offset dg:Badchain ;Tell user file and error ;AN000; | ||
| 1487 | call EPrint ;AN000; | ||
| 1488 | mov dx,Chain_End ;Terminate chain at bad spot ;AC000; | ||
| 1489 | mov si,Previous_Cluster ;Change the last good cluster ;AC000; | ||
| 1490 | call Pack ;Go fix it ;AC000; | ||
| 1491 | ; $ENDIF ; ;AN000; | ||
| 1492 | $$EN62: | ||
| 1493 | restorereg <dx,di,si> | ||
| 1494 | ret ; | ||
| 1495 | Bad_Cluster endp ; ;AN000; | ||
| 1496 | |||
| 1497 | ;***************************************************************************** | ||
| 1498 | ;Routine name: Check_Chain_Sizes | ||
| 1499 | ;***************************************************************************** | ||
| 1500 | ; | ||
| 1501 | ;description: See if length of chain as listed in dir or XA matches up | ||
| 1502 | ; with the number of clusters allocated. Don't check if crosslink | ||
| 1503 | ; error, or chasing directory chain. | ||
| 1504 | ; | ||
| 1505 | ;Called Procedures: FixEnt | ||
| 1506 | ; Bad_Chain_Size | ||
| 1507 | ; | ||
| 1508 | ; | ||
| 1509 | ;Change History: Created 5/10/87 MT | ||
| 1510 | ; | ||
| 1511 | ;Input: CSIZE = sectors per cluster | ||
| 1512 | ; SSIZE = bytes per sector | ||
| 1513 | ; Cluster_Count = number of clusters in chain | ||
| 1514 | ; File_Size_Low/High = bytes dir or XA says is in chain | ||
| 1515 | ; SI = Pointer to Dir entry | ||
| 1516 | ; | ||
| 1517 | ;Output: Cluster_Count = Size of chain in clusters | ||
| 1518 | ; SI = Pointer to dir entry | ||
| 1519 | ; BX = SRFCBPT | ||
| 1520 | ; | ||
| 1521 | ;Psuedocode | ||
| 1522 | ;---------- | ||
| 1523 | ; | ||
| 1524 | ; IF !Directory attribute,AND | ||
| 1525 | ; IF !Crosslinked (ISCROSS = FALSE),AND | ||
| 1526 | ; IF !Second pass (SecondPass = FALSE) | ||
| 1527 | ; Compute bytes/cluster | ||
| 1528 | ; Compute bytes/chain | ||
| 1529 | ; IF size > File_Size_High/Low | ||
| 1530 | ; Fix the size (CALL Bad_Chain_Size) | ||
| 1531 | ; ELSE | ||
| 1532 | ; Subtract file size from chain length | ||
| 1533 | ; IF Difference in Chain_Length and Size >= bytes/cluster | ||
| 1534 | ; Fix the size (CALL Bad_Chain_Size) | ||
| 1535 | ; ENDIF | ||
| 1536 | ; ENDIF | ||
| 1537 | ; ENDIF | ||
| 1538 | ; ENDIF | ||
| 1539 | ; CX = Cluster_Count (kept for compatibility with old code) | ||
| 1540 | ; BX = SRFCPT (kept for compatibility with old code) | ||
| 1541 | ; ret | ||
| 1542 | ;***************************************************************************** | ||
| 1543 | Procedure Check_Chain_Sizes ;AN000; | ||
| 1544 | push si ; ;AN000; | ||
| 1545 | push ax ; ;AN000; | ||
| 1546 | test [si].DirAtt,Dir_Attribute ;Is this a directory? ;AC000; | ||
| 1547 | ; $IF Z,AND ;No ;AC000; | ||
| 1548 | JNZ $$IF67 | ||
| 1549 | cmp IsCross,False ; and,is it crosslinked? ;AC000; | ||
| 1550 | ; $IF E,AND ;No ;AC000; | ||
| 1551 | JNE $$IF67 | ||
| 1552 | cmp SecondPass,False ;and, is this the first pass? ;AC000; | ||
| 1553 | ; $IF E ;Yes, ;AC000; | ||
| 1554 | JNE $$IF67 | ||
| 1555 | xor ax,ax ;AX =0 ;AC000; | ||
| 1556 | mov ax,SSize ;Get (bytes/sector) * ;AC000; | ||
| 1557 | mov cl,CSize ; (Sectors/cluster) ;AC000; | ||
| 1558 | mul cx ;AX=Bytes/cluster (< 64k) ;AC000; | ||
| 1559 | mov BClus,ax ;Save Bytes/cluster ;AN000; | ||
| 1560 | mov cx,Cluster_Count ;Number of clusters in chain ;AC000; | ||
| 1561 | mul cx ;DX:AX = bytes/chain ;AC000; | ||
| 1562 | mov Chain_Size_Low,ax ;Save allocation size in bytes ;AN000; | ||
| 1563 | mov Chain_Size_High,dx ; ;AN000; | ||
| 1564 | cmp dx,File_Size_High ;See if file size if greater ;AN000; | ||
| 1565 | ; $IF E,AND ; than chain length - if ;AN000; | ||
| 1566 | JNE $$IF68 | ||
| 1567 | cmp ax,File_Size_Low ; so, than there is an ;AC000; | ||
| 1568 | ; $IF B ; allocation error. ;AC000; | ||
| 1569 | JNB $$IF68 | ||
| 1570 | call Bad_Chain_Size ;Fix it! ;AC013;bgb | ||
| 1571 | ; $ELSE ;Chain larger than file ;AC000; | ||
| 1572 | JMP SHORT $$EN68 | ||
| 1573 | $$IF68: | ||
| 1574 | cmp dx,File_Size_High ;See if high part lower ;AN000; | ||
| 1575 | ; $IF B ;Chain < filsize if so ;AN000; | ||
| 1576 | JNB $$IF70 | ||
| 1577 | call Bad_Chain_Size ;Fix it! ;AC013;bgb | ||
| 1578 | ; $ELSE ;Chain > filesize ;AN000; | ||
| 1579 | JMP SHORT $$EN70 | ||
| 1580 | $$IF70: | ||
| 1581 | mov cx,File_Size_Low ;See if within 1 cluster ;AN000; | ||
| 1582 | mov bx,File_Size_High ; ;AN000; | ||
| 1583 | sub ax,cx ;Subtract file size from ;AC000; | ||
| 1584 | sbb dx,bx ; the chain size ;AN000; | ||
| 1585 | cmp dx,0 ;See if within 1 cluster ;AN000; | ||
| 1586 | ; $IF NE,OR ;Not if high size set,or ;AN000; | ||
| 1587 | JNE $$LL72 | ||
| 1588 | cmp ax,BClus ;Within (bytes/cluster -1)? ;AC000; | ||
| 1589 | ; $IF AE ;Nope, allocation error ;AC000; | ||
| 1590 | JNAE $$IF72 | ||
| 1591 | $$LL72: | ||
| 1592 | call Bad_Chain_Size ;Go fix the chain ;AN013;bgb | ||
| 1593 | ; $ENDIF ; ;AN000; | ||
| 1594 | $$IF72: | ||
| 1595 | ; $ENDIF ; ;AN000; | ||
| 1596 | $$EN70: | ||
| 1597 | ; $ENDIF ; ;AN000; | ||
| 1598 | $$EN68: | ||
| 1599 | ; $ENDIF ; ;AN000; | ||
| 1600 | $$IF67: | ||
| 1601 | mov bx,SrFCBPt ; Needed for compat ;AC000; | ||
| 1602 | pop ax ;Restore used regs ;AN000; | ||
| 1603 | pop si ;SI = Dir pointer ;AN000; | ||
| 1604 | ret ; ; ; | ||
| 1605 | check_chain_sizes endp ; ;AN000; | ||
| 1606 | |||
| 1607 | |||
| 1608 | |||
| 1609 | Procedure print_filename ;AN000; | ||
| 1610 | PUSH BX | ||
| 1611 | MOV BX,SI | ||
| 1612 | CALL get_THISEL | ||
| 1613 | mov dx,offset dg:noisy_arg | ||
| 1614 | call printf_crlf | ||
| 1615 | MOV SI,BX | ||
| 1616 | POP BX | ||
| 1617 | return | ||
| 1618 | print_filename endp ; ;AN000; | ||
| 1619 | |||
| 1620 | ;these procedures were for the extended attribute support, which was removed ;an006;bgb | ||
| 1621 | |||
| 1622 | ;***************************************************************************** | ||
| 1623 | ;Routine name: Bad_Chain_Size | ||
| 1624 | ;***************************************************************************** | ||
| 1625 | ; | ||
| 1626 | ;Description: adjust | ||
| 1627 | ; filesize to allocation length. | ||
| 1628 | ; | ||
| 1629 | ;Called Procedures: Truncate_XA | ||
| 1630 | ; FixEnt2 | ||
| 1631 | ; Get_ThisElErr | ||
| 1632 | ; Eprint | ||
| 1633 | ; | ||
| 1634 | ;Change History: Created 5/11/87 MT | ||
| 1635 | ; | ||
| 1636 | ;Input: XA_Pass = TRUE/FALSE | ||
| 1637 | ; Chain_Size_High/Low | ||
| 1638 | ; SI = Dir pointer | ||
| 1639 | ; Chain_Size_Low/High = length in bytes of allocation chain | ||
| 1640 | ; | ||
| 1641 | ;Output: None | ||
| 1642 | ; | ||
| 1643 | ;Psuedocode | ||
| 1644 | ;---------- | ||
| 1645 | ; | ||
| 1646 | ; IF XA_Pass | ||
| 1647 | ; Delete XA chain (CALL Truncate_XA) | ||
| 1648 | ; ELSE | ||
| 1649 | ; Set directory entry to length = Total allocation size | ||
| 1650 | ; Go write out (CALL FixEnt2) | ||
| 1651 | ; Setup message (CALL Get_Thiselerr) | ||
| 1652 | ; Display it (Call Eprint) | ||
| 1653 | ; ENDIF | ||
| 1654 | ; ret | ||
| 1655 | ;***************************************************************************** | ||
| 1656 | Procedure Bad_Chain_Size ; ;AN000; | ||
| 1657 | push es | ||
| 1658 | push ax ;Save register ;AN000; | ||
| 1659 | |||
| 1660 | push ds ;make es point to dg | ||
| 1661 | pop es | ||
| 1662 | ;;;;;; cmp XA_Pass,True ;Are we handling XA's? ;AN013;bgb | ||
| 1663 | ;;;;;;;;$IF E ;Yes ;AN013;bgb | ||
| 1664 | ;;;;;;;;;;;call Truncate_XA ;Go truncate the chain ;AN013;bgb | ||
| 1665 | ;;;;;;;;$ELSE ;Normal file chain ;AN013;bgb | ||
| 1666 | mov ax,Chain_Size_Low ;Get length of allocation ;AN000; | ||
| 1667 | mov dx,Chain_Size_High ; chain for filesize ;AN000; | ||
| 1668 | mov word ptr [si].DirESiz,ax ;Put it in the directory ;AC000; | ||
| 1669 | mov word ptr [si+2].DirESiz,dx ; " " " " ;AC000; | ||
| 1670 | push bx ; ;AN000; | ||
| 1671 | push si ; ;AN000; | ||
| 1672 | mov bx,si ;Get pointer to directory ;AN000; | ||
| 1673 | call FixENT2 ;Write dir to disk ;AC000; | ||
| 1674 | call Get_ThisElErr ;Setup message ;AC000; | ||
| 1675 | mov dx,offset DG:BadClus ;Specify error message ;AC000; | ||
| 1676 | call EPrint ;Go print file and error ;AC000; | ||
| 1677 | pop si ; ;AN000; | ||
| 1678 | pop bx ; ;AN000; | ||
| 1679 | ;;;;;;;;$ENDIF ; ;AN013;bgb | ||
| 1680 | pop ax ;Restore registers ;AN000; | ||
| 1681 | pop es | ||
| 1682 | ret ; | ||
| 1683 | |||
| 1684 | Bad_Chain_Size endp ; ;AN000; | ||
| 1685 | |||
| 1686 | ;***************************************************************************** | ||
| 1687 | ;Routine name: Truncate_XA | ||
| 1688 | ;***************************************************************************** | ||
| 1689 | ; | ||
| 1690 | ;Description: If /F entered, than truncate XA chain and remove pointer. | ||
| 1691 | ; If XA allocation error, than deallocate all of XA chain. | ||
| 1692 | ; | ||
| 1693 | ;Called Procedures: Get_ThisElErr | ||
| 1694 | ; Eprint | ||
| 1695 | ; MarkMap | ||
| 1696 | ; Unpack | ||
| 1697 | ; Pack | ||
| 1698 | ; | ||
| 1699 | ;Change History: Created 5/11/87 MT | ||
| 1700 | ; | ||
| 1701 | ;Input: First_Cluster | ||
| 1702 | ; Chain_End | ||
| 1703 | ; SI = directory entry pointer | ||
| 1704 | ; | ||
| 1705 | ; | ||
| 1706 | ;Output: FATMap entries for XA chain zero'd out | ||
| 1707 | ; | ||
| 1708 | ;Psuedocode | ||
| 1709 | ;---------- | ||
| 1710 | ; | ||
| 1711 | ; Set XA pointer in dir to 0 | ||
| 1712 | ; Write it out (CALL FixEnt2) | ||
| 1713 | ; Setup message (Call get_ThisElErr | ||
| 1714 | ; Display message (Call Eprint) | ||
| 1715 | ; Get first cluster number (First_Cluster) | ||
| 1716 | ; DO | ||
| 1717 | ; Get first cluster entry (Call Unpack) | ||
| 1718 | ; Go mark cluster in FATMap with "Open" (CALL MarkMAP) | ||
| 1719 | ; Set cluster entry with 0000 (Call Pack) | ||
| 1720 | ; ENDDO cluster value >= EOFVal | ||
| 1721 | ; ret | ||
| 1722 | ;***************************************************************************** | ||
| 1723 | |||
| 1724 | ;rocedure Truncate_XA ; ;AN000; | ||
| 1725 | ; | ||
| 1726 | ; push si ;Save dir pointer ;AN000; | ||
| 1727 | ; push bx ; ;AN000; | ||
| 1728 | ; push si ; ;AN000; | ||
| 1729 | ; mov bx,si ;Get directory pointer ;AN000; | ||
| 1730 | ; call Get_ThisEl ;Setup message ;AN000; | ||
| 1731 | ; mov dx,offset DG:Alloc_XA_Msg ;Specify error message ;AC000; | ||
| 1732 | ; call EPrint ;Go print file and error ;AC000; | ||
| 1733 | ; pop si ; ;AN000; | ||
| 1734 | ; mov word ptr [si].DIR_XA,No_Ext_Attrib ;Erase XA pointer ;AN000; | ||
| 1735 | ; call FixENT2 ;Write dir entry out ;AN000; | ||
| 1736 | ; pop bx ; ;AN000; | ||
| 1737 | ; mov si,First_Cluster ;Get first cluster ;AN000; | ||
| 1738 | ; $DO ;Chase and erase XA chain ;AN000; | ||
| 1739 | ; call Unpack ;Get next cluster ;AN000; | ||
| 1740 | ; push di ;Save it- DI next, SI current ;AN000; | ||
| 1741 | ; mov al,No_Entry ;Free entry in map ;AN000; | ||
| 1742 | ; call MarkMap ; " " " " ;AN000; | ||
| 1743 | ; mov dx,No_Entry ;Free up cluster in Fat ;AN000; | ||
| 1744 | ; call Pack ; " " " " ;AN000; | ||
| 1745 | ; pop si ;Get back next cluster ;AN000; | ||
| 1746 | ; cmp si,[EOFVal] ;Reached end of chain? ;AN000; | ||
| 1747 | ; $ENDDO AE ;Keep looping if not ;AN000; | ||
| 1748 | ; pop si ;Restore Dir pointer ;AN000; | ||
| 1749 | ; ret ; ;AN000; | ||
| 1750 | ; | ||
| 1751 | ;runcate_XA endp ; ;AN000; | ||
| 1752 | |||
| 1753 | ;***************************************************************************** | ||
| 1754 | ;Routine name: Check_Extended_Attributes | ||
| 1755 | ;***************************************************************************** | ||
| 1756 | ; | ||
| 1757 | ;Description: Get the first cluster of XA chain, if it is zero, than erase | ||
| 1758 | ; extended attribute pointer (/F only). Otherwise, map the | ||
| 1759 | ; cluster in the FATMAP. If crosslink found on first cluster, | ||
| 1760 | ; no more processing is done. If value other than EOF mark | ||
| 1761 | ; found in first cluster | ||
| 1762 | ; | ||
| 1763 | ;Called Procedures: Load_XA | ||
| 1764 | ; Fix_Bad_XA | ||
| 1765 | ; Check_XA_Structure | ||
| 1766 | ; MarkFAT | ||
| 1767 | ; | ||
| 1768 | ;Change History: Created 5/10/87 MT | ||
| 1769 | ; | ||
| 1770 | ;Input: SI = pointer to directory entry | ||
| 1771 | ; | ||
| 1772 | ;Output: FATMap marked with XA_Cluster for each XA cluster found | ||
| 1773 | ; XA_PASS = NO | ||
| 1774 | ; | ||
| 1775 | ;Psuedocode | ||
| 1776 | ;---------- | ||
| 1777 | ; | ||
| 1778 | ; IF (XA exists for file) | ||
| 1779 | ; XA_PASS = YES | ||
| 1780 | ; DI = XA entry cluster in dir | ||
| 1781 | ; Load in first sector of XA (CALL Load_XA) | ||
| 1782 | ; IF !error | ||
| 1783 | ; File_Size_Low/High = length of XA's in bytes | ||
| 1784 | ; AL = chain head mark (XA_Chain) | ||
| 1785 | ; Trace chain and map it (CALL MarkFAT) | ||
| 1786 | ; ELSE | ||
| 1787 | ; call Bad_Cluster | ||
| 1788 | ; ENDIF | ||
| 1789 | ; ENDIF | ||
| 1790 | ; ret | ||
| 1791 | ;***************************************************************************** | ||
| 1792 | |||
| 1793 | ;rocedure Check_Extended_Attributes ; ;AN000; | ||
| 1794 | ; | ||
| 1795 | ; push ax ;Save register ;AN000; | ||
| 1796 | ; push cx ; ;AN000; | ||
| 1797 | ; push dx ; ;AN000; | ||
| 1798 | ; push di ; ;AN000; | ||
| 1799 | ; mov ax,[si].DIR_XA ;Get first cluster of XA's ;AN000; | ||
| 1800 | ; cmp ax,No_Ext_Attrib ;Are there extended attrib's ;AN000; | ||
| 1801 | ; $IF NE ;Quit if no ;AN000; | ||
| 1802 | ; mov di,ax ;Pointer to current cluster ;AN000; | ||
| 1803 | ; mov First_Cluster,di ;Remember first cluster ;AN000; | ||
| 1804 | ; mov XA_Pass,Yes ;Indicate processing XA's ;AN000; | ||
| 1805 | ; call Load_XA ;Go load sector ;AN000; | ||
| 1806 | ; $IF NC ;CY means load error ;AN000; | ||
| 1807 | ; mov ax,XA_Buffer.XAL_TSIZE ;Get bytes in XA chain ;AN000; | ||
| 1808 | ; mov File_Size_High,0 ;Save it ;AN000; | ||
| 1809 | ; mov File_Size_Low,ax ; ;AN000; | ||
| 1810 | ; mov al,XA_Chain ;Set up mark for map ;AN000; | ||
| 1811 | ; call MarkFAT ;Go map out chain ;AN000; | ||
| 1812 | ; $ELSE ;Error on read of XA ;AN000; | ||
| 1813 | ; call Bad_Cluster ;Delete extended attribs ;AN000; | ||
| 1814 | ;; $ENDIF ; ;AN000; | ||
| 1815 | ; $ENDIF | ||
| 1816 | ; pop di ;Restore registers | ||
| 1817 | ; pop dx ; ;AN000; | ||
| 1818 | ; pop cx ; ;AN000; | ||
| 1819 | ; pop ax ; ;AN000; | ||
| 1820 | ; ret ; ;AN000; | ||
| 1821 | ; | ||
| 1822 | ;heck_Extended_Attributes endp ; ;AN000; | ||
| 1823 | |||
| 1824 | |||
| 1825 | ;***************************************************************************** | ||
| 1826 | ;Routine name: Load_XA | ||
| 1827 | ;***************************************************************************** | ||
| 1828 | ; | ||
| 1829 | ;description: Read in the first XA cluster | ||
| 1830 | ; | ||
| 1831 | ;Called Procedures: Read_Disk | ||
| 1832 | ; | ||
| 1833 | ; | ||
| 1834 | ;Change History: Created 5/13/87 MT | ||
| 1835 | ; | ||
| 1836 | ;Input: AX has start cluster of XA chain | ||
| 1837 | ; SI = dir pointer | ||
| 1838 | ;Output: CY if read failed | ||
| 1839 | ; | ||
| 1840 | ;Psuedocode | ||
| 1841 | ;---------- | ||
| 1842 | ; | ||
| 1843 | ; Get start of data area | ||
| 1844 | ; Get start cluster | ||
| 1845 | ; Compute XA location from starting cluster | ||
| 1846 | ; Read it in (CALL Read_Disk) | ||
| 1847 | ; IF error | ||
| 1848 | ; stc | ||
| 1849 | ; ENDIF (NC if didn't take IF) | ||
| 1850 | ; ret | ||
| 1851 | ;***************************************************************************** | ||
| 1852 | |||
| 1853 | ;rocedure Load_XA ; ;AN000; | ||
| 1854 | ; | ||
| 1855 | ; push si ;Save used registers ;AN000; | ||
| 1856 | ; push cx ; ;AN000; | ||
| 1857 | ; push dx ; ;AN000; | ||
| 1858 | ; push bx ; ;AN000; | ||
| 1859 | ; sub ax,2 ;Make cluster 0 based ;AN000; | ||
| 1860 | ; mov cl,CSize ;Get sectors/cluster ;AN000; | ||
| 1861 | ; mul cl ;Offset sec in data area ;AN000; | ||
| 1862 | ; add ax,Data_Start_Low ;Get actual sector in partition ;AN000; | ||
| 1863 | ; adc dx,Data_Start_High ; " " " " ;AN000; | ||
| 1864 | ; mov Read_Write_Relative.Start_Sector_High,dx ;Setup high sector addr;AN000; | ||
| 1865 | ; mov bx,offset dg:XA_Buffer ;Read into buffer ;AN000; | ||
| 1866 | ; mov cx,1 ;Get just first sector ;AN000; | ||
| 1867 | ; mov dx,ax ;Get logical sector low ;AN000; | ||
| 1868 | ; mov al,AllDrv ;Get drive number 1=A,2=B ;AN000; | ||
| 1869 | ; dec al ;Make 0 based drive 0=A ;AN000; | ||
| 1870 | ; call Read_Disk ;Read in sector ;AN000; | ||
| 1871 | ; $IF C ;Problem? ;AN000; | ||
| 1872 | ; stc ; ;AN000; | ||
| 1873 | ; $ENDIF ; ;AN000; | ||
| 1874 | ; pop bx ;Restore registers ;AN000; | ||
| 1875 | ; pop dx ; ;AN000; | ||
| 1876 | ; pop cx ; ;AN000; | ||
| 1877 | ; pop si ; ;AN000; | ||
| 1878 | ; ret ; ;AN000; | ||
| 1879 | ; | ||
| 1880 | ;oad_XA endp ; ;AN000; | ||
| 1881 | |||
| 1882 | ;**************************************************************************** | ||
| 1883 | ;WARNING!!! this must be the last label in the code section | ||
| 1884 | ; any changes to chkdsk.arf must take into account this area. | ||
| 1885 | ; it is used for reading things from disk into memory, such as dir | ||
| 1886 | Public CHKPRMT_End | ||
| 1887 | Chkprmt_End label byte | ||
| 1888 | ;**************************************************************************** | ||
| 1889 | pathlabl chkproc | ||
| 1890 | CODE ENDS | ||
| 1891 | END | ||
| 1892 | \ No newline at end of file | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKPROC2.ASM b/v4.0/src/CMD/CHKDSK/CHKPROC2.ASM new file mode 100644 index 0000000..8a3bde8 --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKPROC2.ASM | |||
| @@ -0,0 +1,479 @@ | |||
| 1 | TITLE CHKPROC2 - PART2 Procedures called from chkdsk | ||
| 2 | page ,132 ; | ||
| 3 | |||
| 4 | .xlist | ||
| 5 | include chkseg.inc ;an005;bgb | ||
| 6 | INCLUDE CHKCHNG.INC | ||
| 7 | INCLUDE DOSSYM.INC | ||
| 8 | INCLUDE CHKEQU.INC | ||
| 9 | INCLUDE CHKMACRO.INC | ||
| 10 | include pathmac.inc | ||
| 11 | |||
| 12 | CONST SEGMENT PUBLIC PARA 'DATA' | ||
| 13 | EXTRN FIXMES_ARG:word ;an049;bgb | ||
| 14 | EXTRN FATAL_ARG:word | ||
| 15 | EXTRN BADW_ARG:word,FATAL_END:word | ||
| 16 | EXTRN badrw_num:word,BADRW_STR:WORD,HAVFIX:byte | ||
| 17 | EXTRN DIRTYFAT:byte,CROSSCNT:dword,DOFIX:byte,SECONDPASS:byte | ||
| 18 | EXTRN BADSIZ:word,ORPHSIZ:word,ORPHFCB:byte | ||
| 19 | EXTRN HECODE:byte,USERDIR:byte,FRAGMENT:byte | ||
| 20 | EXTRN ORPHEXT:byte,ALLDRV:byte,FIXMFLG:byte,DIRCHAR:byte | ||
| 21 | EXTRN EOFVAL:word,BADVAL:word | ||
| 22 | extrn fTrunc:BYTE | ||
| 23 | CONST ENDS | ||
| 24 | |||
| 25 | DATA SEGMENT PUBLIC PARA 'DATA' | ||
| 26 | extrn fatcnt:byte, orph_arg:word ;an005;bgb;an049;bgb | ||
| 27 | EXTRN THISDPB:dword,NUL_ARG:byte | ||
| 28 | EXTRN NAMBUF:byte,SRFCBPT:word,FATMAP:word | ||
| 29 | EXTRN MCLUS:word,CSIZE:byte,SSIZE:word | ||
| 30 | EXTRN DSIZE:word,ARG_BUF:byte,ERRCNT:byte | ||
| 31 | EXTRN USERDEV:byte,HARDCH:dword,CONTCH:dword | ||
| 32 | EXTRN ExitStatus:Byte,Read_Write_Relative:Byte | ||
| 33 | extrn bytes_per_sector:word ;an005;bgb | ||
| 34 | extrn fattbl_seg:word, fatsiz:word, paras_per_fat:word ;an005;bgb | ||
| 35 | extrn fatmsg1:word ;an024;bgb | ||
| 36 | extrn fatmsg2:word ;an024;bgb | ||
| 37 | EXTRN dbcs_vector:byte ;an055;bgb | ||
| 38 | EXTRN dbcs_vector_off:word ;an055;bgb | ||
| 39 | EXTRN dbcs_vector_seg:word ;an055;bgb | ||
| 40 | DATA ENDS | ||
| 41 | |||
| 42 | CODE SEGMENT PUBLIC PARA 'CODE' | ||
| 43 | ASSUME CS:DG,DS:DG,ES:DG,SS:DG | ||
| 44 | EXTRN PRINTF_CRLF:NEAR,FCB_TO_ASCZ:NEAR | ||
| 45 | EXTRN PROMPTYN:NEAR,DIRPROC:NEAR | ||
| 46 | EXTRN DOCRLF:NEAR,UNPACK:NEAR,PACK:NEAR | ||
| 47 | EXTRN CHECKNOFMES:NEAR | ||
| 48 | EXTRN multiply_32_bits:near ;an047;bgb | ||
| 49 | extrn nowrite:near, done:near, pack:near, unpack:near | ||
| 50 | extrn promptrecover:near, findchain:near | ||
| 51 | public RECOVER, DoAsk | ||
| 52 | public MAKORPHNAM, NAM0, NAMMADE | ||
| 53 | public GETFILSIZ, NCLUS, GOTEOF, CHKCROSS, RET8 | ||
| 54 | public FATAL, hav_fatal_arg, INT_23, RDONE | ||
| 55 | public Systime ;an005;bgb | ||
| 56 | public int_24 ;an005;bgb | ||
| 57 | public CHECK_DBCS_CHARACTER ;an055;bgb | ||
| 58 | .list | ||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | pathlabl chkproc2 | ||
| 63 | ;***************************************************************************** | ||
| 64 | ; RECOVER - | ||
| 65 | ; free orphans or do chain recovery. Note that if we have NOT been able to | ||
| 66 | ; process the entire tree (due to inability to CHDIR), we temporarily set | ||
| 67 | ; DoFix to FALSE, do the operation, and then reset it. | ||
| 68 | ; | ||
| 69 | ; inputs: si - total number of clusters | ||
| 70 | ; es - points to fatmap | ||
| 71 | ; | ||
| 72 | ; outputs: orphaned clusters are converted to files | ||
| 73 | ; LOGIC | ||
| 74 | ; - display dont fix msg if appropriate | ||
| 75 | ; - display number of lost clusters | ||
| 76 | ; - ask the user if he wants the chains converted to files | ||
| 77 | ;*************************************************************************** | ||
| 78 | RECOVER: | ||
| 79 | mov al,1 | ||
| 80 | xchg al,[fixmflg] | ||
| 81 | or al,al | ||
| 82 | ; $IF Z ; where there any errors found? | ||
| 83 | JNZ $$IF1 | ||
| 84 | cmp [dofix],0 ; yes - is the /f flag off? | ||
| 85 | ; $IF Z ; yes - display the dont fix msg | ||
| 86 | JNZ $$IF2 | ||
| 87 | mov dx,offset dg:FIXMES_arg | ||
| 88 | CALL PRINTf_crlf | ||
| 89 | call DoCRLF ; ;AN000; | ||
| 90 | ; $ENDIF | ||
| 91 | $$IF2: | ||
| 92 | ; $ENDIF | ||
| 93 | $$IF1: | ||
| 94 | CALL DOCRLF | ||
| 95 | CHAINREPORT: | ||
| 96 | ;;;;mov si,orphsiz ;get number of bad clusters found (recover) ;an005;bgb;an049;bgb | ||
| 97 | ;;;;mov [orph_num],si ; Prints "XXX lost clusters found in YYY chains.";an049;bgb | ||
| 98 | call findchain ; On entry SI is the XXX value and the YYY value is | ||
| 99 | mov dx,offset dg:orph_arg ; in orphan-count. | ||
| 100 | call printf_crlf | ||
| 101 | TEST fTrunc,-1 | ||
| 102 | ; $IF NZ | ||
| 103 | JZ $$IF5 | ||
| 104 | XOR AX,AX ; We have truncated the scan. Set DoFix to FALSE, | ||
| 105 | XCHG AL,DoFix ; do the operation and then restore things. | ||
| 106 | PUSH AX | ||
| 107 | CALL PromptRecover | ||
| 108 | POP AX | ||
| 109 | MOV DoFix,AL | ||
| 110 | DoAsk: | ||
| 111 | ; $ELSE | ||
| 112 | JMP SHORT $$EN5 | ||
| 113 | $$IF5: | ||
| 114 | CALL PromptRecover | ||
| 115 | ; $ENDIF | ||
| 116 | $$EN5: | ||
| 117 | return | ||
| 118 | |||
| 119 | |||
| 120 | |||
| 121 | |||
| 122 | |||
| 123 | |||
| 124 | |||
| 125 | |||
| 126 | ;***************************************************************************** | ||
| 127 | ;***************************************************************************** | ||
| 128 | MAKORPHNAM: | ||
| 129 | PUSH SI | ||
| 130 | MOV SI,OFFSET DG:ORPHEXT - 1 | ||
| 131 | NAM0: | ||
| 132 | INC BYTE PTR [SI] | ||
| 133 | CMP BYTE PTR [SI],'9' | ||
| 134 | JLE NAMMADE | ||
| 135 | MOV BYTE PTR [SI],'0' | ||
| 136 | DEC SI | ||
| 137 | JMP NAM0 | ||
| 138 | |||
| 139 | NAMMADE: | ||
| 140 | POP SI | ||
| 141 | RET | ||
| 142 | |||
| 143 | |||
| 144 | |||
| 145 | |||
| 146 | ;***************************************************************************** | ||
| 147 | ; GETFILSIZ - calculate the file size based on the number of clusters. | ||
| 148 | ; | ||
| 149 | ; WARNING!! NOTE!! --> | ||
| 150 | ; | ||
| 151 | ; called by - PROCEDURE NAME | ||
| 152 | ; | ||
| 153 | ; inputs: AX - | ||
| 154 | ; BX - | ||
| 155 | ; CX - | ||
| 156 | ; DX - | ||
| 157 | ; SP - | ||
| 158 | ; BP - | ||
| 159 | ; SI - conatins the starting cluster number | ||
| 160 | ; DI - | ||
| 161 | ; DS - | ||
| 162 | ; ES - | ||
| 163 | ; | ||
| 164 | ; output: AX - low word of the file size | ||
| 165 | ; BX - | ||
| 166 | ; CX - | ||
| 167 | ; DX - hi word of the file size | ||
| 168 | ; SP - | ||
| 169 | ; BP - | ||
| 170 | ; SI - | ||
| 171 | ; DI - | ||
| 172 | ; DS - | ||
| 173 | ; ES - | ||
| 174 | ; | ||
| 175 | ; Regs abused - none | ||
| 176 | ; | ||
| 177 | ;logic: 1. save bx & cx for 32 bit mul | ||
| 178 | ; | ||
| 179 | ; 2. zero out file size results | ||
| 180 | ; | ||
| 181 | ; 3. do for all clusters: | ||
| 182 | ; | ||
| 183 | ; 4. get the next one and inc cluster counter | ||
| 184 | ; | ||
| 185 | ; 5. multiply clusters times sectors per cluster to give | ||
| 186 | ; number of sectors in file. This can be a 2 word value - DX:AX. | ||
| 187 | ; | ||
| 188 | ; 6. multiply the sectors times the number of bytes per sector. This | ||
| 189 | ; yields the number of bytes in the file. | ||
| 190 | ;***************************************************************************** | ||
| 191 | ;SI is start cluster, returns filesize as DX:AX | ||
| 192 | Procedure getfilsiz,near | ||
| 193 | savereg <bx,cx> | ||
| 194 | XOR AX,AX ;zero out low word | ||
| 195 | XOR DX,DX ;zero out high word | ||
| 196 | OR SI,SI ;did we get a zero cluster? | ||
| 197 | ; $if NZ | ||
| 198 | JZ $$IF8 | ||
| 199 | ; $DO ;do for all clusters | ||
| 200 | $$DO9: | ||
| 201 | NCLUS: CALL UNPACK ;find the next cluster | ||
| 202 | XCHG SI,DI ;put output into input for unpack | ||
| 203 | INC AX ;found another cluster | ||
| 204 | CMP SI,[EOFVAL] ;did we find last cluster? | ||
| 205 | ; $leave ae ;yes, so exit loop | ||
| 206 | JAE $$EN9 | ||
| 207 | ;;;;;;;CMP SI,2 | ||
| 208 | ;;;;;;;JAE NCLUS | ||
| 209 | ; $enddo | ||
| 210 | JMP SHORT $$DO9 | ||
| 211 | $$EN9: | ||
| 212 | GOTEOF: | ||
| 213 | MOV BL,[CSIZE] ;get sectors per cluster | ||
| 214 | XOR BH,BH | ||
| 215 | MUL BX ;clusters * secs/cluster = sectors | ||
| 216 | mov bx,dx ;get high num for 32bit mult | ||
| 217 | mov cx,ssize ;cx = word to mult with | ||
| 218 | call multiply_32_bits ;mul bx:ax * cx | ||
| 219 | mov dx,bx ;save high word | ||
| 220 | ; $endif | ||
| 221 | $$IF8: | ||
| 222 | restorereg <bx,cx> | ||
| 223 | return | ||
| 224 | EndProc getfilsiz | ||
| 225 | |||
| 226 | |||
| 227 | |||
| 228 | ;***************************************************************************** | ||
| 229 | ;***************************************************************************** | ||
| 230 | Public Chkcross | ||
| 231 | CHKCROSS: | ||
| 232 | ;Check for Crosslinks, do second pass if any to find pairs | ||
| 233 | MOV SI,word ptr CROSSCNT | ||
| 234 | cmp word ptr crosscnt,0 ;if there is at least one crossed | ||
| 235 | ; $if nz,or | ||
| 236 | JNZ $$LL13 | ||
| 237 | cmp word ptr crosscnt+2,0 | ||
| 238 | ; $if nz | ||
| 239 | JZ $$IF13 | ||
| 240 | $$LL13: | ||
| 241 | CALL DOCRLF ;display another line | ||
| 242 | MOV SecondPass,True ; ; ;AC000; | ||
| 243 | XOR AX,AX ; | ||
| 244 | PUSH AX | ||
| 245 | PUSH AX | ||
| 246 | CALL DIRPROC ;Do it again | ||
| 247 | ; $endif | ||
| 248 | $$IF13: | ||
| 249 | RET8: RET | ||
| 250 | |||
| 251 | |||
| 252 | |||
| 253 | ;***************************************************************************** | ||
| 254 | ;***************************************************************************** | ||
| 255 | FATAL: | ||
| 256 | ;Unrecoverable error | ||
| 257 | mov dx,offset dg:FATAL_arg | ||
| 258 | mov [fatmsg1],bx ;an024;bgb | ||
| 259 | cmp byte ptr [nul_arg],0 | ||
| 260 | jnz hav_fatal_arg | ||
| 261 | mov [fatmsg2],offset dg:fatal_end | ||
| 262 | hav_fatal_arg: | ||
| 263 | CALL PRINTf_crlf | ||
| 264 | MOV DL,[USERDEV] ;At least leave on same drive | ||
| 265 | DOS_Call Set_Default_Drive ; ;AC000; | ||
| 266 | ;MOV AH,EXIT | ||
| 267 | mov ExitStatus,Bad_Exit ;Get return code ;AC000; | ||
| 268 | ;INT 21H | ||
| 269 | ret ;Ret Main_Init for common exit | ||
| 270 | |||
| 271 | |||
| 272 | |||
| 273 | |||
| 274 | ;***************************************************************************** | ||
| 275 | ;***************************************************************************** | ||
| 276 | iNT_24 PROC FAR | ||
| 277 | aSSUME DS:NOTHING,ES:NOTHING,SS:NOTHING | ||
| 278 | PUSHF | ||
| 279 | push ax ;Save AX register ;AN000; | ||
| 280 | test al,Disk_Error ;Is it a disk critical err? | ||
| 281 | ; $IF Z ;Yes | ||
| 282 | JNZ $$IF15 | ||
| 283 | mov ax,di ;Get error (DI low) ;AN000; | ||
| 284 | cmp al,Write_Protect ;Special case errors ;AN000; | ||
| 285 | ; $IF E,OR ;If write protect or ;AN000; | ||
| 286 | JE $$LL16 | ||
| 287 | cmp al,Drive_Not_Ready ; if drive not ready ;AN000; | ||
| 288 | pop ax ;Balance stack again ;AN000; | ||
| 289 | ; $IF E ; ;AN000; | ||
| 290 | JNE $$IF16 | ||
| 291 | $$LL16: | ||
| 292 | CALL dword ptr HardCh ; let parent's handler decide what to do | ||
| 293 | ; $ELSE ;Other error ;AN000; | ||
| 294 | JMP SHORT $$EN16 | ||
| 295 | $$IF16: | ||
| 296 | pop ax ;balance stack ;AN000; | ||
| 297 | mov al,Critical_Error_Fail ;Fail the operation ;AN000; | ||
| 298 | ; $ENDIF ; ;AN000; | ||
| 299 | $$EN16: | ||
| 300 | ; $ELSE ;Not disk error | ||
| 301 | JMP SHORT $$EN15 | ||
| 302 | $$IF15: | ||
| 303 | CALL dword ptr HardCh ; let parent's handler decide what to do | ||
| 304 | ; $ENDIF | ||
| 305 | $$EN15: | ||
| 306 | CMP AL,2 ;Abort? ;AC000; | ||
| 307 | ; $IF E ;Yes ;AC000; | ||
| 308 | JNE $$IF21 | ||
| 309 | STI ;Turn off Interrupts | ||
| 310 | CALL DONE ;Forget about directory, restore users drive | ||
| 311 | mov ExitStatus,Bad_Exit ;Get return code ;AN000; | ||
| 312 | ; $ENDIF ;AN000; | ||
| 313 | $$IF21: | ||
| 314 | IRET | ||
| 315 | iNT_24 ENDP | ||
| 316 | |||
| 317 | |||
| 318 | |||
| 319 | |||
| 320 | ;***************************************************************************** | ||
| 321 | ;***************************************************************************** | ||
| 322 | INT_23 proc far | ||
| 323 | STI | ||
| 324 | LDS DX,[HARDCH] | ||
| 325 | mov al,24h ; ;AC000; | ||
| 326 | DOS_Call Set_Interrupt_Vector ; ;AC000; | ||
| 327 | LDS DX,cs:[CONTCH] ;ac039;bgb | ||
| 328 | mov al,23h ; ;AC000; | ||
| 329 | DOS_Call Set_Interrupt_Vector ; ;AC000; | ||
| 330 | PUSH CS | ||
| 331 | POP DS | ||
| 332 | ASSUME DS:DG | ||
| 333 | MOV [FRAGMENT],0 | ||
| 334 | RDONE: | ||
| 335 | CALL NOWRITE ;Restore users drive and directory | ||
| 336 | ;MOV AH,EXIT | ||
| 337 | ;MOV AL,0FFH | ||
| 338 | ;INT 21H | ||
| 339 | mov ExitStatus,Bad_Exit ;Get return code ;AC000; | ||
| 340 | stc | ||
| 341 | ret ;Ret for common exit ;AN000; | ||
| 342 | int_23 endp | ||
| 343 | |||
| 344 | |||
| 345 | |||
| 346 | |||
| 347 | |||
| 348 | ;***************************************************************************** | ||
| 349 | ;***************************************************************************** | ||
| 350 | ; | ||
| 351 | ; Systime returns the current date in AX, current time in DX | ||
| 352 | ; AX - HHHHHMMMMMMSSSSS hours minutes seconds/2 | ||
| 353 | ; DX - YYYYYYYMMMMDDDDD years months days | ||
| 354 | ; | ||
| 355 | public Systime | ||
| 356 | Systime: | ||
| 357 | DOS_Call Get_Time ; ;AC000; | ||
| 358 | SHL CL,1 ;Minutes to left part of byte | ||
| 359 | SHL CL,1 | ||
| 360 | SHL CX,1 ;Push hours and minutes to left end | ||
| 361 | SHL CX,1 | ||
| 362 | SHL CX,1 | ||
| 363 | SHR DH,1 ;Count every two seconds | ||
| 364 | OR CL,DH ;Combine seconds with hours and minutes | ||
| 365 | MOV DX,CX | ||
| 366 | PUSH DX ; Save time | ||
| 367 | ; | ||
| 368 | ; WARNING! MONTH and YEAR must be adjacently allocated | ||
| 369 | ; | ||
| 370 | DOS_Call Get_Date ; ;AC000; | ||
| 371 | SUB CX, 1980 | ||
| 372 | MOV AX, CX | ||
| 373 | MOV CL, 4 | ||
| 374 | SHL AL, CL ; Push year to left for month | ||
| 375 | OR AL, DH ; move in month | ||
| 376 | MOV CL,4 | ||
| 377 | SHL AX,CL ;Push month to left to make room for day | ||
| 378 | SHL AX,1 | ||
| 379 | OR AL, DL | ||
| 380 | POP DX ; Restore time | ||
| 381 | XCHG AX, DX ; Switch time and day | ||
| 382 | return | ||
| 383 | |||
| 384 | |||
| 385 | ;***************************************************************************** ;an055;bgb | ||
| 386 | ;Routine name: Check_DBCS_CharACter ;an055;bgb | ||
| 387 | ;***************************************************************************** ;an055;bgb | ||
| 388 | ; ;an055;bgb | ||
| 389 | ;Description: Check if specified byte is in rANges of DBCS vectors ;an055;bgb | ||
| 390 | ; ;an055;bgb | ||
| 391 | ;Called Procedures: None ;an055;bgb | ||
| 392 | ; ;an055;bgb | ||
| 393 | ;ChANge History: Created 6/12/87 MT ;an055;bgb | ||
| 394 | ; ;an055;bgb | ||
| 395 | ;Input: AL = CharACter to check for DBCS lead charACter ;an055;bgb | ||
| 396 | ; DBCS_Vector = YES/NO ;an055;bgb | ||
| 397 | ; ;an055;bgb | ||
| 398 | ;Output: CY set if DBCS charACter ;an055;bgb | ||
| 399 | ; DBCS_VECTOR = YES ;an055;bgb | ||
| 400 | ; ;an055;bgb | ||
| 401 | ; ;an055;bgb | ||
| 402 | ;Psuedocode ;an055;bgb | ||
| 403 | ;---------- ;an055;bgb | ||
| 404 | ; Save registers ;an055;bgb | ||
| 405 | ; IF DBCS vector not found ;an055;bgb | ||
| 406 | ; Get DBCS environmental vector (INT 21h ;an055;bgb | ||
| 407 | ; Point at first set of vectors ;an055;bgb | ||
| 408 | ; ENDIF ;an055;bgb | ||
| 409 | ; SEARCH ;an055;bgb | ||
| 410 | ; LEAVE End of DBCS vectors ;an055;bgb | ||
| 411 | ; EXITIF CharACter > X1,AND (X1,Y1) are environment vectors ;an055;bgb | ||
| 412 | ; EXITIF CharACter < Y1 ;an055;bgb | ||
| 413 | ; STC (DBCS charACter) ;an055;bgb | ||
| 414 | ; ORELSE ;an055;bgb | ||
| 415 | ; Inc pointer to next set of vectors ;an055;bgb | ||
| 416 | ; ENDLOOP ;an055;bgb | ||
| 417 | ; CLC (Not DBCS charACter) ;an055;bgb | ||
| 418 | ; ENDSRCH ;an055;bgb | ||
| 419 | ; Restore registers ;an055;bgb | ||
| 420 | ; ret ;an055;bgb | ||
| 421 | ;***************************************************************************** ;an055;bgb | ||
| 422 | DBCS_Vector_Size equ 2 ;an055;bgb | ||
| 423 | end_of_vector equ 0 ;an055;bgb | ||
| 424 | Procedure Check_DBCS_Character ; ;an055;bgb | ||
| 425 | push ds ;Save registers ;an055;bgb | ||
| 426 | push si ; " " " " ;an055;bgb | ||
| 427 | push ax ; " " " " ;an055;bgb | ||
| 428 | ;;;;;;;;push ds ; " " " " ;an055;bgb | ||
| 429 | ;;;;;;;;pop es ;Establish addressability ;an055;bgb | ||
| 430 | cmp byte ptr es:DBCS_VECTOR,Yes ;Have we set this yet? ;an055;bgb | ||
| 431 | ; $IF NE ;Nope ;an055;bgb | ||
| 432 | JE $$IF23 | ||
| 433 | push ax ;Save input charACter ;an055;bgb | ||
| 434 | mov al,0 ;Get DBCS environment vectors ;an055;bgb | ||
| 435 | DOS_Call Hongeul ; " " " " ;an055;bgb | ||
| 436 | mov byte ptr es:DBCS_VECTOR,YES ;Indicate we've got vector ;an055;bgb | ||
| 437 | mov es:DBCS_Vector_Off,si ;Save the vector ;an055;bgb | ||
| 438 | mov ax,ds ; ;an055;bgb | ||
| 439 | mov es:DBCS_Vector_Seg,ax ; ;an055;bgb | ||
| 440 | pop ax ;Restore input charACter ;an055;bgb | ||
| 441 | ; $ENDIF ; for next time in ;an055;bgb | ||
| 442 | $$IF23: | ||
| 443 | mov si,es:DBCS_Vector_Seg ;Get saved vector pointer ;an055;bgb | ||
| 444 | mov ds,si ; ;an055;bgb | ||
| 445 | mov si,es:DBCS_Vector_Off ; ;an055;bgb | ||
| 446 | ; $SEARCH ;Check all the vectors ;an055;bgb | ||
| 447 | $$DO25: | ||
| 448 | cmp word ptr ds:[si],End_Of_Vector ;End of vector table? ;an055;bgb | ||
| 449 | ; $LEAVE E ;Yes, done ;an055;bgb | ||
| 450 | JE $$EN25 | ||
| 451 | cmp al,ds:[si] ;See if char is in vector ;an055;bgb | ||
| 452 | ; $EXITIF AE,AND ;If >= to lower, ANd ;an055;bgb | ||
| 453 | JNAE $$IF25 | ||
| 454 | cmp al,ds:[si+1] ; =< thAN higher rANge ;an055;bgb | ||
| 455 | ; $EXITIF BE ; then DBCS charACter ;an055;bgb | ||
| 456 | JNBE $$IF25 | ||
| 457 | stc ;Set CY to indicate DBCS ;an055;bgb | ||
| 458 | ; $ORELSE ;Not in rANge, check next ;an055;bgb | ||
| 459 | JMP SHORT $$SR25 | ||
| 460 | $$IF25: | ||
| 461 | add si,DBCS_Vector_Size ;Get next DBCS vector ;an055;bgb | ||
| 462 | ; $ENDLOOP ;We didn't find DBCS char ;an055;bgb | ||
| 463 | JMP SHORT $$DO25 | ||
| 464 | $$EN25: | ||
| 465 | clc ;Clear CY for exit ;an055;bgb | ||
| 466 | ; $ENDSRCH ; ;an055;bgb | ||
| 467 | $$SR25: | ||
| 468 | pop ax ;Restore registers ;an055;bgb | ||
| 469 | pop si ; " " " " ;an055;bgb | ||
| 470 | pop ds ;Restore data segment ;an055;bgb | ||
| 471 | ret ; ;an055;bgb | ||
| 472 | Check_DBCS_CharACter endp ; ;an055;bgb | ||
| 473 | |||
| 474 | |||
| 475 | |||
| 476 | pathlabl chkproc2 | ||
| 477 | CODE ENDS | ||
| 478 | END | ||
| 479 | \ No newline at end of file | ||
diff --git a/v4.0/src/CMD/CHKDSK/CHKSEG.INC b/v4.0/src/CMD/CHKDSK/CHKSEG.INC new file mode 100644 index 0000000..d33099d --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/CHKSEG.INC | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | PSP segment public para 'DUMMY' ;an000;bgb | ||
| 2 | PSP ends ;an000;bgb | ||
| 3 | ;an000;bgb | ||
| 4 | data segment public para 'DATA' ;an000;bgb | ||
| 5 | data ends ;an000;bgb | ||
| 6 | ;an000;bgb | ||
| 7 | CONST SEGMENT PUBLIC para 'DATA' ;an000;bgb | ||
| 8 | CONST ENDS ;an000;bgb | ||
| 9 | ;an000;bgb | ||
| 10 | code segment public para 'CODE' ;an000;bgb | ||
| 11 | code ends ;an000;bgb | ||
| 12 | ;an000;bgb | ||
| 13 | cstack segment para stack 'STACK' ;an000;bgb | ||
| 14 | cstack ends ;an000;bgb | ||
| 15 | ;an000;bgb | ||
| 16 | lastseg segment public para 'LAST' ;an000;bgb;AN000;bgb | ||
| 17 | lastseg ends ;this is a pointer to the end of the pgm ;A;an000;bgbN000;bgb | ||
| 18 | ;an000;bgb;AN000;bgb | ||
| 19 | DG GROUP data,const,code,CSTACK,lastseg ;an000;bgb | ||
| 20 | assume cs:dg,ds:dg,ss:dg,es:dg ;an000;bgb | ||
| 21 | \ No newline at end of file | ||
diff --git a/v4.0/src/CMD/CHKDSK/MAKEFILE b/v4.0/src/CMD/CHKDSK/MAKEFILE new file mode 100644 index 0000000..f9859b8 --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/MAKEFILE | |||
| @@ -0,0 +1,94 @@ | |||
| 1 | #************************** makefile for cmd\append *************************** | ||
| 2 | |||
| 3 | msg =..\..\messages | ||
| 4 | dos =..\..\dos | ||
| 5 | inc =..\..\inc | ||
| 6 | hinc =..\..\h | ||
| 7 | |||
| 8 | # | ||
| 9 | ####################### dependencies begin here. ######################### | ||
| 10 | # | ||
| 11 | |||
| 12 | all: chkdsk.com | ||
| 13 | |||
| 14 | chkdsk.ctl: chkdsk.skl \ | ||
| 15 | makefile \ | ||
| 16 | $(msg)\$(COUNTRY).msg | ||
| 17 | |||
| 18 | chkinit.obj: chkinit.asm \ | ||
| 19 | chkequ.inc chkmacro.inc chkparse.inc chkchng.inc \ | ||
| 20 | makefile chkseg.inc \ | ||
| 21 | $(inc)\ioctl.inc | ||
| 22 | |||
| 23 | chkdsk1.obj: chkdsk1.asm \ | ||
| 24 | chkequ.inc chkmacro.inc chkchng.inc \ | ||
| 25 | makefile chkseg.inc chkdata.inc \ | ||
| 26 | $(inc)\dossym.inc $(inc)\sysmsg.inc $(inc)\devsym.inc \ | ||
| 27 | $(inc)\cpmfcb.inc $(inc)\dosmac.inc $(inc)\ioctl.inc \ | ||
| 28 | $(inc)\syscall.inc | ||
| 29 | |||
| 30 | chkdsk2.obj: chkdsk2.asm \ | ||
| 31 | chkequ.inc chkmacro.inc chkchng.inc \ | ||
| 32 | makefile chkseg.inc \ | ||
| 33 | $(inc)\dossym.inc $(inc)\sysmsg.inc $(inc)\devsym.inc \ | ||
| 34 | $(inc)\cpmfcb.inc $(inc)\dosmac.inc $(inc)\ioctl.inc \ | ||
| 35 | $(inc)\syscall.inc | ||
| 36 | |||
| 37 | chkproc.obj: chkproc.asm \ | ||
| 38 | chkequ.inc chkmacro.inc chkchng.inc \ | ||
| 39 | makefile chkseg.inc \ | ||
| 40 | $(inc)\dossym.inc $(inc)\sysmsg.inc $(inc)\devsym.inc \ | ||
| 41 | $(inc)\cpmfcb.inc $(inc)\dosmac.inc $(inc)\ioctl.inc \ | ||
| 42 | $(inc)\syscall.inc | ||
| 43 | |||
| 44 | chkproc2.obj: chkproc2.asm \ | ||
| 45 | chkequ.inc chkmacro.inc chkchng.inc \ | ||
| 46 | makefile chkseg.inc \ | ||
| 47 | $(inc)\dossym.inc $(inc)\sysmsg.inc $(inc)\devsym.inc \ | ||
| 48 | $(inc)\cpmfcb.inc $(inc)\dosmac.inc $(inc)\ioctl.inc \ | ||
| 49 | $(inc)\syscall.inc | ||
| 50 | |||
| 51 | chkdisk.obj: chkdisk.asm \ | ||
| 52 | chkequ.inc chkmacro.inc chkchng.inc \ | ||
| 53 | makefile chkseg.inc \ | ||
| 54 | $(inc)\dossym.inc $(inc)\sysmsg.inc $(inc)\devsym.inc \ | ||
| 55 | $(inc)\cpmfcb.inc $(inc)\dosmac.inc $(inc)\ioctl.inc \ | ||
| 56 | $(inc)\syscall.inc | ||
| 57 | |||
| 58 | chkfat.obj: chkfat.asm \ | ||
| 59 | chkequ.inc chkmacro.inc chkchng.inc \ | ||
| 60 | makefile chkseg.inc \ | ||
| 61 | $(inc)\dossym.inc $(inc)\sysmsg.inc $(inc)\devsym.inc \ | ||
| 62 | $(inc)\cpmfcb.inc $(inc)\dosmac.inc $(inc)\ioctl.inc \ | ||
| 63 | $(inc)\syscall.inc | ||
| 64 | |||
| 65 | chkprmt.obj: chkprmt.asm \ | ||
| 66 | chkequ.inc chkmacro.inc chkchng.inc \ | ||
| 67 | makefile chkseg.inc \ | ||
| 68 | $(inc)\dossym.inc $(inc)\sysmsg.inc $(inc)\devsym.inc \ | ||
| 69 | $(inc)\cpmfcb.inc $(inc)\dosmac.inc $(inc)\ioctl.inc \ | ||
| 70 | $(inc)\syscall.inc | ||
| 71 | |||
| 72 | #chkexec.obj: chkexec.asm \ ;an038;bgb #commented out when received from IBM (mrw) | ||
| 73 | # chkequ.inc chkmacro.inc chkchng.inc \ ;an038;bgb | ||
| 74 | # makefile chkseg.inc \ ;an038;bgb | ||
| 75 | # $(inc)\dossym.inc $(inc)\sysmsg.inc $(inc)\devsym.inc \ ;an038;bgb | ||
| 76 | # $(inc)\cpmfcb.inc $(inc)\dosmac.inc $(inc)\ioctl.inc \ ;an038;bgb | ||
| 77 | # $(inc)\syscall.inc ;an038;bgb | ||
| 78 | |||
| 79 | chkdisp.obj: chkdisp.asm \ | ||
| 80 | chkdsk.ctl \ | ||
| 81 | chkdsk.cla chkdsk.clb chkdsk.clc chkdsk.cld chkdsk.cl1 chkdsk.cl2 \ | ||
| 82 | chkequ.inc chkmacro.inc chkparse.inc chkmsg.inc chkchng.inc \ | ||
| 83 | makefile chkseg.inc \ | ||
| 84 | $(inc)\dossym.inc $(inc)\sysmsg.inc $(inc)\devsym.inc \ | ||
| 85 | $(inc)\cpmfcb.inc $(inc)\dosmac.inc $(inc)\ioctl.inc \ | ||
| 86 | $(inc)\syscall.inc | ||
| 87 | |||
| 88 | |||
| 89 | chkdsk.com: chkdsk1.obj chkdsk2.obj chkproc.obj chkproc2.obj chkprmt.obj \ | ||
| 90 | chkdisk.obj chkfat.obj \ | ||
| 91 | chkinit.obj chkdisp.obj \ | ||
| 92 | chkdsk.lnk makefile | ||
| 93 | link @chkdsk.lnk | ||
| 94 | convert chkdsk.exe | ||
diff --git a/v4.0/src/CMD/CHKDSK/PATHMAC.INC b/v4.0/src/CMD/CHKDSK/PATHMAC.INC new file mode 100644 index 0000000..17d8aea --- /dev/null +++ b/v4.0/src/CMD/CHKDSK/PATHMAC.INC | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | |||
| 2 | ;*********************************************************************** | ||
| 3 | ; NAME: pathlabl | ||
| 4 | ; DESC: creates a public label at the spot it is placed, using the name | ||
| 5 | ; given. | ||
| 6 | ; INPUT: either module name or procedure name | ||
| 7 | ; OUTPUT: public label | ||
| 8 | ; LOGIC: if masm is in pass1 (pass2 will gen dup labels) | ||
| 9 | ; if this label has not been gen before | ||
| 10 | ; then create the label | ||
| 11 | ; - $$A to place at begin of map | ||
| 12 | ; - start means first occurence | ||
| 13 | ; - use module/proc name last | ||
| 14 | ; define this label for creation of 'stop' label | ||
| 15 | ; else create stop label | ||
| 16 | ; - same as start except name | ||
| 17 | ;*********************************************************************** | ||
| 18 | .LALL | ||
| 19 | pathlabl MACRO pnam | ||
| 20 | IF1 ;if pass 1 | ||
| 21 | IFNDEF LBL_&pnam ;switch not defined if first creation | ||
| 22 | $$A_START_&pnam: ;create label | ||
| 23 | PUBLIC $$A_START_&pnam ;make it public | ||
| 24 | LBL_&pnam = 1 ;set switch | ||
| 25 | ELSE ;start label already created | ||
| 26 | $$A_STOP_&pnam: ;create stop label | ||
| 27 | PUBLIC $$A_STOP_&pnam ;make it public | ||
| 28 | ENDIF | ||
| 29 | ENDIF | ||
| 30 | ENDM | ||
| 31 | |||
| 32 | \ No newline at end of file | ||