You are on page 1of 4

What is an Operating System?

An Operating System is an application that controls a computer. This is not the same as the
applications that you create - those are usually only run when you want them. An OS runs almost
as soon as the computer is turned on.
Windows is an Operating System, as is Linux and the Apple Mac OS X.
Switching On
When a computer is powered up, the CPU starts running immediately. But what does it run? On
most PCs, whether Linux, Windows or Mac, there is a boot program stored permanently in the
ROM of the PC.
Booting Up
Each PC motherboard manufacturer writes a boot program for their motherboard.
This boot program is not an Operating System (OS), it is there to load the OS. Its first job is the
Power On Start-Up Test (aka POST). This is a system test, first checking the memory and
flagging any errors. It will stop the system if something is wrong. Next it resets and initializes
any devices plugged into the PC. This should result in the OS being loaded from whichever
device has been configured as the boot device, be it Flash RAM, CD-Rom or hard disk. Having
successfully loaded the OS, the boot program hands over control and the OS takes charge.
Managing The PC
The job of an OS is to manage all the resources in a computer. When user input is received from
mouse and keyboard it has to be handled in a timely fashion. When you create or copy a file, the
OS takes care of it all behind the scenes. It may store a file in a hundred different places on disk
but it keeps you well away from that level of detail. You'll just see one file entry in a directory
listing.
An OS is just a very complex collection of applications and nowadays takes hundreds or
thousands of man hours to develop. We've come along way since Dos 6.22 which fitted on a 720
Kb floppy and Vista promises to be very large- 9 or 10 Gigabytes.
Protection and Security
Modern CPUs have all sorts of tricks built into their hardware - for example CPUs only permit
trusted programs to run with access to all of the hardware facilities. This provides extra safety.
In Ring 0 protection on Intel/AMD CPUs, the code at the heart of the OS, usually called the
Kernel code, is protected against corruption or overwriting by non Kernel applications - the kind
you and I write. Nowadays it is rare for a user written program to crash a computer. The CPU
will stop any attempt to overwrite Kernel Code.
Also, the CPU has several privileged instructions that can only be run by Kernel Code. This
enhances the robustness of the OS and reduces the number of fatal crashes, such as the infamous
Windows Blue Screen of death.
The language C was developed to write Operating Systems code and it is still popular in this role
mainly for Linux and Unix systems. The Kernel part of Linux is written in C.
The operating system is arguably the most important piece of software on your PC. Read What is
Software? and What is a Programming Language? for more insight into how your computer
works.

What is Software?
A computer is a physical collection of bits that you can touch. The screen, main system box,
keyboard and mouse etc. But inside is this mystical stuff called software. Before we look at it,
let's have a look inside the computer.
At its simplest a computer is made up of the following parts, most of them in the system unit.
A Central Processing Unit (also called a CPU)
Read-Only Memory (ROM) that holds Permanently Stored instructions.
Random Access Memory (RAM) to hold software and data.
Input and Output Devices such as Screen, Keyboard, Mouse and Printer.
A permanent storage device such as a hard disk, floppy disk or Flash drive.
But what exactly is software?
It is the combination of Instructions and Data, known as machine code that forms the building
blocks of applications such as Word Processor, Computer Game or Spreadsheet.
This machine code lives in the memory of the computer as billions of little on off switches.
Exactly the same as a number in a calculator.
A computer is a physical collection of bits that you can touch. The screen, main system box,
keyboard and mouse etc. But inside is this mystical stuff called software. Before we look at it,
let's have a look inside the computer.
At its simplest a computer is made up of the following parts, most of them in the system unit.
A Central Processing Unit (also called a CPU)
Read-Only Memory (ROM) that holds Permanently Stored instructions.
Random Access Memory (RAM) to hold software and data.
Input and Output Devices such as Screen, Keyboard, Mouse and Printer.
A permanent storage device such as a hard disk, floppy disk or Flash drive.
But what exactly is software?
It is the combination of Instructions and Data, known as machine code that forms the building
blocks of applications such as Word Processor, Computer Game or Spreadsheet.
This machine code lives in the memory of the computer as billions of little on off switches.
Exactly the same as a number in a calculator.
The CPU is the Brain
The heart of the computer is the CPU plus its RAM. The CPU fetches data from RAM, carries
out operations on the data and then stores it back in RAM. The CPU can also fetch data from
permanent storage such as ROM, floppy disk, Flash or hard disk. It's permanent because when
the power is switched off, a copy remains there.
The data in memory (RAM or ROM) is organised in blocks of 8 switches. Each switch is known
as bit and a block is a byte. Each bit can be On or Off. When a bit is On, it has the value 1, when
its Off it has the value 0. This is called Binary Notation. There are 256 different combinations of
8 bits with the values 0 to 255.
Table of Bit Values


Bits - Value
00000000 - 0
00000001 - 1
00000010 - 2
..
11111111 - 255

Binary Conversion 101
In normal numbers, a value like 456 is made up of 4 x 100 + 5 x 10 + 6 x 1. This is a base 10
number. 1011
2
is a base 2 number which is equal to 8 x 1 + 4 x 0 + 2 x 1 + 1 x 1 = 11 in base 10.
Most programmers don't need or use binary, but in C it can be a useful skill to have.
A CPU handles data in multiples of 8 bits. In the 1980s when Home Computers like the CBM-64
existed, the CPUs were 8 bit processors, reading single bytes of data and could only execute
three hundred thousand instructions per second. Now they can handle 64 bits of data in one go.
Longer bit length means that the CPU is faster as it processes more data with each instruction.
How Big is a Program?
Computer programs can be as small as a few hundred bytes or as large as a few billion bytes.
When a program is loaded into RAM from disk, the pattern of the bits is copied exactly- even
one bit wrong can cause the program to fail. Computer hardware has been engineered so this
doesn't happen.
If an application is 40 Megabytes in size, then roughly 320 Million bits are copied into RAM.
The prefix Kilo, Mega and Giga indicate the size of a program or data file in bytes. A Kilobyte is
1024 bytes, a Megabyte is 1024 Kilobytes and a Gigabyte is 1024 Megabytes. Put another way, a
Gigabyte is 8,589,934,592 individual on/off switches!
Instructions are just data
The CPU is driven by machine code instructions and data - this is the stuff of software, just a
pattern of bits in RAM. Instructions and data are indistingushable- they're just bit patterns. A
typical CPU can read and process hundreds of millions of instructions each second. It is possible
to program computers by just entering numbers directly into RAM but it is a very tedious and
unproductive way of doing things.
The term computer language includes a wide variety of languages used to communicate with
computers. It is broader than the more commonly-used term programming language. Programming
languages are a subset of computer languages. For example, HTML is a markup language and a
computer language, but it is not traditionally considered a programming language. Machine code is a
computer language. It can technically be used for programming, and has been (e.g. the original
bootstrapper for Altair BASIC), though most would not consider it a programming language.

Computer languages can be divided into two groups: high-level languages and low-level languages. High-
level languages are designed to be easier to use, more abstract, and more portable than low-level
languages. Syntactically correct programs in some languages are then compiled to low-level language
and executed by the computer. Most modern software is written in a high-level language, compiled into
object code, and then translated into machine instructions.

Computer languages could also be grouped based on other criteria. Another distinction could be made
between human-readable and non-human-readable languages. Human-readable languages are designed
to be used directly by humans to communicate with the computer. Non-human-readable languages,
though they can often be partially understandable, are designed to be more compact and easily
processed, sacrificing readability to meet these ends.

You might also like