CST 334: Week 7
This week in CST 334, we learned about how the OS communicates with I/O devices. For example, we learned that devices consist of two components, their interface and their internal structure. Their interface is used by the system software to control it, while their internal structure is implemented to perform their specific utilization. The interface features three registers, the status, command, and data registers. The status register is used to determine whether the device is busy or not. The command register is used to determine what task the device intends to perform. Lastly, the data register is used to pass data in-between the device and the system. It’s important to note that while the data register is bi-directional, the other two registers are only used by the OS in one direction, out to the command register and in from the status register. Additionally, the OS will utilize two different methods of communicating with a device, polling or interrupts. With polling the OS is constantly checking the status register of a device, which is quite tasking on the CPU. Interrupts on the other hand allow the CPU to perform other tasks as the OS issues the command to the device then moves on until the devices performs an interrupt to inform the OS it completed its task. Using interrupts can slow the system when a device is too fast, so polling is the ideal method when communicating with fast devices, whereas interrupts are a more suitable method to use with slower devices.
Comments
Post a Comment