INT 21 U - DOS 2+ internal - "SYSVARS" - GET LIST OF LISTS AH = 52h Return: ES:BX -> DOS list of lists 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). on return, ES points at the DOS data segment (see also INT 2F/AX=1203h) SeeAlso: INT 2F/AX=1203h Format of List of Lists: Offset Size Description -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+) pointer to current disk buffer -4 WORD (DOS 3+) 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 00h DWORD pointer to first Drive Parameter Block (see AH=32h) 04h DWORD pointer to first System File Table (see below) 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 below) 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 below) ---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 below) 17h DWORD pointer to array of current directory structures (see below) 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 below) ---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 below) 16h DWORD pointer to array of current directory structures (see below) 1Ah DWORD pointer to system FCB tables (see below) 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 below) 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 below) 16h DWORD pointer to array of current directory structures (see below) 1Ah DWORD pointer to system FCB tables (see below) 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 (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 below) 34h BYTE number of JOIN'ed drives 35h WORD pointer within IBMDOS code segment to list of special program names (see below) (always 0000h for DOS 5.0) 37h DWORD pointer to FAR routine for resident IFS utility functions (see below) 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 (see 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 3Fh 8 BYTEs as for DOS 4.x (see above) Format of memory control block (see also below): Offset Size Description 00h BYTE block type: 5Ah if last block in chain, otherwise 4Dh 01h WORD PSP segment of owner or 0000h if free 0006h if DR-DOS XMS UMB 0007h if DR-DOS excluded upper memory ("hole") 0008h if belongs to DOS FFFAh if 386MAX UMB control block (see AX=4402h"386MAX") FFFDh if 386MAX locked-out memory FFFEh if 386MAX UMB (immediately follows its control block) FFFFh if 386MAX 6.01 device driver 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+ --- 08h 8 BYTEs ASCII program name if PSP memory block or DR-DOS UMB, else garbage null-terminated if less than 8 characters 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+ it is divided into subsegments, each with its own memory control block (see below), 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. Format of MS-DOS 5+ UMB control block: Offset Size Description 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 Format of STARLITE (General Software's Embedded DOS) memory control block: Offset Size Description 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+ data segment subsegment control blocks: Offset Size Description 00h BYTE subsegment type (blocks typically appear in this order) "D" device driver "E" device driver appendage "I" IFS (Installable File System) driver "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 below) "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 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) Note: 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+ Identified by sub-segment control block type "S" within the DOS data segment. SeeAlso: INT B4"STACKMAN" Format of array elements in STACKS data segment: Offset Size Description 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. SHARE.EXE hooks (DOS 3.1-6.00): (offsets from first system file table--pointed at by ListOfLists+04h) Offset Size Description -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 AX=5D06h) Return: CF clear if successful CF set on error AX = DOS error code (24h) (see AH=59h) 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 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 AH=59h) -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+--- DS:DX -> lock range DWORD start offset DWORD size in bytes Return: CF set on error AL = DOS error code (21h) (see 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+--- DS:DX -> lock range DWORD start offset DWORD size in bytes Return: CF set on error AL = DOS error code (21h) (see 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 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 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 below) 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; will reportedly be supported by Novell DOS 7 Format of sharing record: Offset Size Description 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 below) 06h DWORD pointer to start of system file table chain for file 0Ah WORD unique sequence number 0Ch var ASCIZ full pathname Note: not supported by DR-DOS SHARE 1.1 and 2.0; will reportedly be supported by Novell DOS 7 Format of Record Lock Record (SHARE.EXE): Offset Size Description 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) Format of DOS 2.x system file tables: Offset Size Description 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 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 AX=5700h) 19h WORD file time in packed format (see AX=5700h) 1Bh BYTE device attribute (see 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??? Format of DOS 3.0 system file tables and FCB tables: Offset Size Description 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 below) 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 Format of DOS 3.1-3.3x, DR-DOS 5.0-6.0 system file tables and FCB tables: Offset Size Description 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 AH=3Dh) bit 15 set if this file opened via FCB 04h BYTE file attribute (see AX=4301h) 05h WORD device info word (see 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 AH=32h) 0Bh WORD starting cluster of file 0Dh WORD file time in packed format (see AX=5700h) not used for character devices in DR-DOS 0Fh WORD file date in packed format (see 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 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 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 above) 0000h = none Format of DOS 4.0-6.0 system file tables and FCB tables: Offset Size Description 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 AH=3Dh) bit 15 set if this file opened via FCB 04h BYTE file attribute (see AX=4301h) 05h WORD device info word (see also 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 AH=32h) or REDIR data 0Bh WORD starting cluster of file (local files only) 0Dh WORD file time in packed format (see AX=5700h) 0Fh WORD file date in packed format (see AX=5700h) 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 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 above) 0000h = none 35h WORD (local) absolute cluster number of last clustr accessed (redirector) ??? 37h DWORD pointer to IFS driver for file, 0000000h if native DOS Note: 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 Format of current directory structure (CDS) (array, LASTDRIVE entries): Offset Size Description 00h 67 BYTEs ASCIZ path in form X:\PATH (local) or \\MACH\PATH (network) 43h WORD drive attributes (see also note below and 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 7: remote drive hidden from redirector's assign-list and exempt from network connection make/break commands; set for CD-ROM drives 45h DWORD pointer to Drive Parameter Block for drive (see 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+ --- 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 below) Format of DR-DOS 5.0-6.0 current directory structure entry (array): Offset Size Description 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 Format of device driver header: Offset Size Description 00h DWORD pointer to next driver, offset=FFFFh if last driver 04h WORD device attributes Character device: bit 15 set (indicates character device) bit 14 IOCTL supported (see AH=44h) bit 13 (DOS 3+) output until busy supported bit 12 reserved bit 11 (DOS 3+) OPEN/CLOSE/RemMedia calls supported bits 10-8 reserved bit 7 (DOS 5+) Generic IOCTL check call supported (cmd 19h) (see AX=4410h,AX=4411h) bit 6 (DOS 3.2+) Generic IOCTL call supported (command 13h) (see AX=440Ch,AX=440Dh) bit 5 reserved bit 4 device is special (use INT 29 "fast console output") bit 3 device is CLOCK$ (all reads/writes use transfer record described below) bit 2 device is NUL bit 1 device is standard output bit 0 device is standard input Block device: bit 15 clear (indicates block device) bit 14 IOCTL supported bit 13 non-IBM format bit 12 network device (device is remote) bit 11 (DOS 3+) OPEN/CLOSE/RemMedia calls supported bit 10 reserved bit 9 direct I/O not allowed??? (set by DOS 3.3 DRIVER.SYS for "new" drives) bit 8 ??? set by DOS 3.3 DRIVER.SYS for "new" drives bit 7 (DOS 5+) Generic IOCTL check call supported (cmd 19h) (see AX=4410h,AX=4411h) bit 6 (DOS 3.2+) Generic IOCTL call supported (command 13h) implies support for commands 17h and 18h (see AX=440Ch,AX=440Dh,AX=440Eh,AX=440Fh) bits 5-2 reserved bit 1 driver supports 32-bit sector addressing (DOS 3.31+) bit 0 reserved Note: 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) 06h WORD device strategy entry point call with ES:BX -> request header (see 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 unused --- 12h WORD (CD-ROM driver) reserved, must be 0000h appears to be another device chain 14h BYTE (CD-ROM driver) drive letter (must initially be 00h) 15h BYTE (CD-ROM driver) number of units 16h 6 BYTEs (CD-ROM driver) signature 'MSCDnn' where 'nn' is version (currently '00') Format of CLOCK$ transfer record: Offset Size Description 00h WORD number of days since 1-Jan-1980 02h BYTE minutes 03h BYTE hours 04h BYTE hundredths of second 05h BYTE seconds Format of DOS 2.x disk buffer: Offset Size Description 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 AH=32h) 10h buffered data Format of DOS 3.x disk buffer: Offset Size Description 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 bit 7: ??? bit 6: buffer dirty bit 5: buffer has been referenced bit 4: ??? bit 3: sector in data area bit 2: sector in a directory, either root or subdirectory bit 1: sector in FAT bit 0: boot sector??? (guess) 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 AH=32h) 0Eh WORD unused??? (almost always 0) 10h buffered data Format of DOS 4.00 (pre UR 25066) disk buffer info: Offset Size Description 00h DWORD pointer to array of disk buffer hash chain heads (see below) 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??? Format of DOS 4.01 (from UR 25066 Corrctive Services Disk on) disk buffer info: Offset Size Description 00h DWORD pointer to array of disk buffer hash chain heads (see below) 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 Format of DOS 4.x disk buffer hash chain head (array, one entry per chain): Offset Size Description 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 00h WORD forward ptr, offset only, to next least recently used buffer 02h WORD backward ptr, 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 bit 7: remote buffer bit 6: buffer dirty bit 5: buffer has been referenced (reserved in DOS 5+) bit 4: search data buffer (only valid if remote buffer) bit 3: sector in data area bit 2: sector in a directory, either root or subdirectory bit 1: sector in FAT bit 0: reserved 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 AH=32h) 11h WORD size of data in buffer if remote buffer (see flags above) 13h BYTE reserved (padding) 14h buffered data Note: 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. Format of DOS 5.0-6.0 disk buffer info: Offset Size Description 00h DWORD pointer to least-recently-used buffer header (may be in HMA) (see above) 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) 21h WORD paragraph from which to start scanning during memory allocation Format of IFS driver list: Offset Size Description 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 below) call with ES:BX -> IFS request (see below) 14h WORD offset in header's segment of driver entry point ??? 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 proctected 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 Note: 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] Format of IFS request block: Offset Size Description 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 below) 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 below) 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 below) 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 below) 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 below) 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 below) 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 below) 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 below) 1Ah BYTE ??? 1Bh BYTE unused??? Format of IFS open file structure: Offset Size Description 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+ list of special program names: Offset Size Description 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) Note: 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 .