Where is an Operating System Stored?

An operating system is stored in different ways depending on the type of microprocessor it was written for. A processor has a number of registers which are very fast memory locations within the processor itself so that it can work very fast. Some examples include:

  • The program counter keeps track of where the next machine code instruction is to be read.
  • The stack pointer keeps track of the current top of the stack, and the base pointer keeps track of where in memory it is pointing to.
  • General Purpose Registers such as ALU (Arithmetic Logic Unit), etc…

Most modern Operating Systems are written for a 32bit microprocessor because they use 4 Byte words, which means they can address up to 2^32 Bytes of memory. However, there are microprocessor manufacturers that make 16bit processors and even 8bit processors..

Main Memory – These are all the RAM chips within your computer.

  • Most modern Operating Systems are written for a 32bit Microprocessor, but older ones were written for an 8bit processor.

ROM – These are Read Only Memory Chips, meaning they can’t be written to! Some examples include:

  • BIOS Chip in your computer contains the machine code instructions for how to initialize all hardware components when you first turn it on.
  • Wireless LAN Cards have a Machine Code program that is executed when the wireless network card is plugged in, allowing it to connect to a Wireless Access Point.

Flash Memory – This is similar to ROM because you can’t write to it. The only difference is that the microprocessor can read from and write to this type of memory. Some examples include:

  • USB Pen drives have this type of memory, allowing them to be plugged in and accessible by your computer.
  • SSD’s which are Solid State Drives have this type of memory, allowing very fast access times because there are no moving parts unlike traditional spinning hard disk drives.

Virtual Memory

This is a representation of the Operating System itself that allows it to appear as though it has more memory than it does. For example, if the Operating System had 500MB of RAM and you opened 10 programs, it might look as though there is 6000MB of RAM in total due to the virtual memory. This allows more programs to be open at once without running out of physical memory.

What are the steps for booting an operating system?

When you turn on your computer it goes through a number of steps to initialize the hardware and start executing code.

  • Power On Self Test (POST) – CPU, RAM, etc… will be tested for any errors.
  • BIOS Chip – The BIOS chip contains machine code instructions for bootstrapping everything else within the computer. It will initialize the computer hardware to a known state, load the operating system(s) from disk into memory and then start executing it.
  • Boot Loader – Once the Operating System is loaded into Memory, it begins executing its boot loader which loads itself into memory using one of various methods.
  • Operating System Initialization – The Operating System itself will initialize all of its components including device drivers. It may also perform tasks such as checking for new updates to the operating system if it is a more modern one with an updater built in.
  • Running Applications – At this point you can run applications within the operating system!