You are on page 1of 5

J.E.D.I.

1 Introduction to Operating Systems


1.1

Objectives

This chapter serves as an introduction to operating systems. We discuss different operating


system definitions. At the end of the chapter, the students should be able to provide a good
definition to what an operating system is.

1.2

What is an Operating System?

There are many definitions for an operating system. For our discussion, we will consider the
following three definitions:

Definition by parts

Definition by functionality

Definition by goals

1.3

Definition by parts

1.3.1

Everyday definition

One may consider the operating system to be the program that comes with the computer when
you first buy it. This could be your Open Solaris system, Linux system, Windows XP system,
etc, together with all of the programs that come with it.
However, this begs the question. Are ALL the programs that are included in the default
installation part of the operating system? Is Mindsweeper part of the Windows XP operating
system? Is the Konqueror web browser part of the Open Solaris system? Would the computer
stop running when these programs are stopped or deleted from the system?

1.3.2

Better definition: Kernel

We could define our operating system as that one program that is running all the time. This is
also called the system kernel. The kernel is the program that provides all the basic
functionalities to make your program work. All other programs are simply application programs
which run on top of the kernel, using built-in operating system libraries in order to run.

1.4

Layered view

To provide a definition by functionality, let us first take a look at a layered view of the
computer system, to see where the operating system lies.

Operating Systems

J.E.D.I.

1.4.1

Physical layer

The lowest layer of the computer is the physical device layer. This represents the raw
transistors, switches, wires and capacitors of your computer. The values 0 and 1 are
represented here as voltage differences.

1.4.2

Microarchitecture level

At the microarchitecure level, the circuity of the physical layer is combined to form meaningful
circuits that are used to store 0s and 1s, perform simple mathematical and logical operations,
send/receive data over wire or load/save data into a medium.
For example, transistors can be combined in a certain way to perform binary addition. Circuits
are arranged in a certain way as to enable a bit to be stored in your hard disk. This layer
provides for the layer above it an abstract view of hardware: no longer do the above layers
have to worry about voltages or circuits. We can now think in terms of 0s and 1s . We do not
have to worry about how numbers are added.

1.4.3

Machine Language

The machine language level bundles up the features of the microarchitecture level into a set of
instructions which form the programming language of your CPU. Instructions from the layers
above are converted into machine language which are then made to run at the
microarchitecture level. Some machine language instructions may take several
microarchitecture components and operations to run (ex: division), but the machine language
provides only a single instruction for this.

1.4.4

Operating System Kernel

Machine level language is often very complicated. Saving files to a disk for example means
specifying what track, cylinder and sector on the hard disk to save individual bits on. Printing
to the screen means specifying what memory address to write the data, and then instruct the
CPU to send that data to the video card. Machine language is in numeric format and programs
are written in hexadecimal.
The Operating System Level abstracts machine language from the levels above it. A single
"save file" instruction is used instead of tedious sector by sector writing. Memory allocation is
also handled here. Programming in machine language means having to worry about exactly
what location in memory to store your program.
There are also additional features, such as allowing multiple programs to run at the same time
Operating Systems

J.E.D.I.

on the CPU, protecting programs from illegal instructions or accessing memory belonging to
other programs.
The OS level differentiates from protected mode to user mode. Instructions run in protected
mode can be executed only by the operating system; these are instructions that can
potentially damage the computer (such as sending information to the monitor, causing it to
burn out) or other processes (writing to memory without restrictions). User mode instructions
are only a subset of instructions the the machine language provides.

1.4.5

System tools

System tools are additional programs provided by the operating system publisher. These are
not part of the operating system kernel. However they form an integral part of the operating
system. These programs are the command line program, compilers, program for user
password changing, etc.
Although these tools run in user mode, they are allowed access to some protected mode
instructions, as these are trusted programs created by the OS system developers.

1.4.6

Application programs

Finally, at the top of the heap are our user programs. These take advantage of all of the lower
levels in order to provide the functionalities we require of them.

1.4.7

Functionality definition

As can be seen, the operating system acts as an intermediary between hardware and user
programs. It provides a simpler view of the underlying hardware for user programs. Also, it
translates user program instructions to hardware instructions

1.5

Major functionalities

What functionalities does the operating system provide to the layers about it then? We will
discuss the following

Process Handling

Memory Management

I/O Management

File storage

Protection System

Command Interpreter System

1.5.1

Process Handling

Normal computer use now requires multiple applications to be run at the same time. However,
the CPU itself can only handle one instruction at a time! The OS provides functionalities that
allow the CPU to switch tasks, sometimes running one program, sometimes another, all
abstracted from the view of the programs themselves. The OS provides scheduling routines,
giving priority to some processes, how to deal when processes are deadlocked and
synchronization handling.

Operating Systems

J.E.D.I.

1.5.2

Memory management

Executing programs require memory space to run. The operating system answers some of the
following issues:

Memory allocation and deallocation

What if memory space isn't contiguous? The OS must provide a way to make it appear
to the program that it is running on continuous memory. Memory allocated to the
application is distributed.

What if there isn't enough space for a program to run but a lot of idle programs are
clogging up memory?

What if a program needs more memory than it is allocated with ?

1.5.3

I/O Management

Programming an application used to mean programming for every type of hardware that would
come with it. Old word processing programs have to handle every kind of printer in the
market. New printers would mean having to wait for the programmers to release a new version
of the word processing application to handle these new printers. Now, operating systems
provide a generic interface for whatever hardware is being used for the computer.
In addition, I/O handles some questions like what to do if more than one application wants to
send data to the printer at the same time.

1.5.4

File Storage

Of course , computer usage does not involve just running programs or sending information to
devices. A significant portion of your hard disk space is data, such as document files, video
files, music files, etc.
The operating system should

be able to create, delete, manipulate, load and save files

be able to manage directories

know where the files are actually stored in the storage media

provide an easy and standard ways to store data even among different storage media
types

The file system should be able to address the following:

Where the file is stored in the hard disk

How does the OS know if that area of the hard disk is free or not?

How to load the data efficiently

Who can access the file (security)

Is the file readable, writable, and/or executable?

How to handle saving files if they have to be spread out (no single block of continuous
space large enough to store file)

1.5.5

Protection System

As the OS handles multiple processes by multiple uses, there must be a way to provide
security for these processes and users.
Operating Systems

J.E.D.I.

1.5.6

Command Interpreter

The OS should provide a way for users to enter commands, either via a command-line
interpreter or via a graphical user interface

1.6

Definition by Goals

We have seen where the operating system resides in the computer, and what operating system
provides the user, we now ask the question: what are the goals of an operating system?
According to authors Silberschatz and Galvin of the book Operating Systems Concepts, the
goals of an operating system are convenience and efficiency.

1.6.1

Convenience

It is the current trend of operating systems to make it easy for users to access and use the
computer. Hardware details should be abstracted from the user. Instructions should be simple.
User-friendliness is a paramount concern.

1.6.2

Efficiency

Efficiency means having the computer operate to its fullest potential. Some of the ways to
achieve this are:

Do other tasks while waiting for user input

Allow for multiple tasks to operate at the same time

Organize files in the hard disk and processes in memory for speedy access

Operating Systems

You might also like