Top Banner
Systems II Systems II San Pham CS 490 10/20/03
28

Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Jan 04, 2016

Download

Documents

Ralph Preston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Systems IISystems II

San Pham

CS 490

10/20/03

Page 2: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

TopicsTopics

Operating SystemsResource Management

– Process Management– CPU Scheduling– Deadlock

Protection/SecurityDistributed SystemsNetworking

Page 3: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Operating SystemOperating System

What is an operating system?– A program that acts as an intermediary between

the user of a computer and the computer hardware.

Page 4: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Resources OS ManagesResources OS Manages

Process Management *CPU Scheduling *Main MemoryFileI/O-SystemDeadlock *

Page 5: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Process ManagementProcess Management

Process is a program in executionRequires certain resources to accomplish task

– CPU time– Memory– Files– I/O devices

Page 6: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Process StateProcess State

NewRunningWaitingReadyTerminatedSTEPS: New->Waiting->Ready->Run->Ter

Page 7: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Process Control BlockProcess Control Block

Each Process is represented in the OS by a PCB.

A PCB contains many pieces of information about a process.

The PCB simply serves as the repository for any information that may vary from process to process

Page 8: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

PCB informationPCB information

1. Process state – new, ready, running…2. Program counter – address of next

instruction to be executed3. CPU registers – registers which varies in

number and type, condition code, index register, stack pointer

4. CPU Scheduling info – process priority and pointer to scheduling queues

Page 9: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

PCB info. Cont.PCB info. Cont.

5. Memory Management info – value of base and limit registers

6. Accounting info – amount of CPU and real time used, time limits, job or process ID

7. I/O status info – list of I/O devices allocated to process

Page 10: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Process SchedulingProcess Scheduling

As processes enter the system, they are put into a “job queue”.

Resides in Main Memory

Page 11: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

CPU SchedulingCPU Scheduling

The objective is to maximize CPU utilization

CPU scheduling is central to operating system design

CPU selects on job to process form ready queue

Page 12: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Scheduling AlgorithmsScheduling Algorithms

First Come First Served (FCFS) – FIFO queue

Shortest Job First (SJF)- based on CPU burst, if there is a tie, FCFS is used

Priority Scheduling- Based on some fixed range of numbers, developers decide

Round Robin – Time Sharing system

Page 13: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

DeadlocksDeadlocks

A deadlock state occurs when 2 or more processes are waiting indefinitely for an event that can be caused only by one of the waiting processes.

Page 14: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Deadlock CharacteristicsDeadlock Characteristics

Deadlock situation can arise if the following 4 conditions hold SIMULTANEOUSLY in a system.

1. Mutual Exclusion- one resource must be held in a NONSHARABLE mode

2. Hold and Wait – P1 is holding one resource and waiting for P2 to release its resource

3. No Preemption- Resource cannot be preempted4. Circular Wait – a SET of waiting processes

{P0->P1->P2->…->Pn -> P0}

Page 15: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Dealing with DeadlocksDealing with Deadlocks

Use some protocol to prevent or avoid deadlocks

Allow the system to enter deadlock, detect it, and then recover

Ignore the problem all together and pretend that deadlocks never occur – Note: Used by many systems, including UNIX

Page 16: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

ProtectionProtection

Protection refers to a mechanism for controlling the access of programs, processes or users to the resources defined by a computer system

The processes in an operating system must be protected from one another’s activities

Various mechanisms can be used to ensure that the files, memory segments, CPU, and other resources can be operated on by only those processes that have gained proper authorization from the operating system

Page 17: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Examples of ProtectionExamples of Protection

Data files can be created, opened, read, written, closed, and deleted

Program files can be read, written, executed and deleted

Process should be able to access only those resources that it currently requires to complete its task

Page 18: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

SecuritySecurity

NOTE: Absolute protection of the system from malicious abuse is not possible, nonetheless there are mechanism to make security breaches a rare occurrence, rather than the norm.

Page 19: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Security measuresSecurity measures

Physical – site or sites containing the computer systems

Human – user must be screened to have physical access

Network – interception of data transmitted over public shared lines

Operating System – system must protect itself from accidental or purposeful security breaches

Page 20: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Types of Attacks to gain Types of Attacks to gain accessaccess

Trojan HorseTrap DoorsStack and Buffer Overflow

Page 21: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Annoying System ThreatsAnnoying System Threats

WormsVirusesDenial of Service

Page 22: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Preventive MeasuresPreventive Measures

Install Intrusion Detection– Types of intrusion

Signature based detection – analyze network traffic pattern

Anomaly detection – techniques used to detect anomalous behavior within computer systems

– Not all indicates an intrusion

Audit Trail Processing – for example logsInstall Tripwire – integrity checking tool

Page 23: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Distributed SystemsDistributed Systems

A distributed system is a collection of processors that DO NOT share MEMORY or CLOCK.

DS is a collection of loosely coupled processors interconnected by a communication network

Basically the WEB and a NETWORK

Page 24: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Benefits of DSBenefits of DS

Resource SharingComputation SpeedupReliabilityCommunication

Page 25: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

NetworkingNetworking

Connection of two or more computers over a shared media

First developed in the late 1960s and was called the Arpanet.

Page 26: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Common Network TypesCommon Network Types

LAN- local area networkWAN - wide area network

Page 27: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

Network TopologyNetwork Topology

Fully Connected – connection from every machine, 4 machines = 6 connections

Partially ConnectedTree Structured Star – widely usedRing – token ring

Page 28: Systems II San Pham CS 490 10/20/03. Topics Operating Systems Resource Management – Process Management – CPU Scheduling – Deadlock Protection/Security.

ReferenceReference

Silberschatz A., Galvin P., Gagne G.. Operating System Concepts, 6th edition. Wiley: 2003.