I would appreciate it if someone could give a clear explanation of the differences between these 3 types of I/O. In addition, I was wondering if these forms of I/O are OS depend
Polled (or programmed) I/O: The CPU manually check if there are any I/O requests available periodically. If there isn't, it keeps executing its normal workflow. If there is, it handles the IO request instead.
Interrupt-Driven I/O: The CPU doesn't need to manually check for IO requests. When there is an I/O request available, the CPU is immediately notified using interrupts, and the request is immediately handled using a interrupt service routines.
DMA: The use of DMA allows interrupt-driven IO to be used. Otherwise, a system must use programmed I/O if DMA is not available.
DMA is a method allowing devices (typically has very slow I/O speeds) to access main memory without needing the CPU to explicitly handle the requests. When the CPU initiates data transfer from IO devices to main memory, the CPU instructs the DMA controller to handle this task. The CPU will then "forget" about this operation, and proceed with other tasks. When the DMA controller has completed the transfer, it will signal the CPU using an interrupt. The CPU will then "conclude" the task needed associated with the data transfer it initiated.
The availability of DMA and interrupt driven IO depends on the physical CPU. If the DMA and interrupt hardware exists, then the OS (and your programs) can use interrupt-drive IO requests. Otherwise, I/O requests must be manually checked periodically by polling.