INT 21 U - DOS 2+ internal - "SYSVARS" - GET LIST OF LISTS
AH = 52h
Return: ES:BX -> DOS list of lists (see #01627)
Notes: partially supported by OS/2 v1.1 compatibility box (however, most
pointers are FFFFh:FFFFh, LASTDRIVE is FFh, and the NUL header "next"
pointer is FFFFh:FFFFh).
partially supported by the Windows NT DOS box; contains only a
rudimentary Current Directory Structure (see #01645)
on return, ES points at the DOS data segment (see also INT 2F/AX=1203h)
Quarterdeck's suggested check for the use of its DOSDATA.SYS or
DOS-UP.SYS is to test whether the list-of-lists segment is greater
than the segment of the first memory block; a better check for
DOS-UP.SYS is INT 21/AX=2B01h/CX=444Dh (DR-DOS v7 and lDOS may be
misdetected as Quarterdeck's tools if only the segment is compared)
because not all DOS workalikes support all fields in the List of Lists,
applications should ensure that pointers are neither 0000h:0000h
nor FFFFh:FFFFh before using them
Windows for Workgroups 3.11 network and Windows95 set the path to
the local drive and directory even for network drives; in that
case the UNC form \\SERVER\SHARE can be obtained with
INT 21/AX=5F02h or INT 21/AX=5F46h. LapLink RemoteAccess does the
same even for INT 21/AX=5F02h
Windows95 GUI no longer returns the true path for a SUBSTed drive,
but MS-DOS 7.00 does; use INT 21/AH=60h to obtain the true name
SeeAlso: INT 2F/AX=1203h
Format of List of Lists:
Offset Size Description (Table 01627)
-24 WORD (DOS 3.1+) contents of CX from INT 21/AX=5E01h
-22 WORD (DOS ???+) LRU counter for FCB caching
-20 WORD (DOS ???+) LRU counter for FCB opens
-18 DWORD (DOS ???+) address of OEM function handler (see INT 21/AH=F8h)
FFFFh:FFFFh if not installed or not available
-14 WORD (DOS ???+) offset in DOS CS of code to return from INT 21 call
-12 WORD (DOS 3.1+) sharing retry count (see AX=440Bh)
-10 WORD (DOS 3.1+) sharing retry delay (see AX=440Bh)
-8 DWORD (DOS 3.0+) pointer to current disk buffer
-4 WORD (DOS 3.0+) pointer in DOS data segment of unread CON input
when CON is read via a handle, DOS reads an entire line,
and returns the requested portion, buffering the rest
for the next read. 0000h indicates no unread input
-2 WORD segment of first memory control block (see #01628)
00h DWORD pointer to first Drive Parameter Block (see #01395 at AH=32h)
04h DWORD -> first System File Table (see #01639,#01640,#01641,#01642)
08h DWORD pointer to active CLOCK$ device's header (most recently loaded
driver with CLOCK bit set)
0Ch DWORD pointer to active CON device's header (most recently loaded
driver with STDIN bit set)
---DOS 2.x---
10h BYTE number of logical drives in system
11h WORD maximum bytes/block of any block device
13h DWORD pointer to first disk buffer (see #01649,#01650)
17h 18 BYTEs actual NUL device driver header (not a pointer!)
NUL is always the first device on DOS's linked list of device
drivers. (see #01646)
---DOS 3.0---
10h BYTE number of block devices
11h WORD maximum bytes/block of any block device
13h DWORD pointer to first disk buffer (see #01650,#01652)
17h DWORD pointer to array of current directory structures (see #01643)
1Bh BYTE value of LASTDRIVE command in CONFIG.SYS (default 5)
1Ch DWORD pointer to STRING= workspace area
20h WORD size of STRING area (the x in STRING=x from CONFIG.SYS)
22h DWORD pointer to FCB table
26h WORD the y in FCBS=x,y from CONFIG.SYS
28h 18 BYTEs actual NUL device driver header (not a pointer!)
NUL is always the first device on DOS's linked list of device
drivers. (see #01646)
---DOS 3.1-3.3---
10h WORD maximum bytes per sector of any block device
12h DWORD pointer to first disk buffer in buffer chain (see #01650)
16h DWORD pointer to array of current directory structures (see #01643)
1Ah DWORD pointer to system FCB tables (see #01640,#01641,#01642)
1Eh WORD number of protected FCBs (the y in the CONFIG.SYS FCBS=x,y)
20h BYTE number of block devices installed
21h BYTE number of available drive letters (largest of 5, installed
block devices, and CONFIG.SYS LASTDRIVE=). Also size of
current directory structure array.
22h 18 BYTEs actual NUL device driver header (not a pointer!)
NUL is always the first device on DOS's linked list of device
drivers. (see #01646)
34h BYTE number of JOIN'ed drives
---DOS 4.x---
10h WORD maximum bytes per sector of any block device
12h DWORD pointer to disk buffer info record (see #01652,#01653)
Note: although the initialization code in IO.SYS uses this
pointer, MSDOS.SYS does not, instead using the hardcoded
address of the info record
16h DWORD pointer to array of current directory structures
(see #01643,#01644)
1Ah DWORD pointer to system FCB tables (see #01640,#01641,#01642)
1Eh WORD number of protected FCBs (the y in the CONFIG.SYS FCBS=x,y)
(always 00h for DOS 5.0)
20h BYTE number of block devices installed
21h BYTE number of available drive letters; also size of current
directory structure array.
For DOS 4.0-6.0: largest of 5, installed block devices,
and CONFIG.SYS LASTDRIVE=
For DOS 7.x (Windows9X), set to 32 if no LASTDRIVE= or
LASTDRIVEHIGH=, else set to larger of installed block
devices and LASTDRIVE(HIGH)=
22h 18 BYTEs actual NUL device driver header (not a pointer!)
NUL is always the first device on DOS's linked list of device
drivers. (see #01646)
34h BYTE number of JOIN'ed drives
35h WORD pointer within IBMDOS code segment to list of special program
names (see #01662)
(always 0000h for DOS 5.0)
37h DWORD pointer to FAR routine for resident IFS utility functions
(see #01658)
may be called by any IFS driver which does not wish to
service functions 20h or 24h-28h itself
3Bh DWORD pointer to chain of IFS (installable file system) drivers
3Fh WORD the x in BUFFERS x,y (rounded up to multiple of 30 if in EMS)
41h WORD number of lookahead buffers (the y in BUFFERS x,y)
43h BYTE boot drive (1=A:)
44h BYTE flag: 01h to use DWORD moves (80386+), 00h otherwise
45h WORD extended memory size in KB
---DOS 5.0-6.0---
10h 39 BYTEs as for DOS 4.x (above)
37h DWORD pointer to SETVER program list or 0000h:0000h
3Bh WORD (DOS=HIGH) offset in DOS CS of function to fix A20 control
when executing special .COM format
3Dh WORD PSP of most-recently EXECed program if DOS in HMA, 0000h if low
used for maintaining count of INT 21 calls which disable A20
on return
3Fh 8 BYTEs as for DOS 4.x (above)
---Windows NT DOS Box---
10h 6 BYTEs ???
16h DWORD pointer to array of current directory structures (see #01645)
1Ah 6 BYTEs ???
20h BYTE number of block devices installed
21h BYTE number of local drive letters (= installed block devices)
Also size of current directory structure array.
22h 18 BYTEs actual NUL device driver header (not a pointer!)
NUL is always the first device on DOS's linked list of device
drivers. (see #01646)
---DOS 7.x---
10h 55 BYTEs as for DOS 5.0-6.0 (above)
47h 25 BYTEs ???
60h BYTE "DOS_FLAG" (see also INT 26)
Format of DOS memory control block:
Offset Size Description (Table 01628)
00h BYTE block type: 5Ah if last block in chain, otherwise 4Dh
01h WORD PSP segment of owner or special flag value (see #01629)
03h WORD size of memory block in paragraphs
05h 3 BYTEs unused by MS-DOS
(386MAX) if locked-out block, region start/prev region end
---DOS 2.x,3.x---
08h 8 BYTEs unused
---DOS 4.0+ ---
08h 8 BYTEs ASCII program name if PSP memory block or DR DOS UMB,
else garbage
null-terminated if less than 8 characters
--- lDOS S MCB ---
08h 2 BYTEs "S" followed by a NUL byte
0Ah BYTE S MCB type (see #26001)
0Bh BYTE reserved
0Ch WORD "smcbLink", not used yet (planned to be an owner segment)
0Eh WORD reserved
Notes: the next MCB is at segment (current + size + 1)
under DOS 3.1+, the first memory block is the DOS data segment,
containing installable drivers, buffers, etc. Under DOS 4.0+ it is
divided into subsegments, each with its own memory control block
(see #01633), the first of which is at offset 0000h.
for DOS 5+, blocks owned by DOS may have either "SC" or "SD" in bytes
08h and 09h. "SC" is system code or locked-out inter-UMB memory,
"SD" is system data, device drivers, etc.
Some versions of DR DOS use only seven characters of the program name,
placing a NUL in the eighth byte.
lDOS S MCBs are heavily used by lDOS (lMS-DOS and lRxDOS), only device
allocations are still placed into SD MCBs with subsegments.
MS-DOS and FreeDOS set up a fully functional MCB chain later during
processing of config.sys or fdconfig.sys, particularly it is not
yet set up properly during DEVICE= execution
lDOS sets up the MCB chain much earlier (in the function NEARDOSINIT),
before ldos.ini is even opened and read. allocations like the init
PSP, init CDS, init program, early DOSDATA and DOSCODE, device
drivers, and UPBs and DPBs all use valid MCBs.
it is reported that some versions of command.com free memory blocks
used transiently from code running in those very blocks, thus
running in free memory for a bit after this point.
SeeAlso: #01630,#01632,#01633
(Table 01629)
Values for special flag PSP segments:
0000h free
0006h DR DOS XMS UMB
0007h DR DOS excluded upper memory ("hole")
0008h belongs to DOS (name in MS-DOS v5+ "SD" or "SC", lDOS also "S")
FFF7h 386MAX v6.01+ ???
FFFAh 386MAX UMB control block (see #01477 at AX=4402h"386MAX")
FFFDh 386MAX locked-out memory
FFFEh 386MAX UMB (normally immediately follows its control block)
FFFFh 386MAX v6.01+ device driver
(Table 26001)
Values for lDOS S MCB type:
00h ? S_OTHER
01h S_DOSENTRY (usually at segment 60h, may be hidden)
02h* S_DOSCODE
03h S_DOSDATA (may be hidden, refer to INT 2F/AX=1203h)
04h S_IRQSCODE
05h ? S_IRQSDATA
06h* S_CDS
07h ? S_LFNCDS (lRxDOS remainder, not used by lMS-DOS)
08h* S_DPB
09h* S_UPB (aka DDT, UDSC, BDS)
0Ah* S_SFT
0Bh* S_FCBSFT
0Ch* S_CCB (buffers, name from lRxDOS "Cache Control Buffers")
0Dh ? S_IRT
0Eh ? S_SECTOR
0Fh ? S_NLS
10h ? S_EBDA
16h S_INITFCBSFT
17h S_INITSTACK
18h S_INITCDS
19h S_INITCONFIG
1Ah ? S_INITFATSEG
1Bh ? S_INITSECTORSEG
1Ch ? S_INITSTACKBPB
1Dh S_INITPSP
1Eh ? S_ENVIRONMENT
1Fh S_INITIALISE
20h ? S_DEVICE "Device"
21h ? S_DEVICEMEMORY "Allocated by device"
30h S_EXCLDUMA Excluded UMA
31h ? S_EXCLDUMASUB "Excluded UMA with sub-chain of used MCBs"
32h ? S_EXCLDLH "Excluded by LH"
33h ? S_EXCLDDOS
34h S_EXCLDALTAH COMPAT=ALTAH allocation for DOSENTRY
Notes: '*' indicates that this type of allocation may be allocated
in the HMA if the kernel has claimed it, explaining their
absence in the LMCB and UMCB chains.
'?' indicates that these types are not currently used by the
lMS-DOS based lDOS kernel.
Format of MS-DOS 5+ UMB control block:
Offset Size Description (Table 01630)
00h BYTE type: 5Ah if last block in chain, 4Dh otherwise
01h WORD first available paragraph in UMB if control block at start
of UMB, 000Ah if control block at end of UMB
03h WORD length in paragraphs of following UMB or locked-out region
05h 3 BYTEs unused
08h 8 BYTEs block type name: "UMB" if start block, "SM" if end block in UMB
SeeAlso: #01628,#01631
Format of MS-DOS v7+ HMA memory control block:
Offset Size Description (Table 01631)
00h WORD signature "MS" (4Dh 53h)
02h WORD owner / usage flag???
0000h free
else ???
lDOS: FFFEh = DOSCODE, 0026h = DOS kernel allocation
04h WORD size of memory block in bytes (not counting MCB)
06h WORD offset of next memory block in HMA or 0000h
08h 8 BYTEs unused (0)
--- lDOS ---
08h 8 BYTEs allocation name, padded with NULs if shorter than 8 BYTEs
SeeAlso: #01628,#01630,#01632,#02800
Format of STARLITE (General Software's Embedded DOS) memory control block:
Offset Size Description (Table 01632)
00h BYTE block type: 5Ah if last block in chain, otherwise 4Dh
01h WORD PSP segment of owner, 0000h if free, 0008h if belongs to DOS
03h WORD size of memory block in paragraphs
05h BYTE unused
06h WORD segment address of next memory control block (0000h if last)
08h WORD segment address of previous memory control block or 0000h
0Ah 6 BYTEs reserved
Format of DOS 4.0+ data segment subsegment control blocks:
Offset Size Description (Table 01633)
00h BYTE subsegment type (blocks typically appear in this order)
"D" device driver
"E" device driver appendage
"I" IFS (Installable File System) driver
(MS-DOS 7) high-loaded drive data table array (see #02603)
"F" FILES= control block storage area (for FILES>5)
"X" FCBS= control block storage area, if present
"C" BUFFERS EMS workspace area (if BUFFERS /X option used)
"B" BUFFERS= storage area
"L" LASTDRIVE= current directory structure array storage area
"S" STACKS= code and data area, if present (see #01634,#01635)
"T" INSTALL= transient code
01h WORD paragraph of subsegment start (usually the next paragraph)
03h WORD size of subsegment in paragraphs
05h 3 BYTEs unused
08h 8 BYTEs for types "D" and "I", base name of file from which the driver
was loaded (unused for other types)
Format of data at start of STACKS code segment (if present):
Offset Size Description (Table 01634)
00h WORD ???
02h WORD number of stacks (the x in STACKS=x,y)
04h WORD size of stack control block array (should be 8*x)
06h WORD size of each stack (the y in STACKS=x,y)
08h DWORD pointer to STACKS data segment
0Ch WORD offset in STACKS data segment of stack control block array
0Eh WORD offset in STACKS data segment of last element of that array
10h WORD offset in STACKS data segment of the entry in that array for
the next stack to be allocated (initially same as value in
0Eh and works its way down in steps of 8 to the value in
0Ch as hardware interrupts pre-empt each other)
Notes: the STACKS code segment data may, if present, be located as follows:
DOS 3.2: The code segment data is at a paragraph boundary fairly early
in the IBMBIO segment (seen at 0070:0190h)
DOS 3.3: The code segment is at a paragraph boundary in the DOS data
segment, which may be determined by inspecting the segment
pointers of the vectors for those of interrupts 02h, 08h-0Eh,
70h, 72-77h which have not been redirected by device drivers
or TSRs.
DOS 4.0+ Identified by sub-segment control block type "S" within the DOS
data segment.
SeeAlso: #01636,INT B4"STACKMAN"
Format of array elements in STACKS data segment:
Offset Size Description (Table 01635)
00h BYTE status: 00h=free, 01h=in use, 03h=corrupted by overflow of
higher stack.
01h BYTE not used
02h WORD previous SP
04h WORD previous SS
06h WORD ptr to word at top of stack (new value for SP). The word at the
top of the stack is preset to point back to this control
block.
Format of SHARE.EXE hooks (DOS 3.1-6.00):
Offset Size Description (Table 01636)
(offsets from first system file table--pointed at by ListOfLists+04h)
-3Ch DWORD pointer to FAR routine for ???
Note: not called by MS-DOS 3.3, set to 0000h:0000h by
SHARE 3.3+
-38h DWORD pointer to FAR routine called on opening file
on call, internal DOS location points at filename
(see #01687 at AX=5D06h)
Return: CF clear if successful
CF set on error
AX = DOS error code (24h)
(see #01680 at AH=59h/BX=0000h)
Note: SHARE directly accesses DOS-internal data to get name of
file just opened
-34h DWORD pointer to FAR routine called on closing file
ES:DI -> system file table
Note: does something to every Record Lock Record for file
-30h DWORD pointer to FAR routine to close all files for given computer
(called by AX=5D03h)
-2Ch DWORD pointer to FAR routine to close all files for given process
(called by AX=5D04h)
-28h DWORD pointer to FAR routine to close file by name
(called by AX=5D02h)
DS:SI -> DOS parameter list (see #01686 at AX=5D00h)
DPL's DS:DX -> name of file to close
Return: CF clear if successful
CF set on error
AX = DOS error code (03h)
(see #01680 at AH=59h/BX=0000h)
-24h DWORD pointer to FAR routine to lock region of file
call with BX = file handle
---DOS 3.x---
CX:DX = starting offset
SI:AX = size
---DOS 4.0+ ---
DS:DX -> lock range
DWORD start offset
DWORD size in bytes
Return: CF set on error
AL = DOS error code (21h) (see #01680 at AH=59h)
Note: not called if file is marked as remote
-20h DWORD pointer to FAR routine to unlock region of file
call with BX = file handle
---DOS 3.x---
CX:DX = starting offset
SI:AX = size
---DOS 4.0+ ---
DS:DX -> lock range
DWORD start offset
DWORD size in bytes
Return: CF set on error
AL = DOS error code (21h) (see #01680 at AH=59h)
Note: not called if file is marked as remote
-1Ch DWORD pointer to FAR routine to check if file region is locked
call with ES:DI -> system file table entry for file
CX = length of region from current position in file
Return: CF set if any portion of region locked
AX = 0021h
-18h DWORD pointer to FAR routine to get open file list entry
(called by AX=5D05h)
call with DS:SI -> DOS parameter list (see #01686 at AX=5D00h)
DPL's BX = index of sharing record
DPL's CX = index of SFT in SFT chain of sharing rec
Return: CF set on error or not loaded
AX = DOS error code (12h) (see #01680 at AH=59h)
CF clear if successful
ES:DI -> filename
CX = number of locks owned by specified SFT
BX = network machine number
DX destroyed
-14h DWORD pointer to FAR routine for updating FCB from SFT???
call with DS:SI -> unopened FCB
ES:DI -> system file table entry
Return: BL = C0h???
Note: copies following fields from SFT to FCB:
starting cluster of file 0Bh 1Ah
sharing record offset 33h 1Ch
file attribute 04h 1Eh
-10h DWORD pointer to FAR routine to get first cluster of FCB file ???
call with ES:DI -> system file table entry
DS:SI -> FCB
Return: CF set if SFT closed or sharing record offsets
mismatched
CF clear if successful
BX = starting cluster number from FCB
-0Ch DWORD pointer to FAR routine to close file if duplicate for process
DS:SI -> system file table
Return: AX = number of handle in JFT which already uses SFT
Note: called during open/create of a file
Note: if SFT was opened with inheritance enabled and sharing
mode 111, does something to all other SFTs owned by
same process which have the same file open mode and
sharing record
-08h DWORD pointer to FAR routine for closing file
Note: closes various handles referring to file most-recently
opened
-04h DWORD pointer to FAR routine to update directory info in related SFT
entries
call with ES:DI -> system file table entry for file (see #01641)
AX = subfunction (apply to each related SFT)
00h: update time stamp (offset 0Dh) and date
stamp (offset 0Fh)
01h: update file size (offset 11h) and starting
cluster (offset 0Bh). Sets last-accessed
cluster fields to start of file if file
never accessed
02h: as function 01h, but last-accessed fields
always changed
03h: do both functions 00h and 02h
Note: follows ptr at offset 2Bh in system file table entries
Note: NOP if opened with no-inherit or via FCB
Notes: most of the above hooks (except -04h, -14h, -18h, and -3Ch) assume
either that SS=DOS DS or SS=DS=DOS DS and directly access
DOS-internal data
sharing hooks are not supported by DR DOS 5-6; they appear to be
supported by Novell DOS 7, with a segment of 0000h indicating the
DOS data segment
SeeAlso: #01637,#01638
Format of sharing record:
Offset Size Description (Table 01637)
00h BYTE flag
00h free block
01h allocated block
FFh end marker
01h WORD size of block
03h BYTE checksum of pathname (including NUL)
if sum of ASCII values is N, checksum is (N/256 + N%256)
04h WORD offset in SHARE's DS of first Record Lock Record (see #01638)
06h DWORD pointer to start of system file table chain for file
0Ah WORD unique sequence number
0Ch var ASCIZ full pathname
Notes: not supported by DR DOS SHARE 1.1 and 2.0; will reportedly be
supported by Novell DOS 7
SeeAlso: #01636,#01638
Format of SHARE.EXE Record Lock Record:
Offset Size Description (Table 01638)
00h WORD offset in SHARE's DS of next lock table in list or 0000h
02h DWORD offset in file of start of locked region
06h DWORD offset in file of end of locked region
0Ah DWORD pointer to System File Table entry for this file
0Eh WORD PSP segment of lock's owner
---DOS 5+ ---
10h WORD lock type: (00h lock all, 01h lock writes only)
SeeAlso: #01636,#01637,#01639,#01642
Format of DOS 2.x system file tables:
Offset Size Description (Table 01639)
00h DWORD pointer to next file table (offset FFFFh if last)
04h WORD number of files in this table
06h 28h bytes per file
Offset Size Description
00h BYTE number of file handles referring to this file
01h BYTE file open mode (see #01402 at AH=3Dh)
02h BYTE file attribute
03h BYTE drive (0 = character device, 1 = A, 2 = B, etc)
04h 11 BYTEs filename in FCB format (no path,no period,blank-padded)
0Fh WORD ???
11h WORD ???
13h DWORD file size???
17h WORD file date in packed format (see #01666 at AX=5700h)
19h WORD file time in packed format (see #01665 at AX=5700h)
1Bh BYTE device attribute (see #01423 at AX=4400h)
---character device---
1Ch DWORD pointer to device driver
---block device---
1Ch WORD starting cluster of file
1Eh WORD relative cluster in file of last cluster accessed
------
20h WORD absolute cluster number of current cluster
22h WORD ???
24h DWORD current file position???
SeeAlso: #01640,#01641,#01642,#26003,#26004,#26005
Format of DOS 3.0 system file tables and FCB tables:
Offset Size Description (Table 01640)
00h DWORD pointer to next file table (offset FFFFh if last)
04h WORD number of files in this table
06h 38h bytes per file
Offset Size Description
00h-1Eh as for DOS 3.1+ (see #01641)
1Fh WORD byte offset of directory entry within sector
21h 11 BYTEs filename in FCB format (no path/period, blank-padded)
2Ch DWORD (SHARE.EXE) pointer to previous SFT sharing same file
30h WORD (SHARE.EXE) network machine number which opened file
(Windows Enhanced mode DOSMGR uses the virtual machine
ID as the machine number; see INT 2F/AX=1683h)
32h WORD PSP segment of file's owner (first three entries for
AUX/CON/PRN contain segment of IO.SYS startup code)
34h WORD (SHARE.EXE) offset in SHARE code seg of share record
36h WORD ??? apparently always 0000h
SeeAlso: #01639,#01641,#01642,#26003,#26004,#26005
Format of DOS 3.1-3.3x, DR DOS 5.0-6.0 system file tables and FCB tables:
Offset Size Description (Table 01641)
00h DWORD pointer to next file table (offset FFFFh if last)
04h WORD number of files in this table
06h 35h bytes per file
Offset Size Description
00h WORD number of file handles referring to this file
02h WORD file open mode (see AX=6C00h, #01402 at AH=3Dh)
bit 15 set if this file opened via FCB
04h BYTE file attribute (see #01420 at AX=4301h)
05h WORD device info word (see #01423 at AX=4400h)
bit 15 set if remote file
bit 14 set means do not set file date/time on closing
bit 12 set means don't inherit on EXEC
bits 5-0 drive number for disk files
07h DWORD pointer to device driver header if character device
else pointer to DOS Drive Parameter Block
(see #01395 at AH=32h)
0Bh WORD starting cluster of file
0Dh WORD file time in packed format (see #01665 at AX=5700h)
not used for character devices in DR DOS
0Fh WORD file date in packed format (see #01666 at AX=5700h)
not used for character devices in DR DOS
11h DWORD file size
---system file table---
15h DWORD current offset in file (may be larger than size of
file; INT 21/AH=42h does not check new position)
---FCB table---
15h WORD counter for last I/O to FCB
17h WORD counter for last open of FCB
(these are separate to determine the times of the
latest I/O and open)
---
19h WORD relative cluster within file of last cluster accessed
1Bh WORD absolute cluster number of last cluster accessed
0000h if file never read or written???
1Dh WORD number of sector containing directory entry
(see #01352)
1Fh BYTE number of dir entry within sector (byte offset/32)
20h 11 BYTEs filename in FCB format (no path/period, blank-padded)
2Bh DWORD (SHARE.EXE) pointer to previous SFT sharing same file
2Fh WORD (SHARE.EXE) network machine number which opened file
(Windows Enhanced mode DOSMGR uses the virtual machine
ID as the machine number; see INT 2F/AX=1683h)
31h WORD PSP segment of file's owner (see #01378 at AH=26h)
(first three entries for AUX/CON/PRN contain segment
of IO.SYS startup code)
33h WORD offset within SHARE.EXE code segment of
sharing record (see #01637) 0000h = none
SeeAlso: #01639,#01640,#01642,#26003,#26004,#26005
Format of MS-DOS v4.00 to v6.22 system file tables and FCB tables:
Offset Size Description (Table 01642)
00h DWORD pointer to next file table (offset FFFFh if last)
04h WORD number of files in this table
06h 3Bh bytes per file
Offset Size Description
00h WORD number of file handles referring to this file
FFFFh if in use but not referenced
02h WORD file open mode (see AX=6C00h,#01402 at AH=3Dh)
bit 15 set if this file opened via FCB
04h BYTE file attribute (see #01420 at AX=4301h)
05h WORD device info word (see also #01423 at AX=4400h)
bit 15 set if remote file
bit 14 set means do not set file date/time on closing
bit 13 set if named pipe
bit 12 set if no inherit
bit 11 set if network spooler
bit 8 "Handle_Fail_I24", MS-DOS v4 AX=4401h can set
bit 7 set if device, clear if file (only if local)
bits 6-0 as for AX=4400h
07h DWORD pointer to device driver header if character device
else pointer to DOS Drive Parameter Block
(see #01395 at AH=32h) or REDIR data
0Bh WORD starting cluster of file (local files only)
0Dh WORD file time in packed format (see #01665)
0Fh WORD file date in packed format (see #01666)
11h DWORD file size
15h DWORD current offset in file (SFT)
LRU counters (FCB table, two WORDs)
---local file---
19h WORD relative cluster within file of last cluster accessed
1Bh DWORD number of sector containing directory entry
1Fh BYTE number of dir entry within sector (byte offset/32)
---network redirector---
19h DWORD pointer to REDIRIFS record
1Dh 3 BYTEs ???
------
20h 11 BYTEs filename in FCB format (no path/period, blank-padded)
2Bh DWORD (SHARE.EXE) pointer to previous SFT sharing same file
2Fh WORD (SHARE.EXE) network machine number which opened file
(Windows Enhanced mode DOSMGR uses the virtual machine
ID as the machine number; see INT 2F/AX=1683h)
31h WORD PSP segment of file's owner (see #01378 at AH=26h)
(first three entries for AUX/CON/PRN contain segment
of IO.SYS startup code)
33h WORD offset within SHARE.EXE code segment of
sharing record (see #01595) 0000h = none
35h WORD (local) absolute cluster number of last cluster accessed
(redirector) ???
37h DWORD pointer to IFS driver for file, 0000000h if native DOS
Notes: the OS/2 2.0 DOS Boot Session does not properly fill in the filename
field due to incomplete support for SFTs; the OS/2 2.0 DOS Window
does not appear to support SFTs at all
the first SFT container at DOSDATA:00CCh contains 5 entries
SeeAlso: #01639,#01640,#01641,#26003,#26004,#26005
Format of MS-DOS v7.10 and FAT32 FreeDOS system file tables and FCB tables:
Offset Size Description (Table 26003)
00h DWORD pointer to next file table (offset FFFFh if last)
04h WORD number of files in this table
06h 3Bh bytes per file
Offset Size Description
00h WORD number of file handles referring to this file
FFFFh if in use but not referenced (the FFFFh busy
marker is not used by FreeDOS)
02h WORD file open mode (see AX=6C00h,#01402 at AH=3Dh)
bit 15 set if this file opened via FCB
04h BYTE file attribute (see #01420 at AX=4301h)
05h WORD device info word (see also #01423 at AX=4400h)
bit 15 set if remote file
bit 14 set means do not set file date/time on closing
bit 13 set if named pipe
bit 12 set if no inherit
bit 11 set if network spooler
bit 7 set if device, clear if file (only if local)
bits 6-0 as for AX=4400h
07h DWORD pointer to device driver header if character device
else pointer to DOS Drive Parameter Block
(see #01395 at AH=32h) or REDIR data
0Bh WORD high part of relative cluster within file
0Dh WORD file time in packed format (see #01665)
0Fh WORD file date in packed format (see #01666)
11h DWORD file size
15h DWORD current offset in file (SFT)
LRU counters (FCB table, two WORDs)
---local file---
19h WORD low part of relative cluster within file
1Bh DWORD number of sector containing directory entry
1Fh BYTE number of dir entry within sector (byte offset/32)
---network redirector---
19h DWORD pointer to REDIRIFS record
1Dh 3 BYTEs ???
------
20h 11 BYTEs filename in FCB format (no path/period, blank-padded)
2Bh DWORD starting cluster of file
2Fh WORD (SHARE.EXE) network machine number which opened file
(Windows Enhanced mode DOSMGR uses the virtual machine
ID as the machine number; see INT 2F/AX=1683h)
31h WORD PSP segment of file's owner (see #01378 at AH=26h)
(first three entries for AUX/CON/PRN contain segment
of IO.SYS startup code)
33h WORD offset within SHARE.EXE code segment of
sharing record (see #01595) 0000h = none
35h DWORD absolute cluster number of last cluster accessed
39h WORD padding
Notes: start cluster of MS-DOS v6 at offset 0Bh is now high part of the
relative cluster in file
sharer pointer to next SFT in MS-DOS v6 is now file start cluster
low word of IFS pointer in MS-DOS v6 is now high word of absolute
cluster number in file
MS-DOS v7.10 and FreeDOS use directory entry sector, not cluster
the first SFT container at DOSDATA:00CCh contains 5 entries
SeeAlso: #01639,#01640,#01641,#01642,#26005
Format of FAT32 and FAT+ enabled build of Enhanced DR-DOS v7.01.08
(including lDOS flavour) system file tables and FCB tables:
Offset Size Description (Table 26004)
00h DWORD pointer to next file table (offset FFFFh if last)
04h WORD number of files in this table
06h 4Bh bytes per file
Offset Size Description
00h WORD number of file handles referring to this file
FFFFh if in use but not referenced
02h WORD file open mode (see AX=6C00h,#01402 at AH=3Dh)
bit 15 set if this file opened via FCB
04h BYTE file attribute (see #01420 at AX=4301h)
05h WORD device info word (see also #01423 at AX=4400h)
bit 15 set if remote file
bit 14 set means do not set file date/time on closing
bit 13 set if named pipe
bit 12 set if no inherit
bit 11 set if network spooler
bit 7 set if device, clear if file (only if local)
bits 6-0 as for AX=4400h
07h DWORD pointer to device driver header if character device
else pointer to DOS Drive Parameter Block
(see #01395 at AH=32h) or REDIR data
0Bh WORD low word of starting cluster of file
0Dh WORD file time in packed format (see #01665)
0Fh WORD file date in packed format (see #01666)
11h DWORD low dword of file size
15h DWORD low dword of current offset in file (SFT)
LRU counters (FCB table, two WORDs)
---local file---
19h WORD low word of relative cluster within file
1Bh WORD low word of cluster number of directory entry
1Dh BYTE padding
1Eh BYTE high byte of dir entry number within cluster
1Fh BYTE low byte of dir entry number within cluster (byte offset/32)
---network redirector---
19h DWORD pointer to REDIRIFS record
1Dh 3 BYTEs ???
------
20h 11 BYTEs filename in FCB format (no path/period, blank-padded)
2Bh DWORD (SHARE.EXE) pointer to previous SFT sharing same file
2Fh WORD (SHARE.EXE) network machine number which opened file
(Windows Enhanced mode DOSMGR uses the virtual machine
ID as the machine number; see INT 2F/AX=1683h)
31h WORD PSP segment of file's owner (see #01378 at AH=26h)
(first three entries for AUX/CON/PRN contain segment
of IO.SYS startup code)
33h WORD offset within SHARE.EXE code segment of
sharing record (see #01595) 0000h = none
35h WORD low word of absolute cluster number of last cluster
accessed
37h DWORD pointer to IFS driver for file, 0000000h if native DOS
3Bh WORD high word of first cluster in file
3Dh WORD high word of relative cluster within file
3Fh WORD high word of cluster number of directory entry
41h WORD high word of absolute cluster number of last cluster
accessed
43h DWORD high dword of file size
47h DWORD high dword of current offset in file
Notes: EDR-DOS builds with this SFT layout only contain 3 SFT entries
at DOSDATA:00CCh rather than 5 entries.
SeeAlso: #01639,#01640,#01641,#01642,#26005
Format of SvarDOS flavour Enhanced DR-DOS system file tables and FCB tables:
Offset Size Description (Table 26005)
00h DWORD pointer to next file table (offset FFFFh if last)
04h WORD number of files in this table
06h 3Bh bytes per file (no FAT+) or 42h bytes per file (with FAT+)
Offset Size Description
00h WORD number of file handles referring to this file
FFFFh if in use but not referenced
02h WORD file open mode (see AX=6C00h,#01402 at AH=3Dh)
bit 15 set if this file opened via FCB
04h BYTE file attribute (see #01420 at AX=4301h)
05h WORD device info word (see also #01423 at AX=4400h)
bit 15 set if remote file
bit 14 set means do not set file date/time on closing
bit 13 set if named pipe
bit 12 set if no inherit
bit 11 set if network spooler
bit 7 set if device, clear if file (only if local)
bits 6-0 as for AX=4400h
07h DWORD pointer to device driver header if character device
else pointer to DOS Drive Parameter Block
(see #01395 at AH=32h) or REDIR data
0Bh WORD high part of relative cluster within file
0Dh WORD file time in packed format (see #01665)
0Fh WORD file date in packed format (see #01666)
11h DWORD file size
15h DWORD current offset in file (SFT)
LRU counters (FCB table, two WORDs)
---local file---
19h WORD low part of relative cluster within file
1Bh DWORD cluster containing directory entry
1Fh BYTE low byte of number of dir entry within cluster
---network redirector---
19h DWORD pointer to REDIRIFS record
1Dh 3 BYTEs ???
------
20h 11 BYTEs filename in FCB format (no path/period, blank-padded)
2Bh DWORD starting cluster of file
2Fh WORD (SHARE.EXE) network machine number which opened file
(Windows Enhanced mode DOSMGR uses the virtual machine
ID as the machine number; see INT 2F/AX=1683h)
31h WORD PSP segment of file's owner (see #01378 at AH=26h)
(first three entries for AUX/CON/PRN contain segment
of IO.SYS startup code)
33h WORD offset within SHARE.EXE code segment of
sharing record (see #01595) 0000h = none
35h DWORD absolute cluster number of last cluster accessed
39h BYTE high byte of number of dir entry within cluster
--- no FAT+ ---
3Ah BYTE padding
--- with FAT+ ---
3Ah DWORD high dword of file size
3Eh DWORD high dword of current offset in file
Notes: start cluster of MS-DOS v6 at offset 0Bh is now high part of the
relative cluster in file
sharer pointer to next SFT in MS-DOS v6 is now file start cluster
low word of IFS pointer in MS-DOS v6 is now high word of absolute
cluster number in file
SvarDOS flavour EDR-DOS uses a directory cluster, and places the
needed high byte of the directory entry in the otherwise unused
padding near the end.
SvarDOS flavour builds allow disabling FAT+ support in which case
the high dwords are absent, instead there is 1 byte of padding.
EDR-DOS builds with the SvarDOS FAT+ SFT layout only contain 4
SFT entries at DOSDATA:00CCh rather than 5 entries.
SeeAlso: #01639,#01640,#01641,#01642,#26003,#26004
Format of current directory structure (CDS) (array, LASTDRIVE entries):
Offset Size Description (Table 01643)
00h 67 BYTEs ASCIZ path in form X:\PATH (local) or UNC form
\\SERVER\PATH (network, see notes below)
43h WORD drive attributes (also see note below) (see also AX=5F07h)
bit 15: uses network redirector \ invalid if 00, installable
bit 14: physical drive / file system if 11
bit 13: JOIN'ed \ path above is true path that would be
bit 12: SUBST'ed / needed if not under SUBST or JOIN
bit 11: removable media (WinNT4.0)
bit 10: hard disk??? (WinNT4.0)
bit 7: remote drive hidden from redirector's assign-list and
exempt from network connection make/break commands;
set for CD-ROM drives by MSCDEX (not supported by
CORELCDX)
45h DWORD pointer to Drive Parameter Block for drive
(see #01395 at AH=32h)
---local drives---
49h WORD starting cluster of current directory
0000h = root, FFFFh = never accessed
4Bh WORD ??? seems to be FFFFh always
4Dh WORD ??? seems to be FFFFh always
---network drives---
49h DWORD pointer to redirector or REDIRIFS record, or FFFFh:FFFFh
(DOS 4 only) available for use by IFS driver
4Dh WORD stored user data from INT 21/AX=5F03h
------
4Fh WORD offset in current directory path of backslash corresponding to
root directory for drive
this value specifies how many characters to hide from the
"CHDIR" and "GETDIR" calls; normally set to 2 to hide the
drive letter and colon, SUBST, JOIN, and networks change it
so that only the appropriate portion of the true path is
visible to the user
---DOS 4.0+ ---
51h BYTE (DOS 4 only, remote drives) device type
04h network drive
52h DWORD pointer to IFS driver (DOS 4) or redirector block (DOS 5+) for
this drive, 00000000h if native DOS
56h WORD available for use by IFS driver
Notes: the path for invalid drives is normally set to X:\, but may be empty
after JOIN x: /D in DR DOS 5.0 or NET USE x: /D in older LAN versions
normally, only one of bits 13&12 may be set together with bit 14, but
DR DOS 5.0 uses other combinations for bits 15-12: 0111 JOIN,
0001 SUBST, 0101 ASSIGN (see #01644)
Windows for Workgroups 3.11 network sets the path to the local
drive and directory even for network drives; in that case the
UNC form \\SERVER\SHARE can be obtained with INT 21/AX=5F02h
or INT 21/AX=5F46h. LapLink RemoteAccess does the same even for
INT 21/AX=5F02h
Window NT 4.0 always uses X:\PATH, even for substituted drives (i.e.
the CDS will *not* contain the original path prior to SUBST)
SoftWindows on the Macintosh PowerPC sets \\E for the host drive
BUGS: MS-DOS v4.00 and v4.01 will dereference the IFS pointer at offset
52h to determine whether a redirector CDS (offset 43h bit 15 set)
is actually remote or not (eg for AX=4409h), but some redirectors
don't initialise the IFS pointer
SeeAlso: #01644,INT 21/AX=71AAh/BL=00h
Format of DR DOS 5.0-6.0 current directory structure entry (array):
Offset Size Description (Table 01644)
00h 67 BYTEs ASCIZ pathname of actual root directory for this logical drive
43h WORD drive attributes
1000h SUBSTed drive
3000h??? JOINed drive
4000h physical drive
5000h ASSIGNed drive
7000h JOINed drive
8000h network drive
45h BYTE physical drive number (0=A:) if this logical drive is valid
46h BYTE ??? apparently flags for JOIN and ASSIGN
47h WORD cluster number of start of parent directory (0000h = root)
49h WORD entry number of current directory in parent directory
4Bh WORD cluster number of start of current directory
4Dh WORD used for media change detection (details not available)
4Fh WORD cluster number of SUBST/JOIN "root" directory
0000h if physical root directory
SeeAlso: #01643
Format of Windows NT Current Directory Structure (CDS) (array):
Offset Size Description (Table 01645)
00h 67 BYTEs ASCIZ path in form X:\ (does not show either current directory
or network path)
43h 4 BYTEs ???
Notes: the WinNT CDS contains only as many entries as there are local drives,
not LASTDRIVE entries.
Format of DOS device driver header:
Offset Size Description (Table 01646)
00h DWORD pointer to next driver, offset=FFFFh if last driver
04h WORD device attributes (see #01647,#01648)
06h WORD device strategy entry point
call with ES:BX -> request header
(see #02597 at INT 2F/AX=0802h)
08h WORD device interrupt entry point
---character device---
0Ah 8 BYTEs blank-padded character device name
---block device---
0Ah BYTE number of subunits (drives) supported by driver
0Bh 7 BYTEs normally unused; sometimes contains signature to indicate
specific drivers:
"$PCMATA" PCMCIA driver PCMATA.SYS (see AX=440Dh"DOS 3.2+")
"AHADDVR" Adaptec SCSI disk driver ASPIDISK.SYS
"DBLSPAC" MS DoubleSpace or DriveSpace
"DSKREET" NortonUtils v5+ Diskreet (see INT 2F/AX=FE00h)
"GFS " LapLink III device driver DD.BIN
"SIDExxx" PCMCIA driver ATADRV.EXE (see AX=440Dh"DOS 3.2+")
"STAC-CD" Stacker/Stacker Anywhere (see AX=4404h"Stacker")
---DoubleSpace/DriveSpace---
12h 2 BYTEs signature ",." (2Ch 2Eh)
14h var preloading API entry point
---CD-ROM---
12h WORD reserved, must be 0000h
appears to be another device chain
14h BYTE drive letter, 01h=A:, etc. (must initially be 00h; this byte
is set by MSCDEX when it loads)
15h BYTE number of units
16h 6 BYTEs signature 'MSCDnn' where 'nn' is version (currently '00')
(this field does not exist in most drivers)
SeeAlso: #02550 at INT 25/AX=CDCDh,#02845 at INT 2F/AX=5600h
Bitfields for device attributes (character device):
Bit(s) Description (Table 01647)
15 set (indicates character device)
14 IOCTL supported (see AH=44h)
13 (DOS 3.0+) output until busy supported
12 reserved
11 (DOS 3.0+) OPEN/CLOSE/RemMedia calls supported
10-8 reserved
7 (DOS 5.0+) Generic IOCTL check call supported (driver command 19h)
(see AX=4410h,AX=4411h)
6 (DOS 3.2+) Generic IOCTL call supported (driver command 13h)
(see AX=440Ch,AX=440Dh"DOS 3.2+")
5 reserved
4 device is special (use INT 29 "fast console output")
3 device is CLOCK$ (all reads/writes use transfer record described
below)
2 device is NUL
1 device is standard output
0 device is standard input
Notes: for European MS-DOS 4.0, bit 11 also indicates that bits 8-6 contain a
version code (000 = DOS 3.0,3.1; 001 = DOS 3.2;
010 = European DOS 4.0)
SeeAlso: #01648,#01646
Bitfields for device attributes (block device):
Bit(s) Description (Table 01648)
15 clear (indicates block device)
14 IOCTL supported
13 non-IBM format
12 network device (device is remote)
11 (DOS 3.0+) OPEN/CLOSE/RemMedia calls supported
10 reserved
9 direct I/O not allowed??? (set by DOS 3.3 DRIVER.SYS for "new" drives)
8 ??? set by DOS 3.3 DRIVER.SYS for "new" drives
7 (DOS 5.0+) Generic IOCTL check call supported (driver command 19h)
(see AX=4410h,AX=4411h)
6 (DOS 3.2+) Generic IOCTL call supported (driver command 13h)
implies support for commands 17h and 18h
(see AX=440Ch,AX=440Dh"DOS 3.2+",AX=440Eh,AX=440Fh)
5-2 reserved
1 driver supports 32-bit sector addressing (DOS 3.31+)
0 reserved
Notes: for European MS-DOS 4.0, bit 11 also indicates that bits 8-6 contain a
version code (000 = DOS 3.0,3.1; 001 = DOS 3.2;
010 = European DOS 4.0)
SeeAlso: #01647,#01646
Format of DOS 2.x disk buffer:
Offset Size Description (Table 01649)
00h DWORD pointer to next disk buffer, offset = FFFFh if last
least-recently used buffer is first in chain
04h BYTE drive (0=A, 1=B, etc), FFh if not in use
05h 3 BYTEs unused??? (seems always to be 00h 00h 01h)
08h WORD logical sector number
0Ah BYTE number of copies to write (1 for non-FAT sectors)
0Bh BYTE sector offset between copies if multiple copies to be written
0Ch DWORD pointer to DOS Drive Parameter Block (see #01395 at AH=32h)
10h buffered data
SeeAlso: #01650,#01652,#01653,#01655
Format of DOS 3.x disk buffer:
Offset Size Description (Table 01650)
00h DWORD pointer to next disk buffer, offset = FFFFh if last
least-recently used buffer is first in chain
04h BYTE drive (0=A,1=B, etc), FFh if not in use
05h BYTE buffer flags (see #01651)
06h WORD logical sector number
08h BYTE number of copies to write (1 for non-FAT sectors)
09h BYTE sector offset between copies if multiple copies to be written
0Ah DWORD pointer to DOS Drive Parameter Block (see #01395 at AH=32h)
0Eh WORD unused??? (almost always 0)
10h buffered data
SeeAlso: #01649,#01652,#01653,#01655
Bitfields for DOS 3.x disk buffer flags:
Bit(s) Description (Table 01651)
7 ???
6 buffer dirty
5 buffer has been referenced
4 ???
3 sector in data area
2 sector in a directory, either root or subdirectory
1 sector in FAT
0 boot sector??? (guess)
SeeAlso: #01656
Format of DOS 4.00 (pre UR 25066) disk buffer info:
Offset Size Description (Table 01652)
00h DWORD pointer to array of disk buffer hash chain heads (see #01654)
04h WORD number of disk buffer hash chains (referred to as NDBCH below)
06h DWORD pointer to lookahead buffer, zero if not present
0Ah WORD number of lookahead sectors, else zero (the y in BUFFERS=x,y)
0Ch BYTE 00h if buffers in EMS (/X), FFh if not
0Dh WORD EMS handle for buffers, zero if not in EMS
0Fh WORD EMS physical page number used for buffers (usually 255)
11h WORD ??? seems always to be 0001h
13h WORD segment of EMS physical page frame
15h WORD ??? seems always to be zero
17h 4 WORDs EMS partial page mapping information???
SeeAlso: #01649,#01650,#01653,#01657
Format of DOS 4.01 (from UR 25066 Corrective Services Disk on) disk buffer info:
Offset Size Description (Table 01653)
00h DWORD pointer to array of disk buffer hash chain heads (see #01654)
04h WORD number of disk buffer hash chains (referred to as NDBCH below)
06h DWORD pointer to lookahead buffer, zero if not present
0Ah WORD number of lookahead sectors, else zero (the y in BUFFERS=x,y)
0Ch BYTE 01h, possibly to distinguish from pre-UR 25066 format
0Dh WORD ??? EMS segment for BUFFERS (only with /XD)
0Fh WORD ??? EMS physical page number of EMS seg above (only with /XD)
11h WORD ??? EMS segment for ??? (only with /XD)
13h WORD ??? EMS physical page number of above (only with /XD)
15h BYTE ??? number of EMS page frames present (only with /XD)
16h WORD segment of one-sector workspace buffer allocated in main memory
if BUFFERS/XS or /XD options in effect, possibly to avoid DMA
into EMS
18h WORD EMS handle for buffers, zero if not in EMS
1Ah WORD EMS physical page number used for buffers (usually 255)
1Ch WORD ??? appears always to be 0001h
1Eh WORD segment of EMS physical page frame
20h WORD ??? appears always to be zero
22h BYTE 00h if /XS, 01h if /XD, FFh if BUFFERS not in EMS
SeeAlso: #01649,#01650,#01652,#01657
Format of DOS 4.x disk buffer hash chain head (array, one entry per chain):
Offset Size Description (Table 01654)
00h WORD EMS logical page number in which chain is resident, -1 if not
in EMS
02h DWORD pointer to least recently used buffer header. All buffers on
this chain are in the same segment.
06h BYTE number of dirty buffers on this chain
07h BYTE reserved (00h)
Notes: buffered disk sectors are assigned to chain N where N is the sector's
address modulo NDBCH, 0 <= N <= NDBCH-1
each chain resides completely within one EMS page
this structure is in main memory even if buffers are in EMS
Format of DOS 4.0-6.0 disk buffer:
Offset Size Description (Table 01655)
00h WORD forward ptr, offset only, to next least recently used buffer
02h WORD backward pointer, offset only
04h BYTE drive (0=A,1=B, etc) if bit 7 clear
SFT index if bit 7 set
FFh if not in use
05h BYTE buffer flags (see #01656)
06h DWORD logical sector number (local buffers only)
0Ah BYTE number of copies to write
for FAT sectors, same as number of FATs
for data and directory sectors, usually 1
0Bh WORD offset in sectors between copies to write for FAT sectors
0Dh DWORD pointer to DOS Drive Parameter Block (see #01395 at AH=32h)
11h WORD size of data in buffer if remote buffer (see also #01656)
13h BYTE reserved (padding)
14h buffered data
Notes: for DOS 4.x, all buffered sectors which have the same hash value
(computed as the sum of high and low words of the logical sector
number divided by the number of disk buffer chains) are on the same
doubly-linked circular chain; for DOS 5+, only a single circular
chain exists.
the links consist of offset addresses only, the segment being the same
for all buffers in the chain.
SeeAlso: #01649,#01650,#01652
Bitfields for DOS 4.0-6.0 disk buffer flags:
Bit(s) Description (Table 01656)
7 remote buffer
6 buffer dirty
5 buffer has been referenced (reserved in DOS 5+)
4 search data buffer (only valid if remote buffer)
3 sector in data area
2 sector in a directory, either root or subdirectory
1 sector in FAT
0 reserved
SeeAlso: #01651
Format of DOS 5.0-6.0 disk buffer info:
Offset Size Description (Table 01657)
00h DWORD pointer to least-recently-used buffer header (may be in HMA)
(see #01655)
04h WORD number of dirty disk buffers
06h DWORD pointer to lookahead buffer, zero if not present
0Ah WORD number of lookahead sectors, else zero (the y in BUFFERS=x,y)
0Ch BYTE buffer location
00h base memory, no workspace buffer
01h HMA, workspace buffer in base memory
0Dh DWORD pointer to one-segment workspace buffer in base memory
11h 3 BYTEs unused
14h WORD ???
16h BYTE flag: INT 24 fail while making an I/O status call
17h BYTE temp storage for user memory allocation strategy during EXEC
18h BYTE counter: number of INT 21 calls for which A20 is off
19h BYTE bit flags
bit 0: ???
bit 1: SWITCHES=/W specified in CONFIG.SYS (don't load
WINA20.SYS when MS Windows 3.0 starts)
bit 2: in EXEC state (INT 21/AX=4B05h)
1Ah WORD offset of unpack code start (used only during INT 21/AX=4B05h)
1Ch BYTE bit 0 set iff UMB MCB chain linked to normal MCB chain
1Dh WORD minimum paragraphs of memory required by program being EXECed
1Fh WORD segment of first MCB in upper memory blocks or FFFFh if DOS
memory chain in base 640K only (first UMB MCB usually at
9FFFh, locking out video memory with a DOS-owned memory
block)
the MCB this word points at is the first UMCB. when the UMB
link is disabled, the *prior* LMA MCB (the one pointing to
the first UMCB) is marked with a 'Z' indicating the last
memory block. MCB walkers may choose to continue past the
last LMCB if they can match that there is a first UMCB.
the first UMCB can be determined without finding it in the
DOS data segment, by disabling the UMB link, walking until
'Z', enabling the UMB link and verifying that the former
'Z' MCB is now an 'M' MCB. lDOS copied the PTS-DOS function
INT 2F/AX=1261h to directly query the first UMCB.
21h WORD paragraph from which to start scanning during memory allocation
SeeAlso: #01652,#01653
(Table 01658)
Call IFS utility function entry point with:
AH = 20h miscellaneous functions
AL = 00h get date
Return: CX = year
DH = month
DL = day
AL = 01h get process ID and computer ID
Return: BX = current PSP segment
DX = active network machine number
AL = 05h get file system info
ES:DI -> 16-byte info buffer
Return: buffer filled
Offset Size Description
00h 2 BYTEs unused
02h WORD number of SFTs (actually counts only
the first two file table arrays)
04h WORD number of FCB table entries
06h WORD number of protected FCBs
08h 6 BYTEs unused
0Eh WORD largest sector size supported
AL = 06h get machine name
ES:DI -> 18-byte buffer for name
Return: buffer filled with name starting at offset 02h
AL = 08h get sharing retry count
Return: BX = sharing retry count
AL = other
Return: CF set
AH = 21h get redirection state
BH = type (03h disk, 04h printer)
Return: BH = state (00h off, 01h on)
AH = 22h ??? some sort of time calculation
AL = 00h ???
nonzero ???
AH = 23h ??? some sort of time calculation
AH = 24h compare filenames
DS:SI -> first ASCIZ filename
ES:DI -> second ASCIZ filename
Return: ZF set if files are same ignoring case and / vs \
AH = 25h normalize filename
DS:SI -> ASCIZ filename
ES:DI -> buffer for result
Return: filename uppercased, forward slashes changed to backslashes
AH = 26h get DOS stack
Return: DS:SI -> top of stack
CX = size of stack in bytes
AH = 27h increment InDOS flag
AH = 28h decrement InDOS flag
Notes: IFS drivers which do not wish to implement functions 20h or 24h-28h may
pass them on to the default handler pointed at by [LoL+37h]
SeeAlso: #01659,#01660
Format of IFS driver list:
Offset Size Description (Table 01659)
00h DWORD pointer to next driver header
04h 8 BYTEs IFS driver name (blank padded), as used by FILESYS command
0Ch 4 BYTEs ???
10h DWORD pointer to IFS utility function entry point (see #01658)
call with ES:BX -> IFS request (see #01660)
14h WORD offset in header's segment of driver entry point
???
SeeAlso: #01658,#01660
Format of IFS request block:
Offset Size Description (Table 01660)
00h WORD total size in bytes of request
02h BYTE class of request
02h ???
03h redirection
04h ???
05h file access
06h convert error code to string
07h ???
03h WORD returned DOS error code
05h BYTE IFS driver exit status
00h success
01h ???
02h ???
03h ???
04h ???
FFh internal failure
06h 16 BYTEs ???
---request class 02h---
16h BYTE function code
04h ???
17h BYTE unused???
18h DWORD pointer to ???
1Ch DWORD pointer to ???
20h 2 BYTEs ???
---request class 03h---
16h BYTE function code
17h BYTE ???
18h DWORD pointer to ???
1Ch DWORD pointer to ???
22h WORD returned ???
24h WORD returned ???
26h WORD returned ???
28h BYTE returned ???
29h BYTE unused???
---request class 04h---
16h DWORD pointer to ???
1Ah DWORD pointer to ???
---request class 05h---
16h BYTE function code
01h flush disk buffers
02h get disk space
03h MKDIR
04h RMDIR
05h CHDIR
06h delete file
07h rename file
08h search directory
09h file open/create
0Ah LSEEK
0Bh read from file
0Ch write to file
0Dh lock region of file
0Eh commit/close file
0Fh get/set file attributes
10h printer control
11h ???
12h process termination
13h ???
---class 05h function 01h---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h 4 BYTEs ???
26h BYTE ???
27h BYTE ???
---class 05h function 02h---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h 4 BYTEs ???
26h WORD returned total clusters
28h WORD returned sectors per cluster
2Ah WORD returned bytes per sector
2Ch WORD returned available clusters
2Eh BYTE returned ???
2Fh BYTE ???
---class 05h functions 03h,04h,05h---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h 4 BYTEs ???
26h DWORD pointer to directory name
---class 05h function 06h---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h 4 BYTEs ???
26h WORD attribute mask
28h DWORD pointer to filename
---class 05h function 07h---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h 4 BYTEs ???
26h WORD attribute mask
28h DWORD pointer to source filespec
2Ch DWORD pointer to destination filespec
---class 05h function 08h---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h 4 BYTEs ???
26h BYTE 00h FINDFIRST
01h FINDNEXT
28h DWORD pointer to FindFirst search data + 01h if FINDNEXT
2Ch WORD search attribute if FINDFIRST
2Eh DWORD pointer to filespec if FINDFIRST
---class 05h function 09h---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h DWORD pointer to IFS open file structure (see #01661)
26h WORD ??? \ together, specify open vs. create, whether or
28h WORD ??? / not to truncate
2Ah 4 BYTEs ???
2Eh DWORD pointer to filename
32h 4 BYTEs ???
36h WORD file attributes on call
returned ???
38h WORD returned ???
---class 05h function 0Ah---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h DWORD pointer to IFS open file structure (see #01661)
26h BYTE seek type (02h = from end)
28h DWORD offset on call
returned new absolute position
---class 05h functions 0Bh,0Ch---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h DWORD pointer to IFS open file structure (see #01661)
28h WORD number of bytes to transfer
returned bytes actually transferred
2Ah DWORD transfer address
---class 05h function 0Dh---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h DWORD pointer to IFS open file structure (see #01661)
26h BYTE file handle???
27h BYTE unused???
28h WORD ???
2Ah WORD ???
2Ch WORD ???
2Eh WORD ???
---class 05h function 0Eh---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h DWORD pointer to IFS open file structure (see #01661)
26h BYTE 00h commit file
01h close file
27h BYTE unused???
---class 05h function 0Fh---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h 4 BYTEs ???
26h BYTE 02h GET attributes
03h PUT attributes
27h BYTE unused???
28h 12 BYTEs ???
34h WORD search attributes???
36h DWORD pointer to filename
3Ah WORD (GET) returned ???
3Ch WORD (GET) returned ???
3Eh WORD (GET) returned ???
40h WORD (GET) returned ???
42h WORD (PUT) new attributes
(GET) returned attributes
---class 05h function 10h---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h DWORD pointer to IFS open file structure (see #01661)
26h WORD ???
28h DWORD pointer to ???
2Ch WORD ???
2Eh BYTE ???
2Fh BYTE subfunction
01h get printer setup
03h ???
04h ???
05h ???
06h ???
07h ???
21h set printer setup
---class 05h function 11h---
17h 7 BYTEs ???
1Eh DWORD pointer to ???
22h DWORD pointer to IFS open file structure (see #01661)
26h BYTE subfunction
27h BYTE unused???
28h WORD ???
2Ah WORD ???
2Ch WORD ???
2Eh BYTE ???
2Fh BYTE ???
---class 05h function 12h---
17h 15 BYTEs unused???
26h WORD PSP segment
28h BYTE type of process termination
29h BYTE unused???
---class 05h function 13h---
17h 15 BYTEs unused???
26h WORD PSP segment
---request class 06h---
16h DWORD returned pointer to string corresponding to error code at 03h
1Ah BYTE returned ???
1Bh BYTE unused
---request class 07h---
16h DWORD pointer to IFS open file structure (see #01661)
1Ah BYTE ???
1Bh BYTE unused???
SeeAlso: #01659,#01658,#01661
Format of IFS open file structure:
Offset Size Description (Table 01661)
00h WORD ???
02h WORD device info word
04h WORD file open mode
06h WORD ???
08h WORD file attributes
0Ah WORD owner's network machine number
0Ch WORD owner's PSP segment
0Eh DWORD file size
12h DWORD current offset in file
16h WORD file time
18h WORD file date
1Ah 11 BYTEs filename in FCB format
25h WORD ???
27h WORD hash value of SFT address
(low word of linear address + segment&F000h)
29h 3 WORDs network info from SFT
2Fh WORD ???
Format of one item in DOS 4.0+ list of special program names:
Offset Size Description (Table 01662)
00h BYTE length of name (00h = end of list)
01h N BYTEs name in format name.ext
N 2 BYTEs DOS version to return for program (major,minor)
(see AH=30h,INT 2F/AX=122Fh)
---DOS 4 only---
N+2 BYTE number of times to return fake version number (FFh = always)
Notes: if the name of the executable for the program making the DOS "get
version" call matches one of the names in this list, DOS returns the
specified version rather than the true version number