Functions & Services of an OS

  1. Executing Programs: The operating system is responsible for running programs on the device.

    A compiled program is a file stored on disk that contains execution instructions. To make the program run, the operating system must load the instructions into RAM, and control the execution of each instruction in the given order.

    When a program is loaded into memory, we call it a process. The process's data (the program's instructions variables, arrays, objects,) are stored in an array-like data structure called the process table.

    Once all the instructions have been executed, the OS needs to terminate the program, which is done by removing the program's data from memory. If a runtime error occurred during execution that prevents the program from continuing running, and no measures that the operating system takes resolve the error, the OS will terminate the program in an abnormal way.