GDSX Manual

DEVICE^HANDLER Example, Design
Extended General Device Support (GDSX) Manual134303
5-17
Task Control Blocks
To confirm that the correct DCB has been located, you can display the name and access
name fields in ASCII, as follows:
- DISPLAY (octal-dcb-address) AS DCB^TEMPLATE IN ASCII
Verify that the value of the variable name is the OUT file ($TC1) opened by the
requester, and that the access name was correctly derived from the qualifier(s) in the
requester’s OUT file name.
Task Control Blocks
When a task is started, TSCODE assigns a task control block (TCB), which is used to
manage the task. When the requester application in this example opened terminal $TC1,
TSCODE opened the terminal, created a DCB to manage communication to the
terminal, created a DEVICE^HANDLER task that maps to the DCB, and created a TCB
to manage the task. The TCB includes the following:
Pointers to the linked list of I/O control blocks (IOCBs, to be discussed shortly)
owned by the task.
Lastrcviocb, the address of the IOCB representing the last $RECEIVE request
passed to the task.
Term, the GDSX internal file number of the device to which this task is mapped.
Dcbaddr, a pointer to the associated device control block.
DCCBDECS contains USKELEX’s tcb^template and is shown in Appendix C. Storage
for TCBs is declared by TSCODE and is contained in extended memory.
Display the contents of the DEVICE^HANDLER task’s TCB by issuing:
- DISPLAY (tcb-address) AS TCB^TEMPLATE
Record the value of lastrcviocb (iocb-address).
I/O Control Blocks
Now examine the I/O control block (IOCB) representing the last $RECEIVE request (a
WRITE) passed to the task. TSCODE allocates an IOCB to manage each outstanding
nowait I/O. All IOCBs representing I/O operations for a particular task are linked to the
task’s TCB. An IOCB contains the following:
Optype, the I/O operation type
Iocnt, the I/O count in bytes returned from AWAITIO
Bufaddrx, the buffer address
Tcbaddr, the address of the task requesting the I/O
DCCBDECS contains USKELEX’s iocb^template and is shown in Appendix C.
Storage for IOCBs is declared by TSCODE and contained in extended memory.