1 ceng 2034 introduction to operating systems tugba onal-suzek email: [email protected]

34
CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: [email protected]

Upload: johnathan-floyd

Post on 13-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

CENG 2034 Introduction to Operating Systems

Tugba Onal-Suzekemail: [email protected]

Page 2: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

CENG 2034

• Instructor: Tugba Onal-Suzek, E1-06• Email: [email protected]• Lecture Hours: Tue. 9:30-12:20 (C105)• Course Web page:

http://www.ceng.mu.edu.tr/~tugba/OS• SEND ME AN EMAIL WITH SUBJECT LINE “OS”

Page 3: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Text Books and References

1. Andrew S. Tanenbaum, Modern Operating Systems, 3rd Edition, 2007

http://www.ceng.mu.edu.tr/~tugba/OS/OperatingSystemsBook.pdf

2. Abraham Silberschatz, Peter B. Galvin, Greg Gagne, Addison-Wesley ,2003

Page 4: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Grading

• 4 Quizes and 1 small Project % 20

• Attendance %5• Midterm % 25• Final Exam % 50

Page 5: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Tentative SyllabusFeb 11 :Introduction to Operating Systems, Silberschatz 1.chapterFeb 18 : Process Control and SchedulingFeb 25: Process SynchronizationMar 4 : Deadlocks Mar 11 : Memory ManagementMar 18: Virtual MemoryMar 25: File SystemApr 1 : Input/Output (1)Apr 8 :MidtermApr 15: Input/Output (2) Apr 23: No class (national holiday)Apr 29: File System and Disk managementMay 6 :RevisionMay 13:Case Study 1: LinuxMay 20:Case Study 2: WindowsJune 3: Final exam

Page 6: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

A computer system consists of

• Processors• Main memory

• Disks

• Printers• Various input/output devices

Managing all these components requires a layer ofsoftware – the Operating System

T

Page 7: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Mainboard

mainboard

Page 8: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Processor (CPU)

Page 9: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

RAM

Page 10: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Punch card

Page 11: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Paper tape

Page 12: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com
Page 13: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

•Significant set-up time to run programs–To run a Fortran program might involve loading compiler from tape, reading program from cards and writing it to tape.

– The Fortran compiler would output assembly language which had to be read by assembler which was on another tape.

– Assembly language needed to be linked to library routines and then

– A binary object would be created which could be run from the console.

Early Computer Systems

Page 14: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Need for Batch Systems

•The significant amount of set up time of the early systems caused–low CPU utilization–inefficient use of expensive resources

•The programmer was also the operator

•Batch systems were created in order to increase the utilization of the machines.

Page 15: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Simple Batch Systems

•the operator of the machine loaded cards, produced output.

•next job could be started while programmer was off debugging the program.

•jobs with similar needs could be batchedtogether–first all the FORTRAN programs–next all the COBOL programs, etc

Page 16: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Resident Monitor

•The first rudimentary operating systems

•The resident monitor remained resident in memory–resident monitor transfers control to a program–when program ends, resident monitor resumes–resident monitor then transfers control to the next program

Page 17: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Control Cards•The programmer needed to specify to the resident monitor which programs to run

$JOB

$FTN

-begin job

-run Fortran compiler

<program to be compiled>

$LOAD

$RUN

<data for program>

$END

-load binary

-run binary

-end job

Page 18: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Resident Monitor Components

•Control card interpreter–reads control cards and carries out instructions

•Loader–needs to be able to mount appropriate tapes

•Device drivers for I/O devices–needs to be able to control printers, tapes, etc. without the programmer needing to write this code every time they write a new program

Page 19: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Advantages/Disadvantages of Resident Monitor

•Advantages–Automatic job sequencing–Better resource utilization

•Disadvantages–Lack of interaction between the user and job while the job is running–Turnaround time: there is a delay between job submission and job completion

Page 20: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Overlapping CPU and I/O usage

•The slow speed of mechanical I/O devices leads to low CPU utilization

•Off-line processing–Load cards (slow) onto a tape (fast)–CPU does all I/O to tape–Information on tape was fed directly to printer–Advantage: When I/O devices are coordinated with CPU jobs, turnaround time is shorter

–Disadvantage: I/O devices are still slow.

Page 21: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Spooling

•Disk systems replaced card readers and ended the need for off-line processing

•Spooling– Instead of the CPU sending the output to the printer, the output was sent first to disk, then the output was sent to the printer.

– Simultaneous Peripheral Operation On-Line– Overlaps I/O of one job with CPU of next job

Page 22: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Multiprogrammed Batch Systems

•Disks are random-access while tapes are sequential-access

•Since multiple batch jobs are stored on a disk, it is now possible to choose which job should be run next which introduces job scheduling

•Multiprogramming increases CPU utilization by organizing jobs efficiently

Page 23: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Primitive Job Scheduling

•Several jobs are stored in memory (a subset of the jobs stored on the disk).–One job is chosen to start running.–If that job has to wait for I/O (such as keyboard input, tape mount, disk write) the job scheduler switches to another job

–When the new job needs to wait, the scheduler switches to another job, etc.

Page 24: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Multiprogramming

•Multiprogramming is the first example of a fairly sophisticated operating system since for the first time the operating system is making choices for the user(s).

•Future topics raised by multiprogramming–Job/CPU scheduling–Memory management–Job interaction

Page 25: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Time-Sharing Systems

•Although batch systems allow system resources to be used more efficiently, the user cannot interact with the job while it is executing.

•Long turnaround time makes debugging difficult.

•Multitasking: CPU switches between jobs frequently to allow user interaction

Page 26: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Side effects of user interaction

•Online file system– User must be able to access data and code conveniently

•Batch systems were appropriate for large jobs; interactive jobs tend to have short response time

•Multiprogramming and time sharing are the central themes of modern operating systems

Page 27: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Personal Computers

•With the decreased cost of hardware, computer systems are once again dedicated to single users

•With only a single user, have features found on multi-user systems such as CPU utilization and file protection become less important?

Page 28: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Parallel Systems•Machines with multiple processors acting in parallel.

– Increased throughput (more work gets done)

– Increased reliability and cost effectiveness.

•Symmetric: Each processor runs its own operating system and processes.

•Asymmetric: Master processor schedules and allocates work to slave processors.

Page 29: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Distributed Systems•Computation is distributed among several processors

•Speeds up computation by partitioning jobs into subcomputations which can be run on separate machines

•Sharing resources such as disks, printers

•Reliability increases (failure of one node should not affect the rest)

•Communication between processes

Page 30: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Real-Time Systems•Rigid time requirements on the operation of a processor or flow of data

•Examples:medical imaging systems, auto fuel injection system, home-appliance controllers

•Hard real-time: critical jobs are guaranteed to run by a specific time

•Soft real-time: critical jobs get higher priority than non-critical jobs,

Page 31: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Operating Systems Basic Structure

• A main program that invokes the requestedservice procedure.

• A set of service procedures that carry out thesystem calls.

• A set of utility procedures that help the serviceprocedures.

Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Page 32: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

In Summary:Operating System is a Resource Manager

• Efficient use of limited resources- Improving utilization

- Minimizing overhead- Improving throughput• Can be achieved:

- Multi-user / Multiprogramming: multiple programs are executedconcurrently

• Allocating resources to applications across space and time- Time sharing a resource:

• Schedule access to resource by different users- Space sharing a resource:

• Allocate memory (or parts of it) to different users

Page 33: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Scheduling and Resource Management

• Operating system manages and allocatesprocessor and memory resources

• Resource allocation policies must consider- Efficiency: maximize throughput

- Fairness: all processes are served in a fair manner- Differential responsiveness: processes may behave different priorities and different servicerequirements

Page 34: 1 CENG 2034 Introduction to Operating Systems Tugba Onal-Suzek email: tugbas2001@yahoo.com

Information Protection and Security

• Access to computer systems and data must becontrolled

• Main issues- Availability: protect system against interruption

- Confidentiality: prevent unauthorized access to data- Data integrity: prevent unauthorized modification

- Authenticity: verify identity of users and theircredentials, verify validity of transmitted messages

and data