A computer is connected to devices such as a screen, keyboard, mouse, hard disk, printer, CD/DVD, etc. An important task for an operating system is to communicate with the input/output devices connected to the computer.
Input and output have been a problem in operating systems. One reason for this is the large difference in speeds within a computer system.
In the processor and the memory, data processes very quickly, though by comparison communication with peripheral devices is very slow. To write to the screen or to a file is a slow process. A user typing on a keyboard can wait several seconds before he types a character, while for the processor, it is not a good use of time to wait for input/output devices.
Another challenge with input/output is that hardware connecting to a computer is from different manufacturers. For example, there are many types of screens, and these require separate drivers. It would hence be cumbersome if programmers had to create code for each type of screen driver that might be using the program.
The operating system takes care of the communication with the screen, mouse, printers and similar equipment. Applications can therefore work on different computers with different hardware devices connected.
The operating system takes care of errors that can occur when communicating with input/ output devices. The operating system should be able to:
1. Detect errors.
2. Correct mistakes.
Many errors can occur when using input/output devices. The operating system should be able to detect whether a process tries to write to a file opened for reading, and also recognize corrupt data. Sometimes the operating system successfully corrects errors that occur. If the operating system is able to correct a mistake, it will not normally notify the program where the error occurred.