The operating system controls the operation and resources of the computer through controlling access to the central processor unit (CPU) memory, file storage and input/output device. It performs tasks like scheduling the use of resources to avoid conflicts and interference among processes, regulating the content and structure of files stored on non-primary media, and determining which programs are able to utilize hardware components like disc drives or WiFi adapters. It also allows for interactive users to connect to the system with either using a Graphical User Interface (GUI) or a Command-Line Interface (CLI).
Process Management
The operating system manages the start, stop, and resumption of applications. It decides which applications will be executed first, how long the CPU can be used, and also when to stop. It also allows you to split programs into multiple threads, allowing it to run concurrently on multiple processors. Each of these actions are controlled by a routine within the operating system known as a process block.
File management
Operating systems maintain the structure and contents of files in nonprimary storage. They can transfer data between memory and storage when necessary. They can also convert the virtual memory page into physical memory pages to make it easier to access data through a process known as demand paging.
It also interacts with hardware on the computer using drivers and other interfacing software. If, for instance, an application wishes to use a specific piece of hardware, like a WiFi adaptor the operating system will supply the driver, and allow it to access the hardware. This allows the programmer to avoid writing a piece of code for every Wi-Fi adapter, disk drive or other hardware of the same type.