diff options
Diffstat (limited to 'v4.0/src/CMD/CHKDSK/CHKDATA.INC')
| -rw-r--r-- | v4.0/src/CMD/CHKDSK/CHKDATA.INC | 244 |
1 files changed, 244 insertions, 0 deletions
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 | |||