QIO
| Industry | Computer hardware and software |
|---|---|
| Founded | November 8, 1957 in Maynard, Massachusetts, United States |
| Headquarters | Maynard , United States |
QIO (an abbreviation for Queue I/O) refers to a concept utilized in multiple computer operating systems originally created by the former Digital Equipment Corporation (DEC) based in Maynard, Massachusetts.
Within these systems, I/O operations are triggered by making a QIO request to the kernel. There exist two variants: Queue I/O and Queue I/O with Wait.
In the case of QIO without wait, the function returns immediately after placing the request into the queue, allowing the operation to proceed asynchronously. The completion status is communicated through the QIO status doubleword, and the request can be configured to either set an event flag or activate an Asynchronous System Trap (AST).
QIOW (Queue I/O and Wait) facilitates synchronous I/O by combining the wait-for-event-flag mechanism with the call itself, ensuring that it does not return until the operation has either completed successfully or failed.
Operating systems supporting QIO(W) encompass:
- RSX-15
- RSX-11 (all editions)
- RSTS/E (supports synchronous mode only, emulated via RSX runtime system)
- OpenVMS
QIO parameters in VMS
In VMS, the arguments supplied to a QIO call include:
- An event flag that is triggered once the operation finishes; flag 0 is permissible. Multiple concurrent operations can utilize the same event flag, which necessitates management within the application.
- A channel, represented by a small integer associated with the device. All disk-related file and directory tasks (such as parsing, lookup, open/close) are executed through QIO requests.
- A function code, where 6 bits denote core operations (e.g., read, write) and 10 bits define modifiers that tailor these basic functions.
- An optional I/O status block (IOSB), which is cleared at invocation and populated upon completion. This block contains completion status and typically includes byte count; additional bytes vary depending on the specific operation.
- An optional AST routine that is called when the operation completes.
- A parameter passed to this AST routine.
- Up to six parameters (P1 through P6), which are partially standardized. Typically, P1 and P2 indicate the address of the I/O buffer and byte count respectively; other parameters differ depending on the type of operation or device—for instance, P3 may specify a read timeout for terminals or indicate the starting block number for disk drives.
Detecting QIO completion
Completion of a queued I/O operation can be determined by one of three methods:
- The event flag being signaled.
- The first two bytes of the IOSB changing from zero.
- Execution of the AST routine.
Complex QIO operations requiring advanced handling
Basic QIO requests such as reads or writes are managed directly by the kernel or device drivers. However, more intricate requests—especially those involving tape drives or file-level manipulations—were originally handled by an Ancillary Control Processor (ACP), a dedicated process with its own separate address space.
The Files-11 ODS-1 file system on RSX-11 utilized a subroutine library that communicated with F11ACP through specialized "ACP QIOs." Magnetic tape operations were controlled by MTAACP.
For VMS, initial support for Files-11 ODS-2 was provided by F11BACP. To minimize overhead caused by process context switching, F11BACP’s functionality was eventually incorporated into the VMS kernel as XQP (eXtended Qio Processor).
IO$_READPROMPT
Among the more intricate QIO calls is the VMS terminal driver request featuring the modifier, which demands six distinct parameters:
- P1
- Pointer to the buffer intended for incoming characters
- P2
- Length of the buffer that caps the maximum number of characters to read; a value of zero permits immediate exit without input
- P3
- Maximum duration to wait for input in seconds (applicable only with ); zero causes an instant return with any pre-typed input
- P4
- Optional pointer to a "terminator mask" defining ASCII characters that conclude the read operation; if omitted, standard VMS line terminators are assumed
- P5
- Pointer to a prompt string shown before input begins, facilitating automatic redisplay during input refreshes
- P6
- Length of the prompt string provided
Setting these parameters allows both terminal input and output to be managed within a single call, removing the necessity for separate output requests.