The first week of CST 334 gave us an overview of the role of an operating system.
An operating system performs two critical functions: it manages resources, and virtualizes the physical hardware of a system. In essence, an OS is responsible for turning physical components into “virtual” versions of themselves that are easier for programs to work with. A common application of this virtualization is treating one CPU as an infinite number of CPUs – one for each program running on the machine. Programs operate as if they have singular control of the CPU, when in reality the OS is working behind the scenes, constantly swapping which process is executing. Similarly, the OS is responsible for managing and assigning resources to processes in a virtual way. For example, memory is virtualized much like the CPU; processes believe they are assigned a physical address range, when in reality the OS sits between the program and the hardware, translating any memory accesses to the actual destination in RAM.
Modern OSes paved the way for multiprogram computation. Before virtualization was adopted it was difficult for programs to time share — one ill-acting application could hog resources, or bring the entire system down. System stability was significantly improved by virtualizing system resources and isolating processes from each other. There were also security benefits; programs could no longer read the memory of other programs without permission, and hardware access was locked behind privileged system calls.