INT D4 - PC-MOS/386 v3.0+ - GET TASK CONTROL BLOCK AH = 04h BX = task ID or FFFFh for calling task Return: CF clear if successful ES = segment of Task Control Block (TCB) (see #04006) CF set on error AX = error code (see #01680 at INT 21/AH=59h/BX=0000h) Note: superseded by AH=27h SeeAlso: AH=02h,AH=27h,AH=28h,AH=29h,AH=2Ah,INT 38 Format of PC-MOS/386 Task Control Block: Offset Size Description (Table 04006) 00h BYTE signature byte "H" if allocated from system memory pool 01h BYTE header block ID, "T" = TCB 02h WORD length of block in paragraphs 04h WORD segment address of next header block (0000h if last) 06h WORD segment address of previous header block (0000h if first) 08h WORD pointer to next TCB 0Ah WORD pointer to previous TCB 0Ch WORD pointer to associated TCB (if applicable) 0Eh WORD reserved ---TCB--- 10h WORD TCB task ID 12h WORD native context save area 14h WORD start address of task 16h WORD end address of task 18h BYTE task priority 19h BYTE task time slice 1Ah BYTE "TCBWAIT" run status of task 1Bh BYTE "TCBSTAT" what the task is waiting for 1Ch DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. address of polling routine 20h BYTE error code from last function call 21h 11 BYTEs name of currently executing task 2Ch 4 BYTEs ??? 30h BYTE keyboard disabled if bit 1 set 31h BYTE current shift state and toggles 32h 2 BYTEs ??? 34h BYTE current video mode 35h BYTE current video page 36h BYTE number of text columns per screen 37h BYTE number of text rows per screen 38h WORD length of video buffer 3Ah WORD video page length 3Ch WORD apge start address in video RAM(Random Access Memory) See also DRAM, SRAM. 3Eh 4 WORDs current cursor positions for four screen pages 46h 8 BYTEs ??? 4Eh WORD current cursor type 50h BYTE current palette setting 51h BYTE original video mode 52h BYTE start CRT row (00h or 01h) 53h BYTE video RAM(Random Access Memory) See also DRAM, SRAM. in task active 54h WORD handle of video save area 56h WORD page count of video save area 58h WORD segment address of video save area 5Ah WORD poitner to first Task File Block (see #04009) 5Ch WORD pointer to first Current Directory Block (see #04012) 5Eh WORD pointer to active Current Directory Block (see #04012) 60h BYTE number of drives 61h BYTE current drive (0=A:, etc.) 62h DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. disk transfer address 66h 4 BYTEs ??? 6Ah BYTE verify flag (nonzero = on) 6Bh BYTE break flag (nonzero = on) 6Ch WORD share/lock retry count 6Eh WORD ticks between share/lock retries 70h BYTE remote printer flags (see #04007) 71h BYTE ETX/ACK delay count 72h WORD spooler segment address 74h 2 BYTEs ??? 76h 3 BYTEs remote printer redirection for LPT1 through LPT3 (see #04008) 79h 2 BYTEs ??? 7Bh DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. offset of username in TCB 7Fh BYTE current output class 80h 7 BYTEs protection access rights, 2 bits per class (writeable!) 87h 122 BYTEs ??? 101h BYTE TCB sleep downcounter value 102h 20 BYTEs ??? 116h BYTE last scan code ... 5D0h DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. far pointer to Device DriverAn interface module between the device-independent portions of the operating system and an actual hardware device which converts device-independent requests into the actual sequence of device operations to perform the requested action. IO.SYS contains the standard, built-in MSDOS device drivers such as CON, COM1, AUX, PRN, etc. See also INT 21h Function 52h and INT 2Fh Function 0802h. Terminal's entry point 5D4h WORD offset of logical screen 5D6h WORD segment of logical screen 5D8h WORD cursor offset within page 5DAh BYTE screen columns 5DBh WORD async port number (0000h = none) 5DDh DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. physical baudrate 5E1h 19 BYTEs reserved for Device DriverAn interface module between the device-independent portions of the operating system and an actual hardware device which converts device-independent requests into the actual sequence of device operations to perform the requested action. IO.SYS contains the standard, built-in MSDOS device drivers such as CON, COM1, AUX, PRN, etc. See also INT 21h Function 52h and INT 2Fh Function 0802h. Terminal (DDT) ... 7A6h DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. far pointer to unregister calling chain Bitfields for PC-MOS/386 remote printer flags: Bit(s) Description (Table 04007) 0 LPT1 to terminal 1 LPT2 to terminal 2 LPT3 to terminal 3 escape to printer pending 4 use XON/XOFF 5 use ETX/ACK 6 waiting for ACK or XON 7 transparent printing on (Table 04008) Values for PC-MOS/386 remote printer redirection: 00h not redirected 01h redirected to COM1 ... 18h redirected to COM24 51h redirected to LPT1 52h redirected to LPT2 53h redirected to LPT3 Format of PC-MOS/386 Task File Block: Offset Size Description (Table 04009) 00h BYTE signature byte "H" if allocated from system memory pool 01h BYTE header block ID, "F" = task file block 02h WORD length of block in paragraphs 04h WORD segment address of next header block (0000h if last) 06h WORD segment address of previous header block (0000h if first) 08h WORD pointer to next TCB 0Ah WORD pointer to previous TCB 0Ch WORD pointer to associated TCB (if applicable) 0Eh WORD reserved ---TFB--- 10h WORD segment address of next TFB 12h WORD segment address of previous TFB 14h WORD segment address of TFB's Global File Block (see #04011) 16h WORD segment address of owner's PSPsee Program Segment Prefix 18h WORD file handle 1Ah 3 BYTEs ??? 1Dh DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. file position 21h 4 BYTEs ??? 25h BYTE IOCTL flags (see #04010) 26h 2 BYTEs ??? Bitfields for PC-MOS/386 IOCTL flags: Bit(s) Description (Table 04010) 0 stdin 1 stdout 2 null device 3 clock device 4 reserved 5 ASCII mode instead of binary 6 EOF encountered on input 7 device rather than file Format of PC-MOS/386 Global File Block: Offset Size Description (Table 04011) 00h BYTE signature byte "H" if allocated from system memory pool 01h BYTE header block ID, "G" = global file block 02h WORD length of block in paragraphs 04h WORD segment address of next header block (0000h if last) 06h WORD segment address of previous header block (0000h if first) 08h WORD pointer to next TCB 0Ah WORD pointer to previous TCB 0Ch WORD pointer to associated TCB (if applicable) 0Eh WORD reserved ---GFB--- 10h 10 BYTEs ??? 1Ah WORD file attribute 1Ch BYTE ??? 1Dh DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. address of device driver 21h WORD first cluster 23h WORD time of last modification 25h WORD date of last modification 27h DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. size of file in bytes 2Bh 11 BYTEs ??? 36h 11 BYTEs device name or FCB-format filename 41h WORD segment address of TFB list 43h WORD segment address of first RLB (see #04014) (0000h = none) 45h BYTE flag: nonzero if GFB refers to character device 46h WORD address of Block Device Block (see #04013) 48h WORD sector of file's directory entry (see #01352) 4Ah WORD high word of file's directory entry 4Ch WORD ofsset of directory entry within sector Format of PC-MOS/386 Current Directory Block: Offset Size Description (Table 04012) 00h BYTE signature byte "H" if allocated from system memory pool 01h BYTE header block ID, "C" = current directory block 02h WORD length of block in paragraphs 04h WORD segment address of next header block (0000h if last) 06h WORD segment address of previous header block (0000h if first) 08h WORD pointer to next TCB 0Ah WORD pointer to previous TCB 0Ch WORD pointer to associated TCB (if applicable) 0Eh WORD reserved ---CDB--- 10h BYTE drive number 11h BYTE ??? 12h 64 BYTEs directory name 52h WORD first directory cluster (0000h = root) Format of PC-MOS/386 Block Device Block: Offset Size Description (Table 04013) 00h BYTE signature byte "H" if allocated from system memory pool 01h BYTE header block ID, "B" = block device block 02h WORD length of block in paragraphs 04h WORD segment address of next header block (0000h if last) 06h WORD segment address of previous header block (0000h if first) 08h WORD pointer to next TCB 0Ah WORD pointer to previous TCB 0Ch WORD pointer to associated TCB (if applicable) 0Eh WORD reserved ---BDB--- 10h BYTE logical drive 11h BYTE unit passed to driver 12h WORD sector size 14h BYTE cluster mask 15h BYTE cluster shift count 16h WORD starting sector of first FATsee File Allocation Table 18h BYTE number of FATs 19h WORD number of root directories 1Bh WORD sector number of first data sector (cluster 0002h) 1Dh WORD number of clusters + 1 (number of highest data cluster) 1Fh BYTE number of sectors in FATsee File Allocation Table 20h WORD beginning root directory sector number 22h DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. device driver address 26h BYTE media descriptor byte 27h 5 BYTEs ??? 2Ch BYTE flag: volume > 32MB 2Dh BYTE ??? 2Eh BYTE number of sectors per cluster 2Fh WORD number of clusters on device 31h WORD number of free clusters (FFFFh = unknown) 33h WORD root directory cluster number 35h WORD pointer to alias/subst string 37h WORD TCB segment address of owner (0000h = none) Format of PC-MOS/386 Record Lock Block: Offset Size Description (Table 04014) 00h BYTE signature byte "H" if allocated from system memory pool 01h BYTE header block ID, "R" = record lock block 02h WORD length of block in paragraphs 04h WORD segment address of next header block (0000h if last) 06h WORD segment address of previous header block (0000h if first) 08h WORD pointer to next TCB 0Ah WORD pointer to previous TCB 0Ch WORD pointer to associated TCB (if applicable) 0Eh WORD reserved ---RLB--- 10h WORD segment address of owner's PSPsee Program Segment Prefix 12h WORD segment address of Global File Block (see #04011) 14h WORD segment address of owner's Task File Block (see #04009) 16h DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. file offset of locked region start 1Ah DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. length of locked region 1Eh WORD owner's handle for file