What is it called when the computer is first turned on and loads the operating system into the primary memory?

A computer without a program running is just an inert hunk of electronics. The first thing a computer has to do when it is turned on is start up a special program called an operating system. The operating system's job is to help other computer programs to work by handling the messy details of controlling the computer's hardware.

The process of bringing up the operating system is called booting (originally this was bootstrapping and alluded to the process of pulling yourself up "by your bootstraps"). Your computer knows how to boot because instructions for booting are built into one of its chips, the BIOS (or Basic Input/Output System) chip.

The BIOS chip tells it to look in a fixed place, usually on the lowest-numbered hard disk (the boot disk) for a special program called a boot loader (under Linux the boot loader is called Grub or LILO). The boot loader is pulled into memory and started. The boot loader's job is to start the real operating system.

The loader does this by looking for a kernel, loading it into memory, and starting it. If you Linux and see "LILO" on the screen followed by a bunch of dots, it is loading the kernel. (Each dot means it has loaded another disk block of kernel code.)

(You may wonder why the BIOS doesn't load the kernel directly — why the two-step process with the boot loader? Well, the BIOS isn't very smart. In fact it's very stupid, and Linux doesn't use it at all after boot time. It was originally written for primitive 8-bit PCs with tiny disks, and literally can't access enough of the disk to load the kernel directly. The boot loader step also lets you start one of several operating systems off different places on your disk, in the unlikely event that Unix isn't good enough for you.)

Once the kernel starts, it has to look around, find the rest of the hardware, and get ready to run programs. It does this by poking not at ordinary memory locations but rather at I/O ports — special bus addresses that are likely to have device controller cards listening at them for commands. The kernel doesn't poke at random; it has a lot of built-in knowledge about what it's likely to find where, and how controllers will respond if they're present. This process is called autoprobing.

You may or may not be able to see any of this going on. Back when Unix systems used text consoles, you'd see boot messages scroll by on your screen as the system started up. Nowawadays, Unixes often hide the boot messages behind a graphical splash screen. You may be able to see them by switching to a text console view with the key combination Ctrl-Shift-F1. If this works, you should be able to switch back to the graphical boot screen with a different Ctrl-Shift sequence; try F7, F8, and F9.

Most of the messages emitted boot time are the kernel autoprobing your hardware through the I/O ports, figuring out what it has available to it and adapting itself to your machine. The Linux kernel is extremely good at this, better than most other Unixes and much better than DOS or Windows. In fact, many Linux old-timers think the cleverness of Linux's boot-time probes (which made it relatively easy to install) was a major reason it broke out of the pack of free-Unix experiments to attract a critical mass of users.

But getting the kernel fully loaded and running isn't the end of the boot process; it's just the first stage (sometimes called run level 1). After this first stage, the kernel hands control to a special process called ‘init’ which spawns several housekeeping processes. (Some recent Linuxes use a different program called ‘upstart’ that does similar things)

The init process's first job is usually to check to make sure your disks are OK. Disk file systems are fragile things; if they've been damaged by a hardware failure or a sudden power outage, there are good reasons to take recovery steps before your Unix is all the way up. We'll go into some of this later on when we talk about how file systems can go wrong.

Init's next step is to start several daemons. A daemon is a program like a print spooler, a mail listener or a WWW server that lurks in the background, waiting for things to do. These special programs often have to coordinate several requests that could conflict. They are daemons because it's often easier to write one program that runs constantly and knows about all requests than it would be to try to make sure that a flock of copies (each processing one request and all running at the same time) don't step on each other. The particular collection of daemons your system starts may vary, but will almost always include a print spooler (a gatekeeper daemon for your printer).

The next step is to prepare for users. Init starts a copy of a program called getty to watch your screen and keyboard (and maybe more copies to watch dial-in serial ports). Actually, nowadays it usually starts multiple copies of getty so you have several (usually 7 or 8) virtual consoles, with your screen and keyboards connected to one of them at a time. But you likely won't see any of these, because one of your consoles will be taken over by the X server (about which more in a bit).

We're not done yet. The next step is to start up various daemons that support networking and other services. The most important of these is your X server. X is a daemon that manages your display, keyboard, and mouse. Its main job is to produce the color pixel graphics you normally see on your screen.

When the X server comes up, during the last part of your machine's boot process, it effectively takes over the hardware from whatever virtual console was previously in control. That's when you'll see a graphical login screen, produced for you by a program called a display manager.

The Rajasthan Subordinate and Ministerial Services Selection Board (RSMSSB) has released the additional Rajasthan Patwari Final Result for the recruitment cycle 2021. A total of 94 candidates are selected for the Patwari Recruitment 2021. The RSMSSB is soon going to release a new notification for Rajasthan Patwari Recruitment 2022. The selection of the candidates depends on two rounds - A written Exam and a Personal Interview. With an expected salary of Rs. 20,800 to Rs. 20,800, it is a golden opportunity for job seekers.

When you turn on the power to a computer, the first program that runs is usually a set of instructions kept in the computer's firmware called the boot ROM. For a typical PC, this can be the basic input output system (BIOS), or on newer machines, the unified extensible firmware interface (UEFI). This code examines the system hardware to make sure everything is functioning properly and in the case of UEFI, that the boot software is legitimate and secure. Once the test has successfully completed, the firmware continues the boot process.

The bootstrap loader, or boot loader, is a small program that has a single function: It loads the operating system into memory and allows it to begin operation. In the most basic form, the bootstrap loader sets up the small driver programs that interface with and control the various hardware subsystems of the computer. It sets up the divisions of memory that hold the operating system, user information and applications. It establishes the data structures that hold the myriad signals, flags and semaphores that are used to communicate within and between the subsystems and applications of the computer. Then it turns control of the computer over to the operating system.

The operating system's tasks, in the most general sense, fall into several categories:

  • Processor management
  • Memory management
  • Device management
  • Storage management
  • Application interface
  • User interface
  • System security management

These tasks define the core of nearly all operating systems. Next, let's look at the tools the operating system uses to perform each of these functions.

Learn more about the startup sequence of a computer.

In this step, you’ll learn how the components of a computer work together from the moment you press the “on” button.

The startup sequence

From the moment you press the power button, a whirlwind of tasks happen inside your computer.

Let’s have a look at each of the components and systems that work together to start up your computer.

CPU

The CPU, or central processing unit, is a large chip inside the computer. This is the brains of the computer: it controls everything. It works by reading instructions and data from the random access memory (RAM), performing an instruction, and then writing the data back to RAM. Some of the instructions may involve other components like the hard drive, but the CPU is in control.

What is it called when the computer is first turned on and loads the operating system into the primary memory?

RAM

RAM temporarily stores data while your computer is running.

  • RAM is both readable and writable. You can add, change, and delete data stored in RAM.
  • It is volatile. When the computer is switched off, all the data stored in RAM is lost.
  • It is fast.

What is it called when the computer is first turned on and loads the operating system into the primary memory?

ROM

ROM stands for read-only memory. It is a chip containing data installed by the manufacturer that is not typically replaced or upgraded. It stores the BIOS.

  • ROM is read-only. It is usually programmed by the computer manufacturer, and cannot be changed or overwritten. (There is a process for overwriting the ROM, called “flashing” it, but it’s difficult and can lead to a completely broken and unrecoverable computer.)
  • ROM is non-volatile memory, which means it does not need power to keep the data inside it.
  • It is fast.

What is it called when the computer is first turned on and loads the operating system into the primary memory?

Hard Drive

The hard drive (sometimes called the hard disk) is the main storage device in your computer. Like RAM, it can be added to and changed, and like ROM it is non-volatile, but it is slow. If you have files and folders on your computer, are stored on the hard drive. The operating system is also stored on the hard drive.

What is it called when the computer is first turned on and loads the operating system into the primary memory?

BIOS stands for Basic Input Output System. The BIOS is stored in the ROM. It contains all the basic code for controlling your computer hardware (such as keyboards, mice, monitors and hard drives). After the startup sequence is complete, and control has gone to the operating system, the BIOS does very little.

When you start up your computer, you may see a black screen displaying “Press F2 for Setup”. This is the BIOS. By pressing F2, you enter a setup screen where you can change where the BIOS loads the operating system from.

The operating system is normally stored on the hard drive, but you can load an operating system from a USB drive or a CD instead.

Startup sequence

So, how are these components used in the startup sequence?

  • The CPU starts and fetches instructions into RAM from the BIOS, which is stored in the ROM.
  • The BIOS starts the monitor and keyboard, and does some basic checks to make sure the computer is working properly. For example, it will look for the RAM.
  • The BIOS then starts the boot sequence. It will look for the operating system.
  • If you don’t change any of the settings, the BIOS will fetch the operating system from the hard drive and load it into the RAM.
  • The BIOS then transfers control to the operating system.

That’s a lot of information and acronyms!

Hopefully, this step has helped you understand what happens underneath the bonnet of a computer when you turn it on. Once you know this sequence, you can create some really fun lesson plans based on it…

An example lesson

Give students or teams of students a component each:

  • CPU
  • BIOS
  • ROM
  • RAM
  • Operating system

Place them at different tables around the room with some paper. There should be some distance between the students so that everyone can clearly see what’s happening.

Get each team to discuss the key features of their component and write them down on a large piece of paper. They could use their notes, or this could be a test of what they’ve learnt so far.

Run through a simple scenario. For example, “I’m writing a document in Word and my computer crashes. What does RAM do?”

Get the students to physically throw a piece of paper that was on the RAM table into the bin. It’s lost without power. Throw ROM’s data in the bin, and ask the students: is this correct?

Run through the more complicated startup sequence. Have a piece of card with the word CONTROL on it to indicate who has control. Each team has to say what they’re doing as they’re doing it. For example:

I am the BIOS. I’m just going to go over here and check that I have some RAM.

Give a high five to the RAM team

OK, RAM is there. Now I’m going to look for the operating system.

Go over and give a thumbs up to the OS team

I’m going to pick the OS up and put it in the RAM.

The OS team follows BIOS over to the RAM table

Go through several iterations of the startup sequence until the students understand it without looking at their notes. If you can, get them to perform the startup sequence for another class.

Physically modeling the startup sequence is a great learning opportunity for students. Once they can visually see what is happening with the components during startup, they will remember the sequence more easily.

For more detailed descriptions of what’s happening inside some of these components, check out our How Computers Work course.