Starting up the Operating System

Starting up the operating system

When your computer has completed the Startup Sequence, the BIOS passes control to the Operating System. Operating Systems control the computer’s resources, software and hardware. Examples of common Operating Systems are Windows 10, Mac OS and Linux.

In this step, we are going to look at some factors that affect the speed and performance of the operating system, particularly during start up.

CPU Speed

Clock

Inside the CPU there is a “clock” that ticks back and forth from high voltage to low voltage in a very precise time. At its very basic level, a CPU is dealing with binary instructions and data. Most CPUs work on 64 bits at a time. It is important that all 64 bits are processed at exactly the same time. This is why the CPU has a clock, it keeps everything in sync.

Every time the clock “ticks” or pulses, an instruction can be carried out. Though some instructions can take multiple pulses to complete.

Clock speed is measured in Hertz, a unit of frequency, representing how many times the clock pulses per second. Computer speed is described in Gigahertz (GHz). There are one billion (1,000,000,000) Hertz in a Gigahertz.

A typical clock speed on a PC runs from 1GHz to about 3.8GHz.

My computer’s clock speed is 1.6Ghz. So in theory my CPU can carry out one point six billion instructions per second. That’s one instruction after the other. The CPU does not carry out multiple instructions at the same time.

The faster the clock speed, the faster the startup.

Cores

Modern CPUs can have multiple cores - which can run multiple instructions at the same time. A computer with two CPU cores is called a dual-core CPU. So the operating system can send an instruction to each core, and the instructions will be done at the same time. This can increase the speed of your system.

However, more cores does not always mean more speed. It depends on the task being completed. Some tasks have instructions that can run in parallel. Other tasks require the previous instruction to be completed before the next instruction starts. For example, calculating the factors of a number is a task that can be run in parallel. The instructions for the factors of 24 can be sent to different cores to get quicker answers:

Instruction A 24 / 2

Instruction B 24 / 3

An illustration of a CPU with two cores. Core 1 is executing instruction A, core 2 is executing instruction B

However, the Fibonacci sequence has to be run in order. In the Fibonacci series, each number is the sum of the two preceding ones. So you need the two previous answers to calculate the next result. You can’t run them in parallel. In the example below, you cannot work out F3 until you have F2. So you can’t send Instruction B to one core at the same time as Instruction A.

F0 = 0
F1 = 1

Instruction A. 
F2 = F0 + F1
0 + 1
1

Instruction B. 
F3 = F1 + F2
1 + 1
2

An Illustration of the steps above to calculate terms in the Fibonacci sequence

The more cores you have, the faster your CPU will perform certain actions. This includes the startup sequence.

Disk Speed

The speed of your Hard Drive will affect your operating system. Remember the Hard Drive stores your operating system and loads it into the RAM on startup. The speed that your Hard Drive can do this affects the start up. Total disk speed is measured in megabytes per second. There are 1,000,000 bytes in a megabyte.

Hard Drives store data on spinning disks, and reads/writes data on to them using an arm with a magnetic head.

Solid State Drives are faster than Hard Drives and will start up a machine quicker. This is because they have no moving parts. There is no delay in waiting for records to spin and for the needles to move.

We’ll look at these devices in more detail next week.

RAM

The Operating System runs in RAM. The speed of the RAM itself is how fast it transfers data. It is measured in Megahertz. How fast the RAM works greatly depends on its cache and its size, not just its own speed.

Cache

A cache is a piece of memory that stores data locally to speed up data retrieval. Web browsers use cache to store data from a web page that doesn’t change often.

E.g. Your computer doesn’t retrieve the logo and background from twitter each time you visit the website. Your browser stores these locally and displays them when you load the twitter page.

An illustration of how a cache is employed. On the first visit to twitter, all of the website is downloaded and displayed. The user's profile pic, the twitter logo and the background colour are stored in the cache on the hard drive. On the second visit, the website (with new messages) minus these elements is downloaded, and then combined with the elements from the cache to give the full site.

A disk cache is a dedicated block of memory in RAM that bridges storage and CPU.

When the Operating System reads a file from the Hard Drive, the cache takes a larger block of data than is required. If the operating system needs more data, it will check the cache in the RAM first to see if it’s already available. This saves reading from the slow hard drive again.

The RAM has its own cache, commonly called L1 and L2. These are physically located on the CPU and are even faster than normal RAM.

Size

The size of your RAM can affect speed. If there is insufficient space in the RAM, your operating system will store temporary data in the Hard Drive. This is much slower than storing data in the RAM. So the more RAM you have the faster your operating system can be.

Other Factors

Other minor factors affecting your computer’s performance on startup include…

  • What you have plugged in.
  • Network Connections.
  • Software that opens on startup.

Discuss

  • Can you find your computer’s clock speed and core count?
  • How many instructions could your computer theoretically carry out per second?

Post your findings in the comments section. How does your computer compare to the other learners? How does it compare to mine?

Share this article:

This article is from the free online course:

Understanding Computer Systems

Raspberry Pi Foundation