Operating Systems

From Coder Merlin
Revision as of 10:21, 13 November 2020 by Guanyu-su (talk | contribs)
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

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:

Computer system architecture

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 -----------------

  1. 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.

  1. Secondly, Upon receiving this launch command the Operating System allocates a physical memory (RAM) block just for this program.
Hint.pngHelpful Hint
This sort of sandboxing is put in place to avoid programs from interfering with each other
  1. Thirdly, the OS loads any program code currently saved in the secondary memory (e.g., HDD/SSD) onto the RAM block.
  2. As the final step, the Operating System instructs the CPU to run the program.
Going DeeperGoingDeeperIcon.png
Upon an Operating System's instructions, the CPU will start executing a process.

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.