23
CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, [email protected])

CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, [email protected])

Embed Size (px)

Citation preview

Page 1: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

CY2003Computer Operating Systems

Lecture 01

Introduction

Abir Hussain (JPB6.33, [email protected])

Page 2: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 2

Introduction

• Teaching by lectures, laboratories and tutorials. – the material is mainly theoretical

– the analysis is mainly informal

– reinforced by practical labs under LINUX

Page 3: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 3

Module Assessment

• The module will be assessed by– written exam: 2 hours (75%)

– coursework (25%)• programming assignment

Page 4: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 4

Recommended Texts

• Recommended module texts– 1. A. Tanenbaum “Modern Operating Systems”

Prentice-Hall, 2001, ISBN 0-13-031358-0

– 2. G. Nutt “Operating Systems- A modern Perspective”, Addition-Wesley, 1997, ISBN 0-8053-12951.

– 3. C. Ritchie, “Operating Systems incorporating UNIX and Windows” 3rd edition, Letts Education Publication, 1997, ISBN 1-85805-3021.

Page 5: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 5

Syllabus

Introduction tooperating system

Processes andProcesses

Scheduling

Inter processesCommunication

File Concept andFile

ImplementationMemory

Management

VirtualMemory

Page 6: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

What is an Operating System?

Page 7: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 7

Operating Systems

• In the early days of computing (1950’s and 60’s) the operator had to know how the system worked– the users programmed the machine code via paper tape

– the computers performed one program at a time

– all resources were available to the program• any resource not in use was idle (i.e. wasted)

– e.g. the CPU was idle while the tape was being read

– system was idle while the user programmed a new task

• The process is wasteful, inefficient, and impossible to manage as computers got bigger and better

Page 8: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 8

user

operatingenvironment

application programs

operating system

hardware

What is an Operating System?

• An operating system is a suite of programs that relieves the user from the tedious chores of having to deal with the hardware directly

• An operating system has three main functions– to manage hardware– to support applications– to establish a user interface

Page 9: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 9

Two Views of an Operating System

• Operating systems can be thought of in two ways– virtual machine viewpoint

• the operating system deals with the hardware devices directly and provides the user with a set of device independent, simple and logical set of services

– the resulting ‘virtual machine’ is easier to program

– resource manager viewpoint• a computer consists of many resources such as processor(s),

memory, disks, screens, printers and interface cards, etc

• the operating system shares these resources (fairly) between different users or different programs that are running

– imagine two programs trying to print at the same time without an operating system making sure they don’t interfere with each other!

Page 10: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

A Brief Historyof Operating Systems

Page 11: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 11

The First Generation

• Early computers were specially built machines that filled entire rooms– dedicated users would sign up for blocks of time

• They were programmed one step at a time by switches, paper tape or, later, punched cards– tape/card had to be loaded into the computer, run and

when finished the operator could inspect the output

• As more complex hardware, such as printers, came along they had to be programmed each time– software libraries of useful functions were developed– these could be loaded from tapes or cards if required

Page 12: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 12

The Second Generation

• The introduction of the transistor in mid-1950’s meant commercial computer systems to do work– big corporations, government agencies or universities

• To run a job (one or more programs)– program written out on cards, cards submitted,

program read in, data read in, job run, collect output– special employees who were practiced operators

• High level languages such as COBOL and FORTRAN were developed to make writing programs easier– the compiler must be loaded from tape prior to job– jobs batched up (submitted in groups) to save time

Page 13: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 13

The Third Generation

• With automated job control it was realised that much CPU time was wasted ‘waiting’ for peripherals (input / output devices)– one solution was to allow several programs to be read

into main memory and to switch jobs automatically• multiprogramming

– another solution was to read input or write output onto hard disk (which was quicker) until the input / output device was free, so that the job could continue

• spooling: simultaneous peripheral operation on-line

• These required more complex operating systems

Page 14: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 14

The Fourth Generation

• As technology improved (more and more rapidly) and prices tumbled the idea of personal computers became more popular– each user has her/his complete computer system with

input / output devices• keyboard, mouse, display screen, printer

• With plentiful resources and only one user, do we still need operating systems?– Yes!

• increased demand for ‘user-friendliness’: i.e. abstraction

• demand for flexibility: i.e. job control, virtual memory

Page 15: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

Operating System Concepts

Page 16: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 16

What is a Process?

• A process is an instance of a program that is being executed– a program which is loaded into memory and is running

• A process is an active entity– a program is passive: instructions that may be run

Page 17: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 17

A Process Tree• Processes may create other processes

– the creator is referred to as the parent process– the created is referred to as the child process

A

D E F

B C

• Process A created two child processes: B and C– process B created three child processes: D, E and F

Page 18: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 18

Files

• A file is a collection of related information– all modern operating systems provide services to allow

flexible files of variable size– allows data to be stored together, while hiding the

details of the actual hardware device from the user

• All operating systems now support the concept of the directory or folder– a file of special significance to the operating system

• holds the names of other files, to group them together

• Directories can be placed in other directories to form a tree structure (which may be very ‘deep’)

Page 19: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

Operating System Structures

Page 20: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 20

System Calls

• System calls provide the interface between a process and the operating system– the virtual machine layer visible to the user– the control mechanism that connects a user process

(user mode) to the operating system (privileged mode)

• They typically provide services such as– process control: create, terminate, wait

– file manipulation: create, delete, open, close, read, write

– device manipulation: allocate, deallocate, read, write

– information maintenance: set/get date/time, user info

– communications: create/delete connection, send, receive

Page 21: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 21

The Unstructured Approach• The ‘big mess’

– the structure is that there is no structure!– MS-DOS is a ‘good’ example of this approach

• application programs (users) have direct access to devices

device drivers

MS-DOS device drivers

resident system program

application program

Page 22: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 22

Layers

• A structured approach is found in the layer model– operating system comprises a number of layers, each

of which can only invoke operations on lower layers

• A typical (abstract) layer structure may be

layer 0: hardware

layer 1: CPU scheduling

layer 2: memory management

layer 3: device drivers

layer 4: buffering for input / output devices

layer 5: user programs

Page 23: CY2003 Computer Operating Systems Lecture 01 Introduction Abir Hussain (JPB6.33, a.hussain@livjm.ac.uk)

© JMU, 2004 CY2003-01 23

Summary

• Module Overview

– Syllabus

– assessment outline

• What is an Operating System?

– purpose and functions

• A Brief History

– five generations of computing