An operating system has three main
functions: (1) manage the computer's
resources, such as the central
processing unit, memory, disk drives,
and printers, (2) establish a user
interface, and (3) execute and provide
services for applications software.
A resource, or system resource, is any physical or virtual component of limited availability within a
computer system. Every device connected to a computer system is a resource. Every internal system
component is a resource. Virtual system resources include files (concretely file handles), network
connections (concretely network sockets), and memory areas. Managing resources is referred to as
resource management, and includes both preventing resource leaks (releasing a resource when a
process has finished using it) and dealing with resource contention (when multiple processes wish to
access a limited resource)