An Operating System is the software that runs on a computer between the Hardware and the User.
It executes programs, makes the computer easy to use, and administrates the hardware in the best ways.
The design of Operating Systems (OS) has to balance a wide set of objectives:
The User needs Ease of Use. This gives great importance to the Interface.
Administrates resources. Like time, memory, power, screen space, user attention...
In shared mainframes, this also implies a way to distribute resources that is "fair".
The OS manages al resources and assets of the computer.
Resolves conflicts for resources for the programs.
The OS controls the execution of programs, does the error (and exceptions) handling, and protects the computer.
The Kernel is the program that runs at all tyme with the computer.
Making a very reductionist comparison with a Metaphor:
I mean, God is everywhere, but Jesus is also a man.
The operating system is everywhere, but the Kernel is also a program. But is a super-program.
The Kernel has the control over everything.
The program that install the Operating System and initializes the Kernel.
I/O devices needs a controller. They run concurrently to the CPU.
The controller stores the signals from the device into a buffer. The CPU then moves data like it was a file. It "writes" and "reads" to the devices Buffers.
Device controller informs CPU that it has finished its operation by causing an interruption.