Operating System is a piece of software that controls all your computer resources while the computer is in use. Often people have questions like where the operating system is stored on the computer or how it is being used by CPU? Someone says it is stored in RAM while other says it is on the hard disk. This article covers how exactly the Operating system is stored in the computer.
RAM (Random Access Memory) is the volatile memory space that stores the data which is directly accessed by CPU (Central Processing Unit). The data/software access from the RAM is much faster than the access from the hard disk, so computer’s speed directly depends on the RAM as if there is higher memory space in the RAM, it will reduce the time to read data from hard disk. But since it is volatile, as soon as computer is turned off, the data stored in the RAM lose.
So in computers, Operating System is installed and stored on the hard disk. As hard disk is a non volatile memory, OS does not lose on the turn off. But as the data access from the hard disk is very, slow just after the computer is started OS is copied into RAM from the hard disk. BIOS, which is the first program that run on the start up of the computer loads the entire OS into the RAM. So instead of accessing OS from the hard disk, CPU directly access it from the RAM.
When you turn off the computer, since the RAM is volatile memory the copy of the OS in it is lost. But the main operating system is stored in to the hard disk, it will be safe and next time when the computer will be turn on, it will be ready to load in the RAM again.