QDOS and SMSQ Channel Definition Block
Whenever a channel is opened, a channel definition block is allocated in the common heap. This block contains a certain amount of information regarding said channel. Different channel types have different channel definition blocks, but all channels have the first $18 bytes defined as the block header.
The Block Header
The SuperBASIC channel table has the following layout.
|Size of this channel definition block
|Address of the driver linkage block
|Job id of the owner of this channel
|QDOS Companion says that this is the location to be set when space is released. The SMSQ docs state that it is the location to be cleared when channel is closed.
|See note below
|Action code. (Value in D0 for last TRAP on this channel)
|Job id of the job waiting for I/O on this channel
Note There is a difference of opinion between QDOS Companion and the SMSQ documentation about CH_STAT, as follows:
|A1 has been absolute
|waiting AND A1 is relative A6
|A1 passed relative to A6