24
Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer Systems Multiprocessor Systems Distributed Systems Real -Time Systems

Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Embed Size (px)

Citation preview

Page 1: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Chapter One: Introduction

• What is an operating system?• Simple Batch Systems• Multiprogramming Systems• Time-Sharing Systems• Personal-Computer Systems • Multiprocessor Systems• Distributed Systems• Real -Time Systems

Page 2: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

What is an Operating System?

• A program that acts as an intermediary between a user of a computer and the computer hardware.

• Operating system goals:– Execute user programs and make solving user

problems easier.– Make the computer system convenient to use.

• Use the computer hardware in an efficient manner.

Page 3: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Computer System Components

1. Hardware – provides basic computing resources (CPU, memory, I/O devices).

2. Operating system – controls and coordinates the use of the hardware among the various application programs for the various users.

3. Applications programs – define the ways in which the system resources are used to solve the computing problems of the users (compilers, database systems, video games, business programs).

4. Users (people, machines, other computers).

Page 4: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Abstract View of System Components

Page 5: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Operating System Definitions

• OS is a resource allocator– Manages all resources– Decides between conflicting requests for efficient and

fair resource use• OS is a control program

– Controls execution of programs to prevent errors and improper use of the computer

• Kernel – the one program running at all times (all else being application programs).

Page 6: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Operating System Definition (Cont.)• No universally accepted definition

• “Everything a vendor ships when you order an operating system” is good approximation– But varies wildly

• “The one program running at all times on the computer” is the kernel. Everything else is either a system program (ships with the operating system) or an application program

Page 7: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Simple Batch Systems• Hire an operator• User operator• Add a card reader• Reduce setup time by batching similar jobs• Automatic job sequencing – automatically transfers control from

one job to another. First rudimentary operating system.• Resident monitor

– initial control in monitor – control transfers to job – when job completes control transfers back to monitor

Page 8: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Memory Layout for a Simple Batch System

Page 9: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Simple Batch System

O.S. transfers job from one to another. It was always resident in memory as previous slide. To speed up exe., operators batched jobs with similar needs

and run them as a group. Thus, programmers leave their programs with operator. Output sent back to the programmers. In exe. time., the problem of slow I/O devices and the speed

of CPU. A fast card reader might read 1200 cards/minute

(20cards/second) Later, the introduction of disk technology, allowed O.S. to

keep all jobs in disks rather than cards.

Page 10: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Multiprogrammed SystemsSeveral jobs are kept in main memory at the same time, and the CPU is multiplexed among them.

Page 11: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Multiprogrammed SystemsUser cannot keep either CPU or I/O devices busy all times.Multiprogramming increase CPU utilization by organization jobs –CPU has one to execute.

The OS keeps several jobs in memory, this set is a subset of the jobs kept in job pools.

Jobs Pool is the all the jobs in the systems need to be executed.

Job pool – data structure that allows the OS to select which job to run next in order to increase CPU utilization.

The OS picks and starts exec. Of one job from the main memory.

The job may have to wait for some task.

Page 12: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Multiprogrammed Systems

•In a non-multiprogrammed system, the CPU would sit idle.

•In multiprogrammed system, the CPU switch to and exec. another job.

•When that job needs to wait, the CPU again switched to another job and so on.

•Eventually, the first job finishes waiting and get back to the CPU.

•All jobs in the systems are kept in job pools.

•This pool consists of all processes residing on the disk awaiting allocation for the main memory.

Page 13: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Multiprogrammed Systems

job scheduling: if several jobs need to be brought into memory and no enough room for them, the system must select among them.

CPU scheduling: several jobs are ready to run at the same time.

Page 14: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

OS Features Needed for Multiprogramming

• I/O routine supplied by the system.• Memory management – the system must allocate the memory to

several jobs.• CPU scheduling – the system must choose among several jobs ready

to run.• Allocation of devices.

Page 15: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Time-Sharing Systems–Interactive Computing

• Timesharing (multitasking) is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing– Response time should be < 1 second– Each user has at least one program executing in memory process– If several jobs ready to run at the same time CPU scheduling– If processes don’t fit in memory, swapping moves them in and out to

run– Virtual memory allows execution of processes not completely in

memory– The main advantage of virtual memory is that programs can be larger

than physical memory. – So programmers are free from concerns over the memory storage

imitation.

Page 16: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Personal-Computer Systems• Personal computers – computer system dedicated to a single user.• I/O devices – keyboards, mice, display screens, small printers.• User convenience and responsiveness.• Can adopt technology developed for larger operating system’ often

individuals have sole use of computer and do not need advanced CPU utilization of protection features.

Page 17: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Multiprocessor Systems• Multiprocessor systems with more than one CPU in close

communication.• Tightly coupled system – processors share memory and a clock;

communication usually takes place through the shared memory.• Advantages of this system:

– Increased throughput– Economical – Increased reliability

• If functions can be distributed properly among several processors, then the failure of one processor will not halt the system, only slow it down.

Page 18: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Multiprocessor Systems (Cont.)

• Symmetric multiprocessing (SMP)– Each processor runs an identical copy of the operating system.– Many processes can run at once without performance deterioration.– Most modern operating systems support SMP

• Asymmetric multiprocessing– Each processor is assigned a specific task; master processor schedules

and allocates work to slave processors.– More common in extremely large systems– So, master-slave relationship exist.

Page 19: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Symmetric Multiprocessing Architecture

Page 20: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Distributed Systems• A network is the simplest term. • Distribute the computation among several physical processors.• Loosely coupled system – each processor has its own local memory;

processors communicate with one another through various communications lines, such as high-speed buses or telephone lines.

• Advantages of distributed systems.– Resources Sharing – Computation speed up – load sharing – Reliability– Communications

Page 21: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Distributed Systems (Cont.)• Network Operating System– provides file sharing – provides communication scheme– runs independently from other computers on the

network

Page 22: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Distributed Systems (Cont.)

• (1) Client-Server Systems: Many systems now servers, responding to requests

generated by clients Compute-server provides an interface to client to

request services (i.e. database) File-server provides interface for clients to store and

retrieve files

Page 23: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Distributed Systems (Cont.)

• (2) Peer-to-Peer systems– Another model of distributed system– P2P does not distinguish clients and servers– Instead all nodes are considered peers– May each act as client, server or both

Page 24: Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer

Operating System Concepts

Real-Time Systems

• Often used as a control device in a dedicated application such as controlling scientific experiments, medical imaging systems, industrial control systems, and some display systems.

• Well-defined fixed-time constraints.• Hard real-time system.

– Secondary storage limited or absent, data stored in short-term memory, or read-only memory (ROM)

– Guarantees the critical tasks to be completed on time.• Soft real-time system

– Critical real-time task gets priority over other tasks until completed. – Useful in applications (multimedia, virtual reality) requiring

advanced operating-system features.