80 likes | 102 Views
Learn how to program channels to offload complex activities, minimize interrupts, and improve device utilization without the processor's constant involvement. Discover the Channel Command Words (CCWs), IO functions, interrupt handling, and examples of effective channel programming.
E N D
Channel Programming Goals Offload data movement work from Processor (like DMA on PCs) Minimize Interrupts (very disruptive) Improve device utilization How “Program” the device and channel so that they accomplish very complex activities without the processor being involved
Channel Programming Channel Command Words (CCWs) Each one is an instruction to the channel and/or device Channel Program A sequence of CCWs to do an IO function “A program for the channel to execute” Note: a unconditional branch op code (TIC) allows the program to transfer to another real memory location An IO operation starts by assigning a hardware channel to a channel program. At the end of the program, an IO interrupt occurs which has status information about the operation.
Channel Programming CCW format (see fig IO.4) Op code – command to channel and device e.g. print and space a line Count – The number of bytes to move Address – the location of the bytes in memory. This is a real Address and cannot be paged out until the IO is complete Flag Byte – additional command information (next foil)
Channel Programming CCW Flag Byte – (most significant bits) - Command Chain- after this CCW execute next CCW - Data Chain – after count of current CCW is used, continue data movement using count and address field from next CCW. e.g. Scatter/Gather data to/from memory - Program Controlled Interrupt(PCI) – Cause an IO Interrupt when this CCW is executed (but continue with the operation). e.g. Notify OS about Channel position in the Channel Program - Indirect Data Address List(IDAW)- The address of a list of data addresses which are used when the data transfer crosses page boundaries i.e. use next address in list when data transfer crosses a real page boundary. e.g. an IO buffer is contiguous in Virtual memory but crosses into multiple non-contiguous real pages
Channel Programming IO Interrupt Information - Identity of the device that caused the interrupt - Completion Status Channel end (CE)- channel ended it's operation Device end(DE) – device ended it's operation Unit Exception(UE)- Exception condition at device e.g. Printer out of paper Unit Check – Problem at device e.g. Paper jam Multiple conditions can be reported on one interrupt e.g. CE and DE are a normal situation
Channel Programming Example Spooling Subsystem 1.During Program Execution -OS provides a “virtual” printer -Lines sent to printer are packed into a buffer Assume packed 40 lines to 1 4K buffer -When buffer is filled,it's written to disk (Spool area) -Double buffered so program doesn't wait for disk write -Impact Fewer interrupts 1 disk IO every 40 lines Execution time lower – disks faster than printer
Channel Programming Example 2. During Printing Lines are printed from Buffer -by a chain of CCWs created by Spooling subsystem -40 lines printed with 2 IO Interrupts (at end of printout and disk read) -Double buffer so printer doesn't wait for disk Impact -Fewer Interrupts ( one printer interrupt for 40 lines) -Printer runs fast (never waits for application) - able to share 1 printer between multiple jobs Note: can dynamically modify channel program for even fewer interrupts
Channel Programming Goals