Operating Systems
Prerequisites[edit]
TODO: add
Background[edit]
TODO: add if needed
Introduction[edit]
As the name suggests, an Operating System handles all operations of a computer system. With ever-increasing quantities of hardware in the world paired with distinct mechanisms to control each of them, it became a necessity for computer users to have a middleman program that knows how to deal with these peripherals and present them with a simple interface to interact with the computer. Hence, our good programmers created the Operating System which acts as a universal program that takes care of all the ones and zeros of a computer and its components.
Where OS Stands[edit]
Take a look at this graph showing the architecture of a computer system:
We can see that the Operating System sits somewhat in the middle, acting as the sole mediator between the humans and the computer's hardware.
Let's examine how an Operating System performs these tasks for us, shall we?
Program Execution[edit]
First off, let's observe a step-by-step explanation on how an Operating System helps a program to execute: TODO: fix numberings ----------------------------- TODO: Continue -----------------
- Firstly, the user launches the program.
This could be a simple program double-click from inside a file explorer GUI or a direct command input from a console ordering a program to launch.
- Secondly, Upon receiving this launch command the Operating System allocates a physical memory (RAM) block just for this program.
- Thirdly, the OS loads any program code currently saved in the secondary memory (e.g., HDD/SSD) onto the RAM block.
- As the final step, the Operating System instructs the CPU to run the program.
But this doesn't necessarily mean the CPU will run it, per se. CPU might run the program straightaway, or not. This is simply because of the different states a process passes through as it executes.
Let's take a look at it in the next section.