You are on page 1of 32

01 Introduction to

Operating Systems

Operating Systems

Outline

Introduction

Definition by parts

Definition by functionalities

Definition by goals

Operating Systems

What is an Operating
System?

There are many definitions for what an Operating System is


and what it does.

Definition by parts

Definition by functionality

Definition by goals

We will discuss these definitions in this chapter

Operating Systems

Everyday Definition

One might consider the Operating System to be the


program that comes with the computer when you first buy it.

Operating Systems

Everyday Definition

But not all the components of the Operating System do


really help out with operating the system

Is Minesweeper part of the Operating System?

Is your web browser part of the Operating System?

Do these applications have to be running for you to use the


computer?

?
Operating Systems

Better definition: Kernel

The operating system is the one program that is running all


the time

Oftentimes called the system kernel

The kernel is the program that provides all the basic


functionalities that make your computer work.
All other programs are considered to be applications which
use the functionalities provided by the kernel

Operating Systems

Outline

Introduction

Definition by parts

Definition by functionalities

Definition by goals

Operating Systems

Layered View

Let us take a look at the whole picture

Operating Systems

Layered View

Physical Devices

The raw transistors, mechanical switches, wires, capacitors of your


computer.

Operating Systems

Layered View

Microarchitecture

Organization of the physical devices into circuits designed to store


bits, perform simple mathematical / logical operators, send/receive
data over wire, load/save data into physical medium

Operating Systems

10

Layered View

Machine Language

The programming language of your CPU

Instructions to the microarchitecture to do tasks

Some instructions take several microarchitecture compononents /


operations (such as number comparison)

Instructions are dependent on hardware

Operating Systems

11

Layered View

Operating System Kernel

Machine language is often very complicated

Operating System abstracts machine language from layers above it

Programs above are abstracted as to where in memory they run

Multiple programs running on a single processor

Save file instruction instead of write data into track 5, cylinder 9, sector 15
instruction

Runs in supervisor mode

OS kernel program is oftentimes protected by hardware from user tampering

Can execute instructions not given to programs in user mode

Operating Systems

12

Layered View

System tools

Additional programs provided by the Operating System publisher

Not part of the kernel but an integral part of the OS

Ex. Command Line, Compilers, Program for password changing...

Runs in user mode, access to only a small subset of instructions


allowed to the kernel

Operating Systems

13

Layered View

Application Programs

User programs such as word processing, games, web browser, etc...

Operating Systems

14

Layered View

As can be seen, OS acts as intermediary between the


hardware and user programs

Provides a simpler view of the underlying hardware for the user


programs

Translate user program instructions to hardware instructions

Operating Systems

15

Outline

Introduction

Definition by parts

Definition by functionalities

Definition by goals

Operating Systems

16

Major functionalities

What functionalities does the OS provide to the layers above


it then?

Process handling

Memory Management

Input/Output Management

File storage

Protection System

Command Interpreter System

Operating Systems

17

Process Management

Normal computer use now requires multiple applications to


run at the same time.

Operating Systems

18

Process Management

However, CPU can only run one instruction at a time!


Operating systems provide task switching functionalities
allowing multiple processes to run concurrently
Have to deal with issues such as process deadlocks,
synchronization and race condition

Operating Systems

19

Memory Management

Executing programs require memory space to run

OS answers some of the following functionalities

Allocation and deallocation of memory for programs

Where to load program into memory. Have to deal with the problem
of non-contiguous space allocation

What if there is not enough space in memory but a lot of idle


programs?

What if a program needs more memory than that was initially


allocated for it?

Operating Systems

20

I/O Management

Programming an application used to mean programming


every type of hardware that could be used with it.

Operating Systems

21

I/O Management

Now, the operating system provides a generic interface for


whatever hardware is being used for the computer
The I/O Management addresses other issues like

What if multiple programs all send data to the printer at the same
time?

Operating Systems

22

File Storage

Of course computer usage does not only involve running


programs or input/output to devices

A good portion of your hard disk space is data (document files,


music files, video files, etc...)

The Operating System should

Be able to create, delete, manipulate, move, load and save files

Be able to manage directories

Know where files are actually stored in the hard disk, floppy, USB,
etc.

Provide an easy and standard way for applications to use the above
operations (i.e. Saving to USB should not be different to hard disk)

Operating Systems

23

File Storage

Need to now things like

Where the file is stored in 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, 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)

Operating Systems

24

Protection System

OS handles multiple processes by multiple users

OS acts as an authorization system

Control access to resources

does User A have the right to modify file made by User B?

Can user C use the printer?

Process D should not be able to access memory of Process D

Operating Systems

25

Command Interpreter

OS must provide a way for users to enter commands

Command-line interpreter or shell

Graphical User Interface

Operating Systems

26

Outline

Introduction

Definition by parts

Definition by functionalities

Definition by goals

Operating Systems

27

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 Silberschatz, et al. these are:

Convenience

Efficiency

Operating Systems

28

Convenience

One of the goals of the Operating System is to make it very


easy for users to access and use the computer

Abstraction of hardware details

Simple to use instructions for programs

User-friendliness

Operating Systems

29

Efficiency

The other goal of the operating system is to operate the


computer to its potential

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

30

Exercises
1) Open the task manager of your computer to view the
working processes and see the active processes. Go online
to find out what each processes does.
1) What processes do you think are part of the operating system, what
parts do you consider to be application programs?
2) Try to terminate the programs you think are application programs.
Can you still use your computer even if these application programs
are not running? (dont worry, restarting your computer will make it
work again)

2) Are these two goals for operating systems enough? What


other operating system goals should there be?

Operating Systems

31

Sources

Linux screenshot - http://www.cyberciti.biz/faq/show-all-running-processes-in-linux/

Colonization soundcard picture Sid Meyer's Colonization, Microprose, 1994

Firefox logo Mozilla Firefox

Warcraft III picture Blizzard Entertainment

OS Definition Silberschatz, Galvin.Operating Systems Concepts.

Operating Systems

32

You might also like