21
Oct-03 1 Operating Systems Mr. Joseph Cordina

Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 1

Operating Systems

Mr. Joseph Cordina

Page 2: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 2

Course IntroductionThis course will provide an overview of most Operating Systems.It describes the requirements of most Operating Systems and the common techniques used to achieve these requirements.Course is split up in lectures followed by a test (50%) and a coursework (50%).These course notes will be provided in .pdf formatReference textbooks:– Silberschatz, A. and Galvin. P.B., Operating Systems

Concepts. Addison Wesley.– Deitel, H.M., 1990, Operating Systems.

Please send me an e-mail on:– [email protected]

Course builds up on knowledge of previous lectures so be sure to cover everything by the next lecture.Lecture attendance is obligatory.Lecture Notes available at– www.cs.um.edu.mt/~jcord

Page 3: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 3

Introduction

What is an Operating System?Operating System FunctionsOperating System TypesHistory of Operating Systems

Page 4: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 4

Basic Concepts

Process: Instance of a program in executionCPU: executes Processes; CPU is given a machine instruction, it executes it and automatically executes the following instruction (exception with jmp instructions)Resource: A component of a computer system for which processes can competeScheduling: The process of allocating a CPU to start or resume execution of a process.

Page 5: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 5

What is an Operating System?It is just a program.A program that acts as an intermediary between a user of a computer and the computer hardware.Directs the processor in the use of system resourcesUses the computer hardware in an efficient manner.Must be reliable and make good use of resources

Page 6: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 6

Operating Systems FunctionsResource Sharing– A user or multiple users together with multiple processes are able to share resources between them

Provision of a Virtual Machine– Provide users with a usable form of the underlying

hardware• IO• Memory• Filing System• Protection and Error Handling• Program Interaction• Program Control

Page 7: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 7

Operating System TypesNo of Users– Single User

• One user at a time (Windows 98)– Multiple Users

• Many concurrent logged sessions (UNIX). • Each user is given impression that he is the sole user of the

machine (Virtual Machine)

Multi-Programming– When a process has to wait for an IO to terminate, the CPU

is scheduled to another process.Multi-Tasking– Several processes are executed apparently in parallel by

sharing system resources. Multi-Tasking implies Multi-Programming.

Page 8: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 8

Computer System Components1.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 9: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 9

Abstract View of System Components

Page 10: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 10

Operating System Definitions

Resource allocator – manages and allocates resources.Control program – controls the execution of user programs and operations of I/O devices .Kernel – the one program running at all times (all else being application programs).

Page 11: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 11

First Computers

Programmer sat at the machineProgram was executedProgrammer reviewed the resultsResult: Most of the time the computer was just idle doing nothing at all.

Page 12: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 12

Batching Systems- 1st OSThe first OS was a human being.Operator fed jobs to the machine one by one (using punch tapes and cards).Setup time was reduced by batching similar jobs.When things went wrong, the operator has to sort out the problem.The CPU was idle when such problems were being sorted out.

Page 13: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 13

1st Programmed OSA small program was built which automatically transferred the CPU to the next job. Automatic job sequencing.This resident monitor executed the following loop:– Initial control in monitor.– Control transfers to job.– When job completes control transfers back to monitor.

Monitor knew which job to execute next by using control cards fed by operator.This system starts to provide to user-computer interaction.Unfortunately CPU was still idle due to slow I/O.

Page 14: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 14

Memory Layout for a Simple Batch System

Page 15: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 15

Multi-Programmed Batch Systems

With the advent of cheaper and more efficient memory, many jobs started being placed in memory.The OS could allocate the processor to another job whenever the current one has to wait for a command or for an I/O device operation.

Page 16: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 16

Advantage of Multi-Programming

A and B both request an I/O operation

RunA

RunBWait

Time

Wait

RunA

RunAWait

Time

WaitRunB

RunB

Page 17: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 17

OS Features Needed for Multiprogramming

For Batch Multi-Programming the OS has to become smarter.– 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.– Hard Disk started being used to store a

multitude of jobs.– Allocation of devices.

Page 18: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 18

Spooling

Simultaneous Peripheral Operation On-LineThe disk is used as a large buffer to store I/O operations that have not yet completed.– Incoming input data is stored until all the

requested data is available– Outgoing output data is stored on disk until

the output device has finished the job.

Page 19: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 19

Time-Sharing Systems–Interactive Computing

This is the natural progression from multi-programmed batched systems.The idea is that switching between one job to the next occurs continuously regardless of the need to perform I/O operations.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).By switching very quickly from one job to the next, that the user gets to interact with any job practically in real-time.

Page 20: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 20

Time-Sharing Systems–Interactive Computing (cont)

When memory is full, 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.On-line system must be available for users to access data and code.This system also allows more than one user to utilize the system, giving the impression that he has immediate access to his processes.This made today’s PC possible.

Page 21: Operating Systems - L-Università ta' Maltajcor1/oldwebsite/OS1.pdf · It is just a program. A program that acts as an intermediary between a user of a computer and the computer hardware

Oct-03 21

End of Section