The operating system (OS) must provide and manage hardware resources as well as provide an interface between the user and the machine and between applications software and the machine. The OS must also provide other services such as data security.
Originally, if a program needed input, the program would have to contain the code to do this, similarly if output were required. This led to duplication of code so the idea of an OS was born. The OS contained the necessary input and output functions that could be called by an application. Similarly, disk input and output routines were incorporated into the OS. This led to the creation of subroutines to do these simple tasks such as read a character from a keyboard or send a character to a printer. The joining together of all these basic input and output routines led to the input-output control system (IOCS). Originally, the IOCS could only read a punched card or send data to a card punch. However, as new input and output media, such as magnetic tape and disk, were developed the IOCS became more complex.
Another complication was added when assembly and high-level languages were developed as the machine did not use these languages. Machines use binary codes for very simple instructions. With the development of these new types of programming language a computer would have to
- load an assembler, compiler or interpreter,
- load the assembly or high-level program,
- do the translation,
- store the results somewhere in memory,
- execute the program,
- read input data,
- output the results.
For a user to organise all this had now become too complex. Also, as the processor could work much faster than the manual operator and the input and output devices, much time was wasted.
Further, to make full use of the processor, more than one program should be stored in memory and the processor should give time to each of the programs. Suppose two programs are.