operating system concepts prepared by a.shamila ebenezer

58
OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Upload: rachael-towsley

Post on 15-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

OPERATING SYSTEM CONCEPTS

Prepared by A.Shamila Ebenezer

Page 2: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

FUNDAMENTALS

Page 3: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

An operating system (OS) is software that manages computer hardware and software resources and provides common services forcomputer programs. Operating systems can be found on almost any device that contains a computer—from cellular phones and video game consoles to supercomputers and web servers.

OPERATING SYSTEM

Page 4: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Android BSDiOS

Linux OS X QNX

Microsoft WindowsWindows Phone

IBM z/OS

MOST POPULAR OPERATING

SYSTEMS

Page 5: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

2013 Worldwide Device Shipments by Operating System

Operating System 2012 (Million of Units)

2013 (Million of Units)

Android 504 878

Windows 346 328

iOS/Mac OS 214 267

BlackBerry 35 24

Others 1,117 803

Total 2,216 2,300

MARKET STATUS OF USAGE OF OPERATING

SYSTEM

Page 6: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

management of multiple processes on a uniprocessor

architecture

multiprogramming

Page 7: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

The main objective of multiprogramming is to

have process running at all times. With this design,

CPU utilization is said to be maximized.

Objective of multiprogramming

Page 8: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

•FCFS•SJF•PREMPTIVE AND NON PREEMPTIVE SJF•PREEMPTIVE SCHEDULING• ROUND ROBIN

CPU SCHEDULING

Page 9: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

management of multiple processes

on a multiprocessor architecture

multiprocessing

Page 10: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

each processor is assigned specific

tasks by a "Master processor

Asymmetric Multiprocessing

Page 11: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

With an increased number of processors, there is

considerable increase in throughput. It can also save

more money because they can share resources. Finally,

overall reliability is increased as well.

What are the advantages of a multiprocessor

system?

Page 12: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

number of processes that complete their

execution per time unit.

Throughput

Page 13: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

amount of time to execute a particular process.

Turnaround time

Page 14: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

amount of time a process has been

waiting in the ready queue.

Waiting time

Page 15: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

time it takes for the computer system to give response to the

service request

Response Time

Page 16: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

In a Time sharing system, the CPU executes multiple jobs by

switching among them, also known as multitasking. This process happens so fast that

users can actually interact with each program while it is running.

What are time sharing

systems?

Page 17: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

bootstrap program is loaded at power-up or reboot•Typically stored in ROM or EEPROM, generally known as firmware•Initializates all aspects of system•Loads operating system kernel and starts execution

Bootstrap

program

Page 18: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

loading a program into memory on

demand

dynamic loading

Page 19: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

loading a program all at once in

memorystatic loading

Page 20: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

library functions can be

connected at load-time

dynamic linking

Page 21: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

all library functions

included in the code

static linking

Page 22: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Switching the CPU to another process requires saving the state of the old process and loading the saved state for the new process. This task is known

as a context switch. Context-switch time is pure overhead, because the system does no useful work while switching. Its speed varies from machine to machine, depending on the memory speed, the number of registers which must be copied, the existed of special instructions(such as a single

instruction to load or store all registers).

Context Switch

Page 23: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

signal sent from hardware or software

to CPU to transfer execution to some other instructions

Interrupt

Page 24: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Device drivers provides a standard means of

representing I/O devices that maybe manufactured by different companies. This

prevents conflicts whenever such devices are incorporated

in a systems unit.

What are device drivers?

Page 25: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

GUI is short for Graphical User Interface. It provides users with an interface wherein actions can be performed by interacting

with icons and graphical symbols. People find it easier to interact with the computer

when in a GUI especially when using the mouse. Instead of having to remember and type commands, users just click on buttons

to perform a process.

What is GUI?

Page 26: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Preemptive multitasking allows an operating system to switch

between software programs. This in turn allows multiple programs to run without necessarily taking

complete control over the processor and resulting in system

crashes.

What is preemptive

multitasking?

Page 27: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

PROCESS MANAGEMENT

Page 28: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

A program loaded into memory and executing

Process

Page 29: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

A thread is a basic unit of CPU utilization. In

general, a thread is composed of a thread ID,

program counter, register set and the

stack.

What is a thread?

Page 30: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

– there is an increased responsiveness to the user

– resource sharing within the process

– economy– utilization of

multiprocessing architecture

Give some benefits of

multithreaded programming.

Page 31: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

DEADLOCK

Page 32: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

When a process requests an available resource, system must decide if immediate allocation leaves the

system in a safe state. System is in safe state if there exists a safe

sequence of all processes. Deadlock Avoidance: ensure that a system will

never enter an unsafe state.

What is a Safe State and what is its use

in deadlock avoidance?

Page 33: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Banker’s algorithm is one form of deadlock-avoidance in a system. It

gets its name from a banking system wherein the bank

never allocates available cash in such a way that it can no longer

satisfy the needs of all of its customers.

Describe Banker’s

algorithm

Page 34: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

SYNCHRONIZATION

Page 35: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

when the outcome of the multiple process

execution depends on the order of the execution of the

instructions of the processes

race condition

Page 36: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

elementary synchronization problem where a set of

threads indefinitely alternate between

executing the critical section and non-critical

section

mutual exclusion

Page 37: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

a requesting thread is not

allowed to enter the critical sectionstarvation

Page 38: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

general locking mechanism;

generally initialized to 1

semaphore

Page 39: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

MEMORY MANAGEMENT

Page 40: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Main memory is the only large storage

media that the CPU can access directly.

What is main memory?

Page 41: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

storage that does not lose its contents when power is removedNVRAM-nonvolatile storage which is DRAM with battery backup power

Nonvolatile storage

Page 42: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

in which some parts of memory

take longer to access than other

parts

Non-Uniform Memory Access (NUMA)-

Page 43: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Caching is the processing of utilizing a region of fast

memory for a limited data and process. A cache

memory is usually much efficient because of its high

access speed.

What is caching?

Page 44: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Makes sure that an update of a value of A

in one cache is immediately reflected

in all other caches where A resides

Cache Coherency

Page 45: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Virtual memory is a memory management technique for

letting processes execute outside of memory. This is very useful especially is an

executing program cannot fit in the physical memory.

What is virtual

memory?

Page 46: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Paging is a memory management scheme that

permits the physical-address space of a process to be

noncontiguous. It avoids the considerable problem of having to fit varied sized memory chunks onto the

backing store.

What is the basic function

of paging?

Page 47: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Fragmentation is memory wasted. It can be internal if we are dealing with systems that

have fixed-sized allocation units, or external if we are dealing

with systems that have variable-sized allocation units.

What is fragmentation?

Page 48: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

if data is accessed once, it will likely be

accessed again in the future

locality of reference principle

Page 49: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Demand paging is a system wherein area of memory

that are not currently being used are swapped to disk

to make room for an application’s need.

What is demand paging?

Page 50: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Trashing refers to an instance of high paging activity. This happens

when it is spending more time paging instead of

executing.

When does thrashing occur?

Page 51: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

When a device controller transfers an entire block of data from its own buffer storage to memory without CPU intervention

Direct Memory Access (DMA)

Page 52: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

A computer instruction that can be executed only by a supervisory program - can only be executed only

in kernel mode

Privileged Instruction

Page 53: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

added to the hardware of the computer to indicate the

current mode: kernel(0) or user (1). Distinguishes between a task that is

executed on behalf of the OS and one is that executed on

behalf of the user

Mode Bit

Page 54: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

Ability to continue providing service proportional to the level of surviving hardware

Graceful Degradation

Page 55: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

A trap is a software-generated interrupt caused by either an

error or a user request.

What is a trap?

Page 56: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

each process is divided up into a number of small,

fixed-size partitions called pages

pages

Page 57: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

physical memory is divided into a large

number of small, fixed-size partitions

called frames

frames

Page 58: OPERATING SYSTEM CONCEPTS Prepared by A.Shamila Ebenezer

per process data structure that

provides mapping from page to frame

page table