An operating system manages all the hardware and software on a computer system. It controls files, devices, memory, processing time, user access, and executes commands or provides error messages. An operating system provides an environment for other programs to do useful work, similar to a government. It consists of subsystem managers that monitor resources, enforce policies on resource allocation and deallocation.