Note that the time taken to process a sector's worth of data depends on the sector size, the CPU speed, and the amount of computation needed to produce or consume one byte of data. The latter obviously varies from applicaton to application, but an average value can be measured empirically, and all the other variables on which the optimal sector size depends are static functions of the hardware.
The problem: Develop a formula for the optimal sector size. In doing this, ignore such practical considerations as the desire to have the sector size a power of two.
In addition, this terminal requests an interrupt whenever INREADY or OUTREADY are equal to one. A single interrupt service routine is used for both input and output, and interrupts are globally disabled whenever this routine is running.
Furthermore, the operating system already includes support for a datatype called CHQUEUE, and there are two routines, ENCHQ and DECHQ available for enqueueing and dequeuing characters from a CHQUEUE object. The function TSTCHQ returns FULL, EMPTY, or OK to inform the caller of the state fo a CHQUEUE object.
The problem: Write detailed pseudocode for an interrupt handler for this device that puts input data on a CHQUEUE called INQUEUE and takes output for this device from a CHQUEUE called OUTQUEUE. Input should be discarded when INQUEUE is full. Null characters should be output if OUTQUEUE ever becomes empty.