Read-only memory

By Martin McBride, 2017-03-05
Tags: rom bios firmware flash memory
Categories: memory and storage memory

Read-only memory (ROM) is similar to RAM, except that the data is hard wired into it. The data is non-volatile (it is preserved even when the power is off). It is also read only, which means that the CPU cannot change the data stored in the ROM.

How computers start up

Computer programs are stored on your disk as data files, just like any other file. When you run a program, the operating system loads the program file from disk into memory, and starts it running.

The operating system itself is also a program, stored on disk.

The question is, when the computer first starts up, how does it load the operating system from disk into memory? It can't use the operating system to load itself, because it can't run the operating system until after it has been loaded. And it can't rely on any other programs stored in RAM, because when the computer is first switched on, the RAM is empty.

In fact, the computer uses on a small program stored in ROM, containing just enough code to get the system running.

BIOS ROM

The BIOS ROM contains the code necessary to boot up the system. Since it is a ROM, the code is always available, even straight after powering the computer up.

BIOS stands for Basic Input/Output System. It usually contains the following:

  • The code needed to access the keyboard, display, disks and network hardware.
  • Some self test software which automatically performs simple tests on the system memory and hardware before starting up.
  • Code to load the operating system.

When the CPU first powers up, it runs the BIOS code, which perform the hardware tests, and then loads and runs the operating system.

Firmware

The software in the BIOS ROM is sometimes called firmware. This is because:

  • The hardware, the physical computer, is fixed (unless you take the back off and start adding or removing components).
  • On the other hand, you can change the software you are running very easily. If you are running a spreadsheet application and you want to run a word processing application instead, you just need to click the icon and it will start.
  • Firmware is somewhere in between. It isn't as easy to change, but it isn't a physical item like hardware. The name is chosen to reflect this.

Flash BIOS

In modern computers, the BIOS is usually stored in Flash memory.

This memory behaves exactly the same as ROM - it is non-volatile and read-only. However, it is possible to rewrite the content of the Flash memory by accessing it in a special mode. This allows the firmware to be updated by the computer manufacturer, particularly if any security problems are found.

Why is starting a computer called booting?

The term most likely comes from the word bootstrap. A bootstrap is literally a small leather loop on the back of a pair of boots which you can use to help pull the boots on. This led to an old expression, where you might tell someone to "lift themselves up by their own bootstraps", which of course is impossible to do. The expression is also sometimes used when someone achieves success, against all the odds, due to their own hard work. We might say that they pulled themselves up by their bootstraps.

Using a little bit of software stored in ROM to load up the main software fits in with this idea. So, probably as a joke, the software was called a bootstrap loader. The software pulls itself up by its bootstraps. And the name stuck.

So starting a computer involves running the bootstrap loader, and a short way to say this is booting the computer.

See also

Sign up to the Creative Coding Newletter

Join my newsletter to receive occasional emails when new content is added, using the form below:

Popular tags

555 timer abstract data type abstraction addition algorithm and gate array ascii ascii85 base32 base64 battery binary binary encoding binary search bit block cipher block padding byte canvas colour coming soon computer music condition cryptographic attacks cryptography decomposition decryption deduplication dictionary attack encryption file server flash memory hard drive hashing hexadecimal hmac html image insertion sort ip address key derivation lamp linear search list mac mac address mesh network message authentication code music nand gate network storage none nor gate not gate op-amp or gate pixel private key python quantisation queue raid ram relational operator resources rgb rom search sort sound synthesis ssd star network supercollider svg switch symmetric encryption truth table turtle graphics yenc