41
Operating Systems Introduction Introduction 1 of 41

COMP3044 Week 01A - Introduction

Embed Size (px)

Citation preview

Page 1: COMP3044 Week 01A - Introduction

Operating SystemsIntroduction

Introduction 1 of 31

Page 2: COMP3044 Week 01A - Introduction

What is Operating System?

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

Operating system goals:oExecute user programs and make solving user

problems easier.oMake the computer system convenient to use.oUse the computer hardware in an efficient

manner.

Introduction 2 of 31

Page 3: COMP3044 Week 01A - Introduction

Diagram of the Typical Computer System (Hardware)

Introduction 3 of 31

Page 4: COMP3044 Week 01A - Introduction

Computer System Components

1. Hardware –basic computing resources

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

3. Applications programs – (compilers, database systems, video games, business programs).

4. Users (people, machines, other computers). Abstract View of System Components

Introduction 4 of 31

Page 5: COMP3044 Week 01A - Introduction

Multiprogrammed Batch Systems

Introduction 5 of 31

Page 6: COMP3044 Week 01A - Introduction

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

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.

Introduction 6 of 31

Page 7: COMP3044 Week 01A - Introduction

Allocation of devices.

Introduction 7 of 31

Page 8: COMP3044 Week 01A - Introduction

Time-Sharing Systems–Interactive Computing

The CPU is multiplexed among several jobs that are kept in memory and on disk (the CPU is allocated to a job only if the job is in memory).

A job swapped in and out of memory to the disk.

On-line communication between the user and the system is provided; when the operating system finishes the execution of one command, it seeks the next “control statement” from the user’s keyboard.

Desktop Systems

Introduction 8 of 31

Page 9: COMP3044 Week 01A - Introduction

Personal computers –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 systems.

May run several different types of operating systems (Windows, MacOS, UNIX, Linux)

Introduction 9 of 31

Page 10: COMP3044 Week 01A - Introduction

Parallel Systems

Parallel systems are multiprocessor systems with more than one CPU in close communication.

Advantages of parallel system:

o Increased throughputoEconomical o Increased reliability

Graceful degradation Fail-safe systems1. Tightly coupled

system Processors share memory and a

Introduction 10 of 31

Page 11: COMP3044 Week 01A - Introduction

clock; communication usually takes place through the shared memory.

2. Symmetric multiprocessing (SMP)

Each processor runs an identical copy of the operating system.

Many processes can run at once without performance deterioration.

3. Asymmetric multiprocessing

Introduction 11 of 31

Page 12: COMP3044 Week 01A - Introduction

Each processor is assigned a specific task; master processor schedules and allocated work to slave processors.

More common in extremely large systemsDistributed

SystemsDistribute 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.

Advantages of distributed systems.oResources Sharing

Introduction 12 of 31

Page 13: COMP3044 Week 01A - Introduction

oComputation speed up – load sharing oReliabilityoCommunications

Requires networking infrastructure.

Local area networks (LAN) or Wide area networks (WAN)

May be either client-server or peer-to-peer systems.

Introduction 13 of 31

Page 14: COMP3044 Week 01A - Introduction

Operating System Structures

Introduction 14 of 31

Page 15: COMP3044 Week 01A - Introduction

Operating System Structures

Topics: Common System Components Operating System Services System Structure System Design and Implementation System Generation

Introduction 15 of 31

Page 16: COMP3044 Week 01A - Introduction

Common System Components

1. Process Management 2. Main Memory Management3. File Management4. I/O System Management5. Secondary Management6. Networking7. Protection System8. Command-Interpreter System1.

Process ManagementA process is a program in execution. A process needs

Introduction 16 of 31

Page 17: COMP3044 Week 01A - Introduction

certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task.

The operating system is responsible for the following activities in connection with process management:oProcess creation and deletion,oProcess suspension and resumption, andoProvision of mechanisms for:

Process synchronization, Process communication.

2. Main-Memory Management

Introduction 17 of 31

Page 18: COMP3044 Week 01A - Introduction

Memory is a large array of words or bytes, each with its own address. It is a repository of quickly accessible data shared by the CPU and I/O devices.

The operating system:

oKeeps track of which parts of memory are currently being used and by whom.

oDecides which processes to load when memory space becomes available.

oAllocates and deallocates memory space as needed.

3. File Management

Introduction 18 of 31

Page 19: COMP3044 Week 01A - Introduction

A file is a collection of related information defined by its creator. Files represent programs and data.

The operating system is responsible for the following activities in connections with file management:

oFile creation and deletion.oDirectory creation and deletion.oSupport of primitives for manipulating files and

directories.oMapping files onto secondary storage.oFile backup on stable (nonvolatile) storage media4. I/O

System ManagementThe I/O system consists of:

Introduction 19 of 31

Page 20: COMP3044 Week 01A - Introduction

oA buffer-caching system oA general device-driver interfaceoDrivers for specific hardware devices

5. Secondary-Storage Management

Since main memory (primary storage) is volatile and too small to accommodate all data and programs

Introduction 20 of 31

Page 21: COMP3044 Week 01A - Introduction

permanently, the computer system must provide secondary storage to back up main memory.

The operating system is responsible for the following activities in connection with disk management:

oFree space managementoStorage allocationoDisk scheduling

6. Networking (Distributed Systems)

A distributed system is a collection of processors that do not share memory or a clock.

Introduction 21 of 31

Page 22: COMP3044 Week 01A - Introduction

The processors in the system are connected through a communication network.

Communication takes place using a protocol.

A distributed system provides user access to system resources.

7. Protection System

Introduction 22 of 31

Page 23: COMP3044 Week 01A - Introduction

Protection refers to a mechanism for controlling access by programs, processes, or users to both system and user resources.

The protection mechanism must:

oDistinguish between authorized and unauthorized usage.

oSpecify the controls to be imposed.

oProvide a means of enforcement.8. Command-Interpreter System

Introduction 23 of 31

Page 24: COMP3044 Week 01A - Introduction

Many commands are given to the operating system by control statements that deal with:

oProcess creation and managemento I/O handlingoSecondary-storage managementoMain-memory managementoFile-system access oProtection oNetworking

The program that reads and interprets control statements is called variously:

Introduction 24 of 31

Page 25: COMP3044 Week 01A - Introduction

ocommand-line interpreter, oroshell (in UNIX)

Its function is to get and execute the next command statement.

Operating System Services

Introduction 25 of 31

Page 26: COMP3044 Week 01A - Introduction

Program execution – system capability to load a program into memory and to run it.

I/O operations – since user programs cannot execute I/O operations directly, the operating system must provide some means to perform I/O.

File-system manipulation – program capability to read, write, create, and delete files.

Communications – exchange of information between processes executing either on the same computer or

Introduction 26 of 31

Page 27: COMP3044 Week 01A - Introduction

on different systems tied together by a network. Implemented via shared memory or message passing.

Error detection – ensure correct computing by detecting errors in the CPU and memory hardware, in I/O devices, or in user programs.

Additional Operating System Functions

Introduction 27 of 31

Page 28: COMP3044 Week 01A - Introduction

Additional functions exist not for helping the user, but rather for ensuring efficient system operations.

Resource allocation – allocating resources to multiple users or multiple jobs running at the same time.

Accounting – keep track of and record which users use how much and what kinds of computer resources for account billing or for accumulating usage statistics.

Protection – ensuring that all access to system resources is controlled.System Generation (SYSGEN)

Introduction 28 of 31

Page 29: COMP3044 Week 01A - Introduction

Operating systems are designed to run on any of a class of machines; the system must be configured for each specific computer site.

SYSGEN program obtains information concerning the specific configuration of the hardware system.

oBooting – starting a computer by loading the kernel.

oBootstrap program – code stored in ROM that is able to locate the kernel, load it into memory, and start its execution.

UNIX System Structure

Introduction 29 of 31

Page 30: COMP3044 Week 01A - Introduction

UNIX OS consists of two separable parts:

oSystems programs, andoThe kernel

Kernel consists of everything below the system-call interface and above the physical hardware

Kernel provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one level.

UNIX System Structure

Introduction 30 of 31

Page 31: COMP3044 Week 01A - Introduction

Introduction 31 of 31