1 ; SCCSID = @(#)sf.asm 1.1 85/04/10
2 BREAK <Internal system file table format>
4 ; AN000 version 4.00 Jan. 1988
5 ; AN003 PTM 3680 -- make NAME offset the same as before (<=3.30)
6 ; AN009 PTM 3839 reorder SFT for MS WINDOWS
8 ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
9 ; C A V E A T P R O G R A M M E R ;
17 SFCount DW ? ; number of entries
18 SFTable DW ? ; beginning of array of the following
22 ; system file table entry
26 sf_ref_count DW ? ; number of processes sharing entry
27 ; if FCB then ref count
28 sf_mode DW ? ; mode of access or high bit on if FCB
29 sf_attr DB ? ; attribute of file
30 sf_flags DW ? ;Bits 8-15
31 ; Bit 15 = 1 if remote file
32 ; = 0 if local file or device
33 ; Bit 14 = 1 if date/time is not to be
34 ; set from clock at CLOSE. Set by
35 ; FILETIMES and FCB_CLOSE. Reset by
36 ; other reseters of the dirty bit
38 ; Bit 13 = Pipe bit (reserved)
40 ; Bits 0-7 (old FCB_devid bits)
41 ; If remote file or local file, bit
42 ; 6=0 if dirty Device ID number, bits
44 ; bit 7=0 for local file, bit 7
45 ; =1 for local I/O device
46 ; If local I/O device, bit 6=0 if EOF (input)
48 ; Bit 0=1 if console input device
49 ; Bit 1=1 if console output device
50 ; Bit 2=1 if null device
51 ; Bit 3=1 if clock device
52 sf_devptr DD ? ; Points to DPB if local file, points
53 ; to device header if local device,
54 ; points to net device header if
56 sf_firclus DW ? ; First cluster of file (bit 15 = 0)
57 sf_time DW ? ; Time associated with file
58 sf_date DW ? ; Date associated with file
59 sf_size DD ? ; Size associated with file
60 sf_position DD ? ; Read/Write pointer or LRU count for FCBs
62 ; Starting here, the next 7 bytes may be used by the file system to store an
65 sf_cluspos DW ? ; Position of last cluster accessed
66 sf_dirsec DD ? ; Sector number of directory sector for
68 sf_dirpos DB ? ; Offset of this entry in the above
70 ; End of 7 bytes of file-system specific info.
72 sf_name DB 11 DUP (?) ; 11 character name that is in the
73 ; directory entry. This is used by
74 ; close to detect file deleted and
75 ; disk changed errors.
78 sf_chain DD ? ; link to next SF
82 sf_lstclus DW ? ;AN009; Last cluster accessed
86 sf_fsda EQU BYTE PTR sf_cluspos ;DOS 4.00
87 sf_serial_ID EQU WORD PTR sf_firclus ;DOS 4.00
88 sf_netid EQU BYTE PTR sf_cluspos
89 sf_OpenAge EQU WORD PTR sf_position+2
90 sf_LRU EQU WORD PTR sf_position
92 sf_default_number EQU 5h
95 ; Note that we need to mark an SFT as being busy for OPEN/CREATE. This is
96 ; because an INT 24 may prevent us from 'freeing' it. We mark this as such
97 ; by placing a -1 in the ref_count field.
103 ; mode mask for FCB detection
104 sf_isfcb EQU 1000000000000000B
107 sf_isnet EQU 1000000000000000B
108 sf_close_nodate EQU 0100000000000000B
109 sf_pipe EQU 0010000000000000B
110 sf_no_inherit EQU 0001000000000000B
111 sf_net_spool EQU 0000100000000000B
112 Handle_Fail_I24 EQU 0000000100000000B ;BIT 8 - DISK FULL I24 ERROR
114 ; Local file/device flag masks
115 devid_file_clean EQU 40h ; true if file and not written
116 devid_file_mask_drive EQU 3Fh ; mask for drive number
118 devid_device EQU 80h ; true if a device
119 devid_device_EOF EQU 40h ; true if end of file reached
120 devid_device_raw EQU 20h ; true if in raw mode
121 devid_device_special EQU 10h ; true if special device
122 devid_device_clock EQU 08h ; true if clock device
123 devid_device_null EQU 04h ; true if null device
124 devid_device_con_out EQU 02h ; true if console output
125 devid_device_con_in EQU 01h ; true if consle input
127 ; C A V E A T P R O G R A M M E R ;
128 ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
131 ; structure of devid field as returned by IOCTL is:
133 ; BIT 7 6 5 4 3 2 1 0
134 ; |---|---|---|---|---|---|---|---|
135 ; | I | E | R | S | I | I | I | I |
136 ; | S | O | A | P | S | S | S | S |
137 ; | D | F | W | E | C | N | C | C |
138 ; | E | | | C | L | U | O | I |
139 ; | V | | | L | K | L | T | N |
140 ; |---|---|---|---|---|---|---|---|
141 ; ISDEV = 1 if this channel is a device
142 ; = 0 if this channel is a disk file
146 ; EOF = 0 if End Of File on input
147 ; RAW = 1 if this device is in Raw mode
148 ; = 0 if this device is cooked
149 ; ISCLK = 1 if this device is the clock device
150 ; ISNUL = 1 if this device is the null device
151 ; ISCOT = 1 if this device is the console output
152 ; ISCIN = 1 if this device is the console input
155 ; EOF = 0 if channel has been written
156 ; Bits 0-5 are the block device number for
157 ; the channel (0 = A, 1 = B, ...)
162 devid_SPECIAL EQU 10H
168 devid_block_dev EQU 1Fh ; mask for block device number