Types of primary storage
There are two types of primary storage:
- Read only memory (ROM)
- Random access memory (RAM)
ROM
ROM contains the bootstrap instructions that are used to start up the computer. These essentially tell the computer where to find the operating system and set up the BIOS (Basic input output system) which allows operating system
to communicate with the hardware.
ROM is non-volatile meaning data in ROM is still stored when the power is off. This is essential in order to start the computer. ROM can be read
from but not generally written to. The instructions on starting the computer rarely change, if ever. Some embedded devices will occasionally flash the ROM replacing the old code with new but the user cannot access it themselves.
RAM
RAM is where currently running programs and data they require are copied to so they can be accessed by the processor. RAM is volatile so data that is in RAM is lost if the power to the computer is cut. RAM can be read from
and written to. The more RAM you have the more things you can have open and running at the same time.
Virtual memory
Virtual memory is where a section of the hard disk is temporarily used as main memory. Having virtual memory prevents a user from experiencing an out of resources message and having to shut some applications.
When RAM is
almost full, and the user requests another program or file that is too big to fit, then something currently in RAM that the CPU is not trying to use is moved from RAM to virtual memory to make room for the new program/data
Before a program or data that is in virtual memory can be used by the processor again, they must first be swapped from virtual memory back into RAM. When virtual memory is in high usage this can lead to high disk usage known
as disk thrashing as files are moved back and forth between RAM and virtual memory.