summaryrefslogtreecommitdiff
path: root/v4.0/src/CMD/CHKDSK/CHKDATA.INC
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/CMD/CHKDSK/CHKDATA.INC')
-rw-r--r--v4.0/src/CMD/CHKDSK/CHKDATA.INC244
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
2CONST 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
47DIRBUF LABEL BYTE ;Entry buffer for searches
48VOLID DB -1,0,0,0,0,0,8 ;Volume ID FCB
49VOLNAM DB 0,"???????????"
50 DB 25 DUP(0)
51
52ALLFILE 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
55ALLDRV DB 0 ;default drive
56 DB "???????????" ;any file name
57 DB 25 DUP (?)
58
59ORPHFCB DB 0,"FILE0000"
60ORPHEXT DB "CHK"
61 DB 25 DUP (?)
62
63fcb_copy db 32 dup (?)
64
65;Non-message data
66
67pFileName DW ? ; pointer
68SWITCHAR DB "/"
69ROOTSTR LABEL BYTE ;use this to change dir to the root
70DIRCHAR DB "\"
71NUL DB 0
72PARSTR DB "..",0
73DOTMES DB ".",0
74DOTENT DB ". "
75DDOTENT DB ".. "
76HECODE DB ?
77FIXMFLG DB 0 ;Flag for printing fixmes
78ERRSUB DW 0 ;Flag for bad subdir error
79FRAGMENT DB 0 ;Flag for extent processing
80DIR_FIX DB 0 ;Flag for changing dir back to users'
81DIRTYFAT 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.
86DIRCNT dd 0 ;# directories ;an049;bgb
87DIRSIZ dw 0 ;# alloc units in dirs ;an049;bgb
88FILCNT dd 0 ;# reg files
89FILSIZ dw 0 ;# alloc units in reg files
90HIDCNT dd 0 ;# hidden files
91HIDSIZ dw 0 ;# alloc units in hid files
92BADSIZ dw 0 ;# alloc units in bad sectors
93ORPHSIZ dw 0 ;# alloc units in orphan files
94LCLUS dw 0 ;# alloc units in lost clusters
95DISPFLG DB 0 ;used by number routines
96CROSSCNT dd 0 ;# crosslinked files (first pass)
97;end of display fields
98;
99temp_dd dd 0 ;temporary double word field for orphcnt;an049;bgb
100SECONDPASS DB 0 ;Pass flag
101HAVFIX DB 0 ;non zero if any fixes
102DOFIX DB 0 ;flag for F switch
103NOISY DB 0 ;flag for V switch
104BIGFAT DB 0 ;0=12 bit FAT, NZ=16bit FAT
105EOFVAL DW 0FF8H ;0FF8 for 12 bit FAT,0FFF8 for 16 bit
106CHAIN_END DW 0FFFH ;0FFF for 12 bit FAT,0FFFF for 16 bit ;AN000;
107BADVAL DW 0FF7H ;0FF7 for 12 bit FAT,0FFF7 for 16 bit
108
109mon_name db 3 dup (?),0
110TCHAR DB 'a'
111USERDIR DB "\",0 ;Users current dir for drive
112 DB (DIRSTRLEN-1) DUP (?)
113CONBUF DB 15,0 ;Input buffer
114 DB 15 DUP (?)
115
116fTrunc DB FALSE ; TRUE => couldn't chdir, no freeing.
117
118badread db " File allocation table bad",0
119CONST ENDS
120
121
122
123
124
125
126
127
128DATA 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
140ifdef 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
144endif ;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
150DBCS_VECTOR DB 0
151DBCS_VECTOR_off dw 0
152DBCS_VECTOR_seg dw 0
153
154ifdef fsexec ;an038;bgb
155Exec_Block Exec_Block_Parms <> ;an038;bgb;an027;bgb
156EXEC_Path db 66 dup(0) ;an038;bgb;an027;bgb
157;These next two should stay togather ;an027;bgb
158; --------------------------------------- ;an027;bgb
159Path_String db "PATH=" ; ;an027;bgb
160Len_Path_String equ $ - Path_String ; ;an027;bgb;AN000;
161;---------------------------------------- ;an027;bgb
162endif ;an038;bgb
163 ;an038;bgb;an027;bgb
164 ;an027;bgb
165;These should stay togather ;an027;bgb
166; --------------------------------------- ;an027;bgb
167 ; ;an027;bgb
168Search_Chkdsk db "KSDKHC" ; ;an027;bgb
169Len_Search_Chkdsk equ $ - Search_Chkdsk ; ;an027;bgb
170Search_Chkdsk_End equ $-1 ;an027;bgb
171 ; ;an027;bgb
172;---------------------------------------- ;an027;bgb
173save_drive db 0 ;determines whether drive specified is valid
174firstfat dw 0 ;sector number of fat ;an005;bgb
175firstsec dw 0 ;sector number of data area ;an047;bgb
176dirsec dw 0 ;sector number of dir area ;an047;bgb
177root_entries dw 0 ;number of entries in root dir ;an047;bgb
178fattbl_seg dw 0 ;segment of the fat-table ;an005;bgb
179sec_count dw 0 ;sectors / 64k
180secs_per_64k dw 0 ;an005;bgb
181paras_per_64k dw 0 ;an005;bgb
182fatsiz dw 0 ;an005;bgb
183paras_per_fat dw 0 ;an005;bgb
184fatcnt db 2 ;number of fats on disk ;an005;bgb
185HARDCH dd ? ;Pointer to real INT 24 handler
186CONTCH DD ? ;Pointer to real INT 23 handler
187THISDPB DD ? ;Pointer to drive DPB
188USERDEV DB ? ;Users current device
189CSIZE DB ? ;Sectors per cluster 1-256
190SSIZE DW ? ;bytes per sector 1-64k
191DSIZE DW ? ;# alloc units on disk
192MCLUS DW ? ;DSIZE + 1
193NAMBUF DB 14 DUP (?) ;Buffer
194DOTSNOGOOD DB ? ;. or .. error flag
195ZEROTRUNC DB ? ;Trimming flag
196ISCROSS DB ? ;Crosslink flag
197OLDCLUS DW ?
198SRFCBPT DW ?
199fatmap DW ? ;segment of fatmap table ;an005;bgb
200end_of_fatmap dw ? ;last mem segment used ;an030;bgb
201SECBUF DW ? ;Offset of sector buffer (in ram)
202ERRCNT DB ? ;Used by FATread and write
203PATH_NAME DB 128 DUP(0)
204FNAME_LEN DW 128
205NUL_ARG DB ?
206ARG1 DW ?
207ARG2 DW ?
208ARG3 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;
215ARG_BUF DB 256 DUP (?)
216TMP_SPC DB 128 DUP (?)
217mon dw ?
218day dw ?
219year dw ?
220mem_size dw ?
221;;;TRANSRC DB "A:CON",0,0 ; Device so we don't hit the drive
222TRANSRC DB "A:\",0,0 ; Device so we don't hit the drive
223Read_Write_Relative Relative_Sector_Buffer <> ; ;AN000;
224
225STACKLIM DW ? ;Stack growth limit
226INTERNATVARS internat_block <>
227 DB (internat_block_max - ($ - INTERNATVARS)) DUP (?)
228
229
230; Structure for Get_Media_Id ;an024;bgb
231SerNumBuf Label Byte ;AN000;S GENERIC_IOCTL buffer ;an024;bgb
232 dw 0 ;AN000;S Info level (set on input) ;an024;bgb
233SerNum 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
236DATA ENDS
237
238 ;an000;bgb
239 ;an000;bgb
240lastseg SEGMENT PUBLIC PARA 'LAST' ;an000;bgb
241 public fattbl ;an000;bgb
242fattbl db 0 ;this is the last thing in the pgm ;an000;bgb;an005;bgb
243lastseg ends ;this is where the fat is put in ram ;an000;bgb
244