systems ii san pham cs 490 10/20/03. topics operating systems resource management – process...
TRANSCRIPT
TopicsTopics
Operating SystemsResource Management
– Process Management– CPU Scheduling– Deadlock
Protection/SecurityDistributed SystemsNetworking
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.
Resources OS ManagesResources OS Manages
Process Management *CPU Scheduling *Main MemoryFileI/O-SystemDeadlock *
Process ManagementProcess Management
Process is a program in executionRequires certain resources to accomplish task
– CPU time– Memory– Files– I/O devices
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
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
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
Process SchedulingProcess Scheduling
As processes enter the system, they are put into a “job queue”.
Resides in Main Memory
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
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
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.
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}
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
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
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
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.
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
Types of Attacks to gain Types of Attacks to gain accessaccess
Trojan HorseTrap DoorsStack and Buffer Overflow
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
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
NetworkingNetworking
Connection of two or more computers over a shared media
First developed in the late 1960s and was called the Arpanet.
Network TopologyNetwork Topology
Fully Connected – connection from every machine, 4 machines = 6 connections
Partially ConnectedTree Structured Star – widely usedRing – token ring